%{ #foreach {cloud_code cloud_desc cloud_amt} { \ # "SKC" "Clear Skies" 0 "CLR" "Clear Skies" 0 "FEW" "Few Clouds" 20 \ # "SCT" "Scattered Clouds" 40 "BKN" "Broken Clouds" 75 \ # "OVC" "Overcast" 100} { # set cloud_table($cloud_code) [list $cloud_desc $cloud_amt] #} ;# use this more human-readable format foreach {cloud_code cloud_desc cloud_amt} { \ "SKC" "Clear skies" 0 "CLR" "Clear skies" 0 "FEW" "Mostly clear skies" 20 \ "SCT" "Partly cloudy" 40 "BKN" "Mostly cloudy" 75 \ "OVC" "Overcast" 100} { set cloud_table($cloud_code) [list $cloud_desc $cloud_amt] } foreach {condition_code condition_desc} { \ "-" "Light" "+" "Heavy" "VC" "Nearby" \ "MI" "Shallow" "BC" "Patches" "BL" "Blowing" "TS" "Thunderstorms" \ "PR" "Partial" "DR" "Low Drifting" "SH" "Showers" "FZ" "Freezing" \ "RA" "Rain" "SN" "Snow" "IC" "Ice Crystals" "GR" "Hail" \ "DZ" "Drizzle" "SG" "Snow Grains" "PE" "Ice Pellets" "GS" "Small Hail" \ "UP" "Unknown Precipitation" \ "FG" "Fog" "BR" "Mist" "DU" "Widespread Dust" "SA" "Sand" \ "VA" "Volcanic Ash" "HZ" "Haze" "FU" "Smoke" "PY" "Spray" \ "SQ" "Squall" "DS" "Duststorm" "FC" "Funnel Cloud" \ "PO" "Dust/Sand Whirls" "SS" "Sandstorm"} { set condition_table($condition_code) $condition_desc } %} %x TIME WIND VIS CONDS PRES %GLOBAL yylval %NOHEADERS clouds SKC|CLR|BKN|SCT|FEW|OVC %% \S+ BEGIN TIME; ;# ignore the location