diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-01 20:06:48 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-01 20:06:48 (GMT) |
commit | 37d72c965c602bc800275da71a7234d50e4d707a (patch) | |
tree | bb5aad8738c3f9139a0d00f52c490d9ca082167f | |
parent | 88233512265280fd373a68e890599090f8ebb524 (diff) | |
download | blt-37d72c965c602bc800275da71a7234d50e4d707a.zip blt-37d72c965c602bc800275da71a7234d50e4d707a.tar.gz blt-37d72c965c602bc800275da71a7234d50e4d707a.tar.bz2 |
add ds9 pan parser
-rw-r--r-- | ds9/library/panlex.tcl | 350 | ||||
-rw-r--r-- | ds9/library/zoomlex.tcl | 128 | ||||
-rw-r--r-- | ds9/library/zoomparser.tab.tcl | 13 | ||||
-rw-r--r-- | ds9/library/zoomparser.tcl | 166 | ||||
-rw-r--r-- | ds9/parsers/panlex.fcl | 2 | ||||
-rw-r--r-- | ds9/parsers/zoomlex.fcl | 5 | ||||
-rw-r--r-- | ds9/parsers/zoomparser.tac | 4 |
7 files changed, 369 insertions, 299 deletions
diff --git a/ds9/library/panlex.tcl b/ds9/library/panlex.tcl index 7605064..de7cb3c 100644 --- a/ds9/library/panlex.tcl +++ b/ds9/library/panlex.tcl @@ -195,405 +195,419 @@ proc pan::yylex {} { } set yyleng 0 set matched_rule -1 - # rule 0: -zscale - if {[regexp -start $index_ -indices -line -nocase -- {\A(-zscale)} $yy_current_buffer match] > 0 && \ + # rule 0: -pan + if {[regexp -start $index_ -indices -line -nocase -- {\A(-pan)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 0 } - # rule 1: -zoom - if {[regexp -start $index_ -indices -line -nocase -- {\A(-zoom)} $yy_current_buffer match] > 0 && \ + # rule 1: -rotate + if {[regexp -start $index_ -indices -line -nocase -- {\A(-rotate)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 1 } - # rule 2: close - if {[regexp -start $index_ -indices -line -nocase -- {\A(close)} $yy_current_buffer match] > 0 && \ + # rule 2: -zscale + if {[regexp -start $index_ -indices -line -nocase -- {\A(-zscale)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 2 } - # rule 3: open - if {[regexp -start $index_ -indices -line -nocase -- {\A(open)} $yy_current_buffer match] > 0 && \ + # rule 3: -zoom + if {[regexp -start $index_ -indices -line -nocase -- {\A(-zoom)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 3 } - # rule 4: to - if {[regexp -start $index_ -indices -line -nocase -- {\A(to)} $yy_current_buffer match] > 0 && \ + # rule 4: close + if {[regexp -start $index_ -indices -line -nocase -- {\A(close)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 4 } - # rule 5: wcs - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcs)} $yy_current_buffer match] > 0 && \ + # rule 5: open + if {[regexp -start $index_ -indices -line -nocase -- {\A(open)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 5 } - # rule 6: wcsa - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsa)} $yy_current_buffer match] > 0 && \ + # rule 6: to + if {[regexp -start $index_ -indices -line -nocase -- {\A(to)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 6 } - # rule 7: wcsb - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsb)} $yy_current_buffer match] > 0 && \ + # rule 7: wcs + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcs)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 7 } - # rule 8: wcsc - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsc)} $yy_current_buffer match] > 0 && \ + # rule 8: wcsa + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsa)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 8 } - # rule 9: wcsd - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsd)} $yy_current_buffer match] > 0 && \ + # rule 9: wcsb + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsb)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 9 } - # rule 10: wcse - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcse)} $yy_current_buffer match] > 0 && \ + # rule 10: wcsc + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsc)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 10 } - # rule 11: wcsf - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsf)} $yy_current_buffer match] > 0 && \ + # rule 11: wcsd + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsd)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 11 } - # rule 12: wcsg - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsg)} $yy_current_buffer match] > 0 && \ + # rule 12: wcse + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcse)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 12 } - # rule 13: wcsh - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsh)} $yy_current_buffer match] > 0 && \ + # rule 13: wcsf + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsf)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 13 } - # rule 14: wcsi - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsi)} $yy_current_buffer match] > 0 && \ + # rule 14: wcsg + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsg)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 14 } - # rule 15: wcsj - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsj)} $yy_current_buffer match] > 0 && \ + # rule 15: wcsh + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsh)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 15 } - # rule 16: wcsk - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsk)} $yy_current_buffer match] > 0 && \ + # rule 16: wcsi + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsi)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 16 } - # rule 17: wcsl - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsl)} $yy_current_buffer match] > 0 && \ + # rule 17: wcsj + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsj)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 17 } - # rule 18: wcsm - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsm)} $yy_current_buffer match] > 0 && \ + # rule 18: wcsk + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsk)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 18 } - # rule 19: wcsn - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsn)} $yy_current_buffer match] > 0 && \ + # rule 19: wcsl + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsl)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 19 } - # rule 20: wcso - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcso)} $yy_current_buffer match] > 0 && \ + # rule 20: wcsm + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsm)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 20 } - # rule 21: wcsp - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsp)} $yy_current_buffer match] > 0 && \ + # rule 21: wcsn + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsn)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 21 } - # rule 22: wcsq - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsq)} $yy_current_buffer match] > 0 && \ + # rule 22: wcso + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcso)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 22 } - # rule 23: wcsr - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsr)} $yy_current_buffer match] > 0 && \ + # rule 23: wcsp + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsp)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 23 } - # rule 24: wcss - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcss)} $yy_current_buffer match] > 0 && \ + # rule 24: wcsq + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsq)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 24 } - # rule 25: wcst - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcst)} $yy_current_buffer match] > 0 && \ + # rule 25: wcsr + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsr)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 25 } - # rule 26: wcsu - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsu)} $yy_current_buffer match] > 0 && \ + # rule 26: wcss + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcss)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 26 } - # rule 27: wcsv - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsv)} $yy_current_buffer match] > 0 && \ + # rule 27: wcst + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcst)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 27 } - # rule 28: wcsw - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsw)} $yy_current_buffer match] > 0 && \ + # rule 28: wcsu + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsu)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 28 } - # rule 29: wcsx - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsx)} $yy_current_buffer match] > 0 && \ + # rule 29: wcsv + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsv)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 29 } - # rule 30: wcsy - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsy)} $yy_current_buffer match] > 0 && \ + # rule 30: wcsw + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsw)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 30 } - # rule 31: wcsz - if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsz)} $yy_current_buffer match] > 0 && \ + # rule 31: wcsx + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsx)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 31 } - # rule 32: image - if {[regexp -start $index_ -indices -line -nocase -- {\A(image)} $yy_current_buffer match] > 0 && \ + # rule 32: wcsy + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsy)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 32 } - # rule 33: physical - if {[regexp -start $index_ -indices -line -nocase -- {\A(physical)} $yy_current_buffer match] > 0 && \ + # rule 33: wcsz + if {[regexp -start $index_ -indices -line -nocase -- {\A(wcsz)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 33 } - # rule 34: amplifier - if {[regexp -start $index_ -indices -line -nocase -- {\A(amplifier)} $yy_current_buffer match] > 0 && \ + # rule 34: image + if {[regexp -start $index_ -indices -line -nocase -- {\A(image)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 34 } - # rule 35: detector - if {[regexp -start $index_ -indices -line -nocase -- {\A(detector)} $yy_current_buffer match] > 0 && \ + # rule 35: physical + if {[regexp -start $index_ -indices -line -nocase -- {\A(physical)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 35 } - # rule 36: fk4 - if {[regexp -start $index_ -indices -line -nocase -- {\A(fk4)} $yy_current_buffer match] > 0 && \ + # rule 36: amplifier + if {[regexp -start $index_ -indices -line -nocase -- {\A(amplifier)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 36 } - # rule 37: b1950 - if {[regexp -start $index_ -indices -line -nocase -- {\A(b1950)} $yy_current_buffer match] > 0 && \ + # rule 37: detector + if {[regexp -start $index_ -indices -line -nocase -- {\A(detector)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 37 } - # rule 38: fk5 - if {[regexp -start $index_ -indices -line -nocase -- {\A(fk5)} $yy_current_buffer match] > 0 && \ + # rule 38: fk4 + if {[regexp -start $index_ -indices -line -nocase -- {\A(fk4)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 38 } - # rule 39: j2000 - if {[regexp -start $index_ -indices -line -nocase -- {\A(j2000)} $yy_current_buffer match] > 0 && \ + # rule 39: b1950 + if {[regexp -start $index_ -indices -line -nocase -- {\A(b1950)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 39 } - # rule 40: galactic - if {[regexp -start $index_ -indices -line -nocase -- {\A(galactic)} $yy_current_buffer match] > 0 && \ + # rule 40: fk5 + if {[regexp -start $index_ -indices -line -nocase -- {\A(fk5)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 40 } - # rule 41: ecliptic - if {[regexp -start $index_ -indices -line -nocase -- {\A(ecliptic)} $yy_current_buffer match] > 0 && \ + # rule 41: j2000 + if {[regexp -start $index_ -indices -line -nocase -- {\A(j2000)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 41 } - # rule 42: [+-]?{D}+ - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+)} $yy_current_buffer match] > 0 && \ + # rule 42: galactic + if {[regexp -start $index_ -indices -line -nocase -- {\A(galactic)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 42 } - # rule 43: [+-]?{D}+\.?({E})? - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+\.?(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ + # rule 43: ecliptic + if {[regexp -start $index_ -indices -line -nocase -- {\A(ecliptic)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 43 } - # rule 44: [+-]?{D}*\.{D}+({E})? - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])*\.([0-9])+(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ + # rule 44: [+-]?{D}+ + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 44 } - # rule 45: [+-]?{D}+:{D}+:{D}+\.? - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+:([0-9])+:([0-9])+\.?)} $yy_current_buffer match] > 0 && \ + # rule 45: [+-]?{D}+\.?({E})? + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+\.?(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 45 } - # rule 46: [+-]?{D}+:{D}+:{D}*\.{D}+ - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+:([0-9])+:([0-9])*\.([0-9])+)} $yy_current_buffer match] > 0 && \ + # rule 46: [+-]?{D}*\.{D}+({E})? + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])*\.([0-9])+(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 46 } - # rule 47: [+-]?{D}+h{D}+m{D}+\.?s - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+h([0-9])+m([0-9])+\.?s)} $yy_current_buffer match] > 0 && \ + # rule 47: [+-]?{D}+:{D}+:{D}+\.? + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+:([0-9])+:([0-9])+\.?)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 47 } - # rule 48: [+-]?{D}+h{D}+m{D}*\.{D}+s - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+h([0-9])+m([0-9])*\.([0-9])+s)} $yy_current_buffer match] > 0 && \ + # rule 48: [+-]?{D}+:{D}+:{D}*\.{D}+ + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+:([0-9])+:([0-9])*\.([0-9])+)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 48 } - # rule 49: [+-]?{D}+d{D}+m{D}+\.?s - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+d([0-9])+m([0-9])+\.?s)} $yy_current_buffer match] > 0 && \ + # rule 49: [+-]?{D}+h{D}+m{D}+\.?s + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+h([0-9])+m([0-9])+\.?s)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 49 } - # rule 50: [+-]?{D}+d{D}+m{D}*\.{D}+s - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+d([0-9])+m([0-9])*\.([0-9])+s)} $yy_current_buffer match] > 0 && \ + # rule 50: [+-]?{D}+h{D}+m{D}*\.{D}+s + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+h([0-9])+m([0-9])*\.([0-9])+s)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 50 } - # rule 51: \"[^\"]*\" - if {[regexp -start $index_ -indices -line -nocase -- {\A(\"[^\"]*\")} $yy_current_buffer match] > 0 && \ + # rule 51: [+-]?{D}+d{D}+m{D}+\.?s + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+d([0-9])+m([0-9])+\.?s)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 51 } - # rule 52: \'[^\']*\' - if {[regexp -start $index_ -indices -line -nocase -- {\A(\'[^\']*\')} $yy_current_buffer match] > 0 && \ + # rule 52: [+-]?{D}+d{D}+m{D}*\.{D}+s + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+d([0-9])+m([0-9])*\.([0-9])+s)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 52 } - # rule 53: \{[^\}]*\} - if {[regexp -start $index_ -indices -line -nocase -- {\A(\{[^\}]*\})} $yy_current_buffer match] > 0 && \ + # rule 53: \"[^\"]*\" + if {[regexp -start $index_ -indices -line -nocase -- {\A(\"[^\"]*\")} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 53 } - # rule 54: \S+\S+ - if {[regexp -start $index_ -indices -line -nocase -- {\A(\S+\S+)} $yy_current_buffer match] > 0 && \ + # rule 54: \'[^\']*\' + if {[regexp -start $index_ -indices -line -nocase -- {\A(\'[^\']*\')} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 54 } - # rule 55: \s - if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ + # rule 55: \{[^\}]*\} + if {[regexp -start $index_ -indices -line -nocase -- {\A(\{[^\}]*\})} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 55 } - # rule 56: . - if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + # rule 56: \S+\S+ + if {[regexp -start $index_ -indices -line -nocase -- {\A(\S+\S+)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 56 } + # rule 57: \s + if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 57 + } + # rule 58: . + if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 58 + } if {$matched_rule == -1} { set yytext [string index $yy_current_buffer $index_] set yyleng 1 @@ -613,160 +627,166 @@ return $pan::CMD_ return $pan::CMD_ } 2 { -return $pan::CLOSE_ +return $pan::CMD_ } 3 { -return $pan::OPEN_ +return $pan::CMD_ } 4 { -return $pan::TO_ +return $pan::CLOSE_ } 5 { -return $pan::WCS_ +return $pan::OPEN_ } 6 { -return $pan::WCSA_ +return $pan::TO_ } 7 { -return $pan::WCSB_ +return $pan::WCS_ } 8 { -return $pan::WCSC_ +return $pan::WCSA_ } 9 { -return $pan::WCSD_ +return $pan::WCSB_ } 10 { -return $pan::WCSE_ +return $pan::WCSC_ } 11 { -return $pan::WCSF_ +return $pan::WCSD_ } 12 { -return $pan::WCSG_ +return $pan::WCSE_ } 13 { -return $pan::WCSH_ +return $pan::WCSF_ } 14 { -return $pan::WCSI_ +return $pan::WCSG_ } 15 { -return $pan::WCSJ_ +return $pan::WCSH_ } 16 { -return $pan::WCSK_ +return $pan::WCSI_ } 17 { -return $pan::WCSL_ +return $pan::WCSJ_ } 18 { -return $pan::WCSM_ +return $pan::WCSK_ } 19 { -return $pan::WCSN_ +return $pan::WCSL_ } 20 { -return $pan::WCSO_ +return $pan::WCSM_ } 21 { -return $pan::WCSP_ +return $pan::WCSN_ } 22 { -return $pan::WCSQ_ +return $pan::WCSO_ } 23 { -return $pan::WCSR_ +return $pan::WCSP_ } 24 { -return $pan::WCSS_ +return $pan::WCSQ_ } 25 { -return $pan::WCST_ +return $pan::WCSR_ } 26 { -return $pan::WCSU_ +return $pan::WCSS_ } 27 { -return $pan::WCSV_ +return $pan::WCST_ } 28 { -return $pan::WCSW_ +return $pan::WCSU_ } 29 { -return $pan::WCSX_ +return $pan::WCSV_ } 30 { -return $pan::WCSY_ +return $pan::WCSW_ } 31 { -return $pan::WCSZ_ +return $pan::WCSX_ } 32 { -return $pan::IMAGE_ +return $pan::WCSY_ } 33 { -return $pan::PHYSICAL_ +return $pan::WCSZ_ } 34 { -return $pan::AMPLIFIER_ +return $pan::IMAGE_ } 35 { -return $pan::DETECTOR_ +return $pan::PHYSICAL_ } 36 { -return $pan::FK4_ +return $pan::AMPLIFIER_ } 37 { -return $pan::FK4_ +return $pan::DETECTOR_ } 38 { -return $pan::FK5_ +return $pan::FK4_ } 39 { -return $pan::FK5_ +return $pan::FK4_ } 40 { -return $pan::GALACTIC_ +return $pan::FK5_ } 41 { -return $pan::ECLIPTIC_ +return $pan::FK5_ } 42 { -set pan::yylval $yytext; return $pan::INT_ +return $pan::GALACTIC_ + } + 43 { +return $pan::ECLIPTIC_ } - 43 - 44 { -set pan::yylval $yytext; return $pan::REAL_ +set pan::yylval $yytext; return $pan::INT_ } 45 - 46 { -set pan::yylval $yytext; return $pan::SEXSTR_ +set pan::yylval $yytext; return $pan::REAL_ } 47 - 48 { -set pan::yylval $yytext; return $pan::HMSSTR_ +set pan::yylval $yytext; return $pan::SEXSTR_ } 49 - 50 { +set pan::yylval $yytext; return $pan::HMSSTR_ + } + 51 - + 52 { set pan::yylval $yytext; return $pan::SMSSTR_ } - 51 { + 53 { set pan::yylval [string range $yytext 1 end-1]; return $pan::STRING_ } - 52 { + 54 { set pan::yylval [string range $yytext 1 end-1]; return $pan::STRING_ } - 53 { + 55 { set pan::yylval [string range $yytext 1 end-1]; return $pan::STRING_ } - 54 { + 56 { set pan::yylval $yytext; return $pan::STRING_ } - 55 { + 57 { # ignore whitespace } - 56 { + 58 { set pan::yylval $yytext; return $pan::yylval } default diff --git a/ds9/library/zoomlex.tcl b/ds9/library/zoomlex.tcl index 2adcb27..68bed75 100644 --- a/ds9/library/zoomlex.tcl +++ b/ds9/library/zoomlex.tcl @@ -195,111 +195,139 @@ proc zoom::yylex {} { } set yyleng 0 set matched_rule -1 - # rule 0: close - if {[regexp -start $index_ -indices -line -nocase -- {\A(close)} $yy_current_buffer match] > 0 && \ + # rule 0: -pan + if {[regexp -start $index_ -indices -line -nocase -- {\A(-pan)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 0 } - # rule 1: in - if {[regexp -start $index_ -indices -line -nocase -- {\A(in)} $yy_current_buffer match] > 0 && \ + # rule 1: -rotate + if {[regexp -start $index_ -indices -line -nocase -- {\A(-rotate)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 1 } - # rule 2: fit - if {[regexp -start $index_ -indices -line -nocase -- {\A(fit)} $yy_current_buffer match] > 0 && \ + # rule 2: -zscale + if {[regexp -start $index_ -indices -line -nocase -- {\A(-zscale)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 2 } - # rule 3: open - if {[regexp -start $index_ -indices -line -nocase -- {\A(open)} $yy_current_buffer match] > 0 && \ + # rule 3: -zoom + if {[regexp -start $index_ -indices -line -nocase -- {\A(-zoom)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 3 } - # rule 4: out - if {[regexp -start $index_ -indices -line -nocase -- {\A(out)} $yy_current_buffer match] > 0 && \ + # rule 4: close + if {[regexp -start $index_ -indices -line -nocase -- {\A(close)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 4 } - # rule 5: to - if {[regexp -start $index_ -indices -line -nocase -- {\A(to)} $yy_current_buffer match] > 0 && \ + # rule 5: in + if {[regexp -start $index_ -indices -line -nocase -- {\A(in)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 5 } - # rule 6: [+-]?{D}+ - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+)} $yy_current_buffer match] > 0 && \ + # rule 6: fit + if {[regexp -start $index_ -indices -line -nocase -- {\A(fit)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 6 } - # rule 7: [+-]?{D}+\.?({E})? - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+\.?(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ + # rule 7: open + if {[regexp -start $index_ -indices -line -nocase -- {\A(open)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 7 } - # rule 8: [+-]?{D}*\.{D}+({E})? - if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])*\.([0-9])+(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ + # rule 8: out + if {[regexp -start $index_ -indices -line -nocase -- {\A(out)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 8 } - # rule 9: \"[^\"]*\" - if {[regexp -start $index_ -indices -line -nocase -- {\A(\"[^\"]*\")} $yy_current_buffer match] > 0 && \ + # rule 9: to + if {[regexp -start $index_ -indices -line -nocase -- {\A(to)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 9 } - # rule 10: \'[^\']*\' - if {[regexp -start $index_ -indices -line -nocase -- {\A(\'[^\']*\')} $yy_current_buffer match] > 0 && \ + # rule 10: [+-]?{D}+ + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 10 } - # rule 11: \{[^\}]*\} - if {[regexp -start $index_ -indices -line -nocase -- {\A(\{[^\}]*\})} $yy_current_buffer match] > 0 && \ + # rule 11: [+-]?{D}+\.?({E})? + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])+\.?(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 11 } - # rule 12: \S+\S+ - if {[regexp -start $index_ -indices -line -nocase -- {\A(\S+\S+)} $yy_current_buffer match] > 0 && \ + # rule 12: [+-]?{D}*\.{D}+({E})? + if {[regexp -start $index_ -indices -line -nocase -- {\A([+-]?([0-9])*\.([0-9])+(([Ee][+-]?([0-9])+))?)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 12 } - # rule 13: \s - if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ + # rule 13: \"[^\"]*\" + if {[regexp -start $index_ -indices -line -nocase -- {\A(\"[^\"]*\")} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 13 } - # rule 14: . - if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + # rule 14: \'[^\']*\' + if {[regexp -start $index_ -indices -line -nocase -- {\A(\'[^\']*\')} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 14 } + # rule 15: \{[^\}]*\} + if {[regexp -start $index_ -indices -line -nocase -- {\A(\{[^\}]*\})} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 15 + } + # rule 16: \S+\S+ + if {[regexp -start $index_ -indices -line -nocase -- {\A(\S+\S+)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 16 + } + # rule 17: \s + if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 17 + } + # rule 18: . + if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 18 + } if {$matched_rule == -1} { set yytext [string index $yy_current_buffer $index_] set yyleng 1 @@ -313,46 +341,58 @@ proc zoom::yylex {} { set numlines [expr {[llength [split $yytext "\n"]] - 1}] switch -- $matched_rule { 0 { -return $zoom::CLOSE_ +return $zoom::CMD_ } 1 { -return $zoom::IN_ +return $zoom::CMD_ } 2 { -return $zoom::FIT_ +return $zoom::CMD_ } 3 { -return $zoom::OPEN_ +return $zoom::CMD_ } 4 { -return $zoom::OUT_ +return $zoom::CLOSE_ } 5 { -return $zoom::TO_ +return $zoom::IN_ } 6 { -set zoom::yylval $yytext; return $zoom::INT_ +return $zoom::FIT_ + } + 7 { +return $zoom::OPEN_ } - 7 - 8 { -set zoom::yylval $yytext; return $zoom::REAL_ +return $zoom::OUT_ } 9 { -set zoom::yylval [string range $yytext 1 end-1]; return $zoom::STRING_ +return $zoom::TO_ } 10 { +set zoom::yylval $yytext; return $zoom::INT_ + } + 11 - + 12 { +set zoom::yylval $yytext; return $zoom::REAL_ + } + 13 { set zoom::yylval [string range $yytext 1 end-1]; return $zoom::STRING_ } - 11 { + 14 { set zoom::yylval [string range $yytext 1 end-1]; return $zoom::STRING_ } - 12 { + 15 { +set zoom::yylval [string range $yytext 1 end-1]; return $zoom::STRING_ + } + 16 { set zoom::yylval $yytext; return $zoom::STRING_ } - 13 { + 17 { # ignore whitespace } - 14 { + 18 { set zoom::yylval $yytext; return $zoom::yylval } default diff --git a/ds9/library/zoomparser.tab.tcl b/ds9/library/zoomparser.tab.tcl index 4deda09..54b544e 100644 --- a/ds9/library/zoomparser.tab.tcl +++ b/ds9/library/zoomparser.tab.tcl @@ -2,11 +2,12 @@ namespace eval zoom { set INT_ 257 set REAL_ 258 set STRING_ 259 -set CLOSE_ 260 -set IN_ 261 -set FIT_ 262 -set OPEN_ 263 -set OUT_ 264 -set TO_ 265 +set CMD_ 260 +set CLOSE_ 261 +set IN_ 262 +set FIT_ 263 +set OPEN_ 264 +set OUT_ 265 +set TO_ 266 set yylval {} } diff --git a/ds9/library/zoomparser.tcl b/ds9/library/zoomparser.tcl index 91735b4..a1692e3 100644 --- a/ds9/library/zoomparser.tcl +++ b/ds9/library/zoomparser.tcl @@ -53,135 +53,135 @@ proc zoom::unsetupvalues {numsyms} { } array set zoom::table { - 15:259 shift + 15:260 shift 0:257 shift 0:258 shift - 0:260 shift 2:257 reduce 5:0,target 8 9:0 reduce - 6:259,target 11 + 6:260,target 11 0:261 shift - 0:266,target 8 + 0:266,target 7 2:258 reduce 11:0 reduce - 2:259 reduce - 0:263 shift + 0:262 shift + 2:260 reduce + 10:268,target 15 0:264 shift - 1:259,target 4 - 4:259 reduce + 1:260,target 4 + 4:260 reduce + 7:263,target 11 0:265 shift - 6:259 reduce - 0:266 goto - 13:259,target 12 - 0:268 goto - 0:265,target 7 + 6:260 reduce + 0:266 shift + 13:260,target 12 + 0:267 goto + 0:265,target 6 6:0,target 11 0:269 goto + 0:270 goto 16:0,target 15 2:0 reduce - 10:267,target 15 1:258,target 4 - 9:259,target 6 - 7:262,target 11 + 9:260,target 6 + 9:269,target 14 6:0 reduce - 0:264,target 6 - 4:259,target 10 - 16:259,target 15 + 0:264,target 5 + 4:260,target 10 + 16:260,target 15 1:257,target 4 17:0,target 3 12:0 reduce 9:258,target 2 10:0,target 1 - 9:268,target 14 - 11:259,target 13 - 0:263,target 5 + 7:271,target 13 + 11:260,target 13 16:0 reduce 12:257 shift - 10:259 reduce + 10:260 reduce 12:258 shift 9:257,target 1 - 12:259 reduce + 12:260 reduce 8:0,target 0 - 7:270,target 13 + 7:269,target 12 3:0 reduce 1:0,target 4 - 14:259 reduce + 14:260 reduce 11:0,target 13 - 2:259,target 5 - 16:259 reduce + 0:262,target 4 + 2:260,target 5 + 16:260 reduce 1:257 reduce - 14:259,target 7 - 10:267 goto + 14:260,target 7 1:258 reduce + 10:268 goto 7:258,target 2 - 1:259 reduce - 7:268,target 12 - 12:268 goto - 3:259 reduce + 1:260 reduce + 3:260 reduce 13:0 reduce + 12:269 goto 9:0,target 6 - 0:261,target 4 + 0:261,target 3 2:258,target 5 7:257 shift 2:0,target 5 - 5:259 reduce + 5:260 reduce 12:0,target 14 7:258 shift 9:257 shift 17:0 reduce 9:258 shift 7:257,target 1 - 5:259,target 8 - 9:259 reduce - 7:262 shift - 0:260,target 3 + 5:260,target 8 + 9:260 reduce + 7:263 shift 2:257,target 5 - 0:269,target 10 + 0:269,target 9 + 0:270,target 10 4:0 reduce - 12:259,target 14 + 12:260,target 14 3:0,target 9 13:0,target 12 - 7:268 goto + 12:269,target 16 8:0 accept - 7:270 goto + 7:269 goto 10:0 reduce - 9:268 goto + 7:271 goto + 9:269 goto 0:258,target 2 - 0:268,target 9 14:0 reduce 12:258,target 2 - 12:268,target 16 - 3:259,target 9 + 3:260,target 9 4:0,target 10 14:0,target 7 - 15:259,target 17 + 15:260,target 17 0:257,target 1 1:0 reduce - 11:259 reduce - 13:259 reduce + 11:260 reduce + 0:267,target 8 + 13:260 reduce 12:257,target 1 - 10:259,target 2 + 10:260,target 2 5:0 reduce } array set zoom::rules { - 9,l 269 - 11,l 269 - 15,l 270 - 2,l 267 - 6,l 269 - 12,l 269 - 3,l 266 - 7,l 269 - 13,l 270 - 0,l 271 - 4,l 268 - 8,l 269 - 10,l 269 - 14,l 270 - 1,l 266 - 5,l 268 + 9,l 270 + 11,l 270 + 15,l 271 + 2,l 268 + 6,l 270 + 12,l 270 + 3,l 267 + 7,l 270 + 13,l 271 + 0,l 272 + 4,l 269 + 8,l 270 + 10,l 270 + 14,l 271 + 1,l 267 + 5,l 269 } array set zoom::rules { @@ -204,22 +204,22 @@ array set zoom::rules { } array set zoom::rules { - 13,line 37 + 13,line 39 2,e 1 - 7,line 29 - 10,line 32 - 4,line 24 - 1,line 20 - 15,line 39 - 9,line 31 - 12,line 34 - 6,line 28 - 3,line 21 - 14,line 38 - 8,line 30 - 11,line 33 - 5,line 25 - 2,line 20 + 7,line 31 + 10,line 34 + 4,line 26 + 1,line 22 + 15,line 41 + 9,line 33 + 12,line 36 + 6,line 30 + 3,line 23 + 14,line 40 + 8,line 32 + 11,line 35 + 5,line 27 + 2,line 22 } proc zoom::yyparse {} { diff --git a/ds9/parsers/panlex.fcl b/ds9/parsers/panlex.fcl index 18c5115..7d4ec06 100644 --- a/ds9/parsers/panlex.fcl +++ b/ds9/parsers/panlex.fcl @@ -15,6 +15,8 @@ E [Ee][+-]?{D}+ %% +-pan {return $pan::CMD_} +-rotate {return $pan::CMD_} -zscale {return $pan::CMD_} -zoom {return $pan::CMD_} diff --git a/ds9/parsers/zoomlex.fcl b/ds9/parsers/zoomlex.fcl index 79ff034..0c2637f 100644 --- a/ds9/parsers/zoomlex.fcl +++ b/ds9/parsers/zoomlex.fcl @@ -15,6 +15,11 @@ E [Ee][+-]?{D}+ %% +-pan {return $zoom::CMD_} +-rotate {return $zoom::CMD_} +-zscale {return $zoom::CMD_} +-zoom {return $zoom::CMD_} + close {return $zoom::CLOSE_} in {return $zoom::IN_} fit {return $zoom::FIT_} diff --git a/ds9/parsers/zoomparser.tac b/ds9/parsers/zoomparser.tac index a49b838..4dcc856 100644 --- a/ds9/parsers/zoomparser.tac +++ b/ds9/parsers/zoomparser.tac @@ -7,6 +7,8 @@ %start command +%token CMD_ + %token CLOSE_ %token IN_ %token FIT_ @@ -17,7 +19,7 @@ %% command : zoom - | zoom {zoom::yyclearin; YYACCEPT} STRING_ + | zoom {zoom::yyclearin; YYACCEPT} CMD_ ; numeric : INT_ {set _ $1} |