#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 } ;###### ;# autogenerated utility functions used by fickle; override as needed ;###### proc yywrap {} { return 1 } proc ECHO {{s ""}} { if {[string equal $s ""]} { upvar yytext local_yytext set s $local_yytext } global yyout puts -nonewline $yyout $s } proc YY_FLUSH_BUFFER {} { global yy_buffer yy_index yy_done set yy_buffer "" set yy_index 0 set yy_done 0 } set YY_NULL 0 proc YY_INPUT {buf result max_size} { global yyin upvar $result ret_val upvar $buf new_data set new_data [read $yyin $max_size] set ret_val [string length $new_data] } proc unput {c} { global yy_buffer yy_index set yy_buffer [string replace $yy_buffer $yy_index $yy_index \ "$c[string index $yy_buffer $yy_index]"] } proc input {} { global yy_buffer yy_index YY_NULL yy_done if {[expr [string length $yy_buffer] - $yy_index] < 1024} { set yy_buffer_size $YY_NULL if {$yy_done == 0} { YY_INPUT new_buffer yy_buffer_size 1024 append yy_buffer $new_buffer if {$yy_buffer_size == $YY_NULL} { set yy_done 1 } } if {$yy_done == 1} { if {[yywrap] == 0} { return [input] } elseif {[expr [string length $yy_buffer] - $yy_index] == 0} { return "" } } } set c [string index $yy_buffer $yy_index] incr yy_index return $c } proc yy_push_state {new_state} { global yy_state_stack lappend yy_state_stack $new_state } proc yy_pop_state {} { global yy_state_stack set yy_state_stack [lrange $yy_state_stack 0 end-1] if {[string equal $yy_state_stack ""]} { yy_push_state INITIAL } } proc yy_top_state {} { global yy_state_stack return [lindex $yy_state_stack end] } proc BEGIN {new_state {prefix "yy"}} { eval global ${prefix}_state_stack eval set ${prefix}_state_stack [lrange $${prefix}_state_stack 0 end-1] eval lappend ${prefix}_state_stack $new_state } ;###### ;# end autogenerated utility functions ;###### ;###### ;# autogenerated yylex function by fickle -- modify at your own peril ;###### proc yylex {} { global yy_first_time yy_buffer yy_index yy_state_stack global yy_state_table yyin yyout YY_NULL yy_done global yylval if {[info exists yy_first_time] == 0} { set yy_first_time "" set yy_buffer "" set yy_buffer_size $YY_NULL set yy_index 0 set yy_state_stack "" set yy_done 0 BEGIN INITIAL yy array set yy_state_table [list PRES 1 VIS 1 WIND 1 INITIAL 0 CONDS 1 TIME 1] if {[info exists yyin] == 0} { set yyin "stdin" } if {[info exists yyout] == 0} { set yyout "stdout" } } while {1} { set yy_current_state [yy_top_state] if {[expr [string length $yy_buffer] - $yy_index] < 1024} { if {$yy_done == 0} { set new_buffer "" YY_INPUT new_buffer yy_buffer_size 1024 append yy_buffer $new_buffer if {$yy_buffer_size == $YY_NULL && \ [expr [string length $yy_buffer] - $yy_index] == 0} { set yy_done 1 } } if {$yy_done == 1} { if {[yywrap] == 0} { set yy_done 0 continue } elseif {[expr [string length $yy_buffer] - $yy_index] == 0} { break } } } set yytext "" set yy_matched_rule -1 ;# rule 0: \S+ if {[expr \ {[string equal $yy_current_state INITIAL]} && \ {[regexp -start $yy_index -indices -line -- {\S+} $yy_buffer yy_match] > 0} && \ {[lindex $yy_match 0] == $yy_index}]} { if {[expr [lindex $yy_match 1] - $yy_index + 1] > [string length $yytext]} { set yytext [string range $yy_buffer $yy_index [lindex $yy_match 1]] set yy_matched_rule 0 } } ;# rule 1: