taf = (report_type, -sep)?, (status, -sep)?, icao_airport_code, -sep,
(time_of_issue, -sep)?,
(nil | validity, (-sep, (cancelled | base, (-sep, change)*, (-sep, temperature)*))?),
(-sep, remark)?,
(-[Zs; #9; #a; #d]*, -'=')?, -[Zs; #9; #a; #d]*.
-sep = -[' '; #9; #a; #d]+.
report_type = 'TAF'.
status = code_amd, info_amd | code_cor, info_cor.
code_amd>code = 'AMD'.
info_amd>info = +"amended".
code_cor>code = 'COR'.
info_cor>info = +"corrected".
icao_airport_code = !keyword, [Lu], [Lu], [Lu], [Lu].
-keyword = 'TAF' | 'AMD' | 'COR'.
nil = -'NIL', +"no forecast".
cancelled = -'CNL', +"cancelled".
-d = ["0"-"9"].
-nz = ["1"-"9"].
time_of_issue = day, time, time_zone.
day = d, d.
time = hour, minute.
hour = d, d.
minute = d, d.
time_zone = -'Z', +"UTC".
validity = period.
-period = from, -'/', to.
from = day, hour.
to = day, hour.
base = group++-sep, (-sep, temperature)*.
change = (fm | becmg | tempo | inter | prob), (-sep, group)*.
-fm = code_fm, info_fm, fm_time.
code_fm>code = 'FM'.
info_fm>info = +"from".
fm_time>from = day, hour, minute.
-becmg = code_becmg, info_becmg, -sep, period.
code_becmg>code = 'BECMG'.
info_becmg>info = +"becoming".
-tempo = code_tempo, info_tempo, -sep, period.
code_tempo>code = 'TEMPO'.
info_tempo>info = +"temporarily".
-inter = code_inter, info_inter, -sep, period.
code_inter>code = 'INTER'.
info_inter>info = +"intermittently".
-prob = -'PROB', probability, -sep, (code_tempo, info_tempo, -sep | code_prob, info_prob), period.
probability = '30' | '40'.
code_prob>code = +"PROB".
info_prob>info = +"with probability".
-group = wind
| visibility
| directional_visibility
| weather
| no_significant_weather
| clouds
| vertical_visibility
| cavok
| wind_shear.
-temperature = max_temperature | min_temperature.
max_temperature = -'TX', air_c, -'/', day, hour, time_zone.
min_temperature = -'TN', air_c, -'/', day, hour, time_zone.
air_c = (-'M', +"-")?, num2.
wind_shear = -'WS', altitude_ft, -'/', wind_direction.
-num2 = -'0', d | nz, d.
-num3 = -'00', d | -'0', nz, d | nz, d, d.
-num4 = -'000', d | -'00', nz, d | -'0', nz, d, d | nz, d, d, d.
-hundreds_of_feet = -'00', nz, +"00"
| -'0', nz, d, +"00"
| nz, d, d, +"00"
| -'00', '0'.
wind = wind_direction | wind_variation.
wind_direction = (degrees | variable), speed.
degrees = num3.
variable = -'VRB', +"variable".
speed = value, gust?, unit?.
value = num2 | nz, d, d.
gust = -'G', (num2 | nz, d, d).
unit = unit_kt | unit_mps | unit_kmh | unit_kph.
-unit_kt = code_kt, info_kt.
code_kt>code = 'KT'.
info_kt>info = +"knots".
-unit_mps = code_mps, info_mps.
code_mps>code = 'MPS'.
info_mps>info = +"meters per second".
-unit_kmh = code_kmh, info_kmh.
code_kmh>code = 'KMH'.
info_kmh>info = +"kilometers per hour".
-unit_kph = code_kph, info_kph.
code_kph>code = 'KPH'.
info_kph>info = +"kilometers per hour".
wind_variation = from_degrees, -'V', to_degrees.
from_degrees = num3.
to_degrees = num3.
visibility = (meters | ten_km_or_more, ten_km_info | more_than?, miles | not_available), '+'?.
meters = !'9999', num4.
ten_km_or_more>meters = '9999'.
ten_km_info>info = +"10 km or more".
miles = (d+, (' ', d+, '/', d+)? | d+, '/', d+), -'SM'.
more_than = -'P', +"more than".
not_available = -'////', +"not available".
directional_visibility = meters, direction.
direction = 'NE' | 'NW' | 'SE' | 'SW' | 'N' | 'E' | 'S' | 'W'.
weather = observation.
recent_weather = -'RE', observation.
no_significant_weather = -'NSW', +"no significant weather".
observation = intensity?, (characteristic+, weather_type* | weather_type+).
intensity = -'-', +"light" | -'+', +"heavy" | -'VC', +"in the vicinity".
-characteristic = char_bc | char_bl | char_dr | char_fz | char_mi | char_pa | char_pr | char_sh | char_ts.
-char_bc = code_bc, info_bc.
code_bc>chrct = 'BC'.
info_bc>chrct-info = +"patches of".
-char_bl = code_bl, info_bl.
code_bl>chrct = 'BL'.
info_bl>chrct-info = +"blowing".
-char_dr = code_dr, info_dr.
code_dr>chrct = 'DR'.
info_dr>chrct-info = +"low drifting".
-char_fz = code_fz, info_fz.
code_fz>chrct = 'FZ'.
info_fz>chrct-info = +"freezing".
-char_mi = code_mi, info_mi.
code_mi>chrct = 'MI'.
info_mi>chrct-info = +"shallow".
-char_pa = code_pa, info_pa.
code_pa>chrct = 'PA'.
info_pa>chrct-info = +"partial".
-char_pr = code_pr, info_pr.
code_pr>chrct = 'PR'.
info_pr>chrct-info = +"partial".
-char_sh = code_sh, info_sh.
code_sh>chrct = 'SH'.
info_sh>chrct-info = +"showers".
-char_ts = code_ts, info_ts.
code_ts>chrct = 'TS'.
info_ts>chrct-info = +"thunderstorm".
-weather_type = type_br | type_ds | type_du | type_dz | type_fc | type_fg | type_ra | type_va
| type_fu | type_gr | type_gs | type_hz | type_ic | type_pe | type_pl | type_po
| type_py | type_sa | type_sg | type_sn | type_sq | type_ss | type_up.
-type_ra = code_ra, info_ra.
code_ra>type = 'RA'.
info_ra>type-info = +"rain".
-type_br = code_br, info_br.
code_br>type = 'BR'.
info_br>type-info = +"mist".
-type_ds = code_ds, info_ds.
code_ds>type = 'DS'.
info_ds>type-info = +"dust storm".
-type_du = code_du, info_du.
code_du>type = 'DU'.
info_du>type-info = +"widespread dust".
-type_dz = code_dz, info_dz.
code_dz>type = 'DZ'.
info_dz>type-info = +"drizzle".
-type_fc = code_fc, info_fc.
code_fc>type = 'FC'.
info_fc>type-info = +"funnel cloud".
-type_fg = code_fg, info_fg.
code_fg>type = 'FG'.
info_fg>type-info = +"fog".
-type_va = code_va, info_va.
code_va>type = 'VA'.
info_va>type-info = +"volcanic ash".
-type_fu = code_fu, info_fu.
code_fu>type = 'FU'.
info_fu>type-info = +"smoke".
-type_gr = code_gr, info_gr.
code_gr>type = 'GR'.
info_gr>type-info = +"hail".
-type_gs = code_gs, info_gs.
code_gs>type = 'GS'.
info_gs>type-info = +"small hail".
-type_hz = code_hz, info_hz.
code_hz>type = 'HZ'.
info_hz>type-info = +"haze".
-type_ic = code_ic, info_ic.
code_ic>type = 'IC'.
info_ic>type-info = +"ice crystals".
-type_pe = code_pe, info_pe.
code_pe>type = 'PE'.
info_pe>type-info = +"ice pellets".
-type_pl = code_pl, info_pl.
code_pl>type = 'PL'.
info_pl>type-info = +"ice pellets".
-type_po = code_po, info_po.
code_po>type = 'PO'.
info_po>type-info = +"dust or sand whirls".
-type_py = code_py, info_py.
code_py>type = 'PY'.
info_py>type-info = +"spray".
-type_sa = code_sa, info_sa.
code_sa>type = 'SA'.
info_sa>type-info = +"sand".
-type_sg = code_sg, info_sg.
code_sg>type = 'SG'.
info_sg>type-info = +"snow grains".
-type_sn = code_sn, info_sn.
code_sn>type = 'SN'.
info_sn>type-info = +"snow".
-type_sq = code_sq, info_sq.
code_sq>type = 'SQ'.
info_sq>type-info = +"squalls".
-type_ss = code_ss, info_ss.
code_ss>type = 'SS'.
info_ss>type-info = +"sand storm".
-type_up = code_up, info_up.
code_up>type = 'UP'.
info_up>type-info = +"unknown precipitation".
clouds = cloud_observation.
cloud_observation>observation = cloud_cover, altitude_ft?, cloud_type?.
cloud_cover = cover_skc | cover_ncd | cover_clr | cover_nsc | cover_few | cover_sct | cover_bkn | cover_ovc.
-cover_skc = code_skc, info_skc.
code_skc>code = 'SKC'.
info_skc>info = +"sky clear".
-cover_ncd = code_ncd, info_ncd.
code_ncd>code = 'NCD'.
info_ncd>info = +"no clouds detected".
-cover_clr = code_clr, info_clr.
code_clr>code = 'CLR'.
info_clr>info = +"no clouds below 12000 ft".
-cover_nsc = code_nsc, info_nsc.
code_nsc>code = 'NSC'.
info_nsc>info = +"no significant clouds".
-cover_few = code_few, info_few.
code_few>code = 'FEW'.
info_few>info = +"few (1-2 oktas)".
-cover_sct = code_sct, info_sct.
code_sct>code = 'SCT'.
info_sct>info = +"scattered (3-4 oktas)".
-cover_bkn = code_bkn, info_bkn.
code_bkn>code = 'BKN'.
info_bkn>info = +"broken (5-7 oktas)".
-cover_ovc = code_ovc, info_ovc.
code_ovc>code = 'OVC'.
info_ovc>info = +"overcast (8 oktas)".
altitude_ft = hundreds_of_feet | -'///', +"unknown".
cloud_type = type_cb | type_tcu | type_unknown.
-type_cb = code_cb, info_cb.
code_cb>code = 'CB'.
info_cb>info = +"cumulonimbus".
-type_tcu = code_tcu, info_tcu.
code_tcu>code = 'TCU'.
info_tcu>info = +"towering cumulus".
-type_unknown = code_unknown, info_unknown.
code_unknown>code = '///'.
info_unknown>info = +"unknown".
vertical_visibility = -'VV', vertical_ft.
vertical_ft>altitude_ft = hundreds_of_feet | -'///', +"unknown".
cavok = code_cavok, info_cavok.
code_cavok>code = 'CAVOK'.
info_cavok>info = +"ceiling and visibility OK".
remark = -'RMK ', rmkchar*, !rmkchar.
-rmkchar = ~['='; #a; #d].