diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-07 22:12:22 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-07 22:12:22 (GMT) |
commit | 61a6a0682e5c15df1296e92d747d2b1245e86add (patch) | |
tree | ddc02f974486c6b0082290709f582c42b98dbd87 /ds9 | |
parent | fa6b5102a4a03920929120d2991413d7896e9d86 (diff) | |
download | blt-61a6a0682e5c15df1296e92d747d2b1245e86add.zip blt-61a6a0682e5c15df1296e92d747d2b1245e86add.tar.gz blt-61a6a0682e5c15df1296e92d747d2b1245e86add.tar.bz2 |
simplify ds9 imgsvr parsers
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/parsers/coords.fin | 5 | ||||
-rw-r--r-- | ds9/parsers/coords.tin | 5 | ||||
-rw-r--r-- | ds9/parsers/coords.trl | 10 | ||||
-rw-r--r-- | ds9/parsers/dssesolex.fcl | 15 | ||||
-rw-r--r-- | ds9/parsers/dssesoparser.tac | 41 | ||||
-rw-r--r-- | ds9/parsers/dsssaolex.fcl | 14 | ||||
-rw-r--r-- | ds9/parsers/dsssaoparser.tac | 40 | ||||
-rw-r--r-- | ds9/parsers/dssstscilex.fcl | 15 | ||||
-rw-r--r-- | ds9/parsers/dssstsciparser.tac | 41 | ||||
-rw-r--r-- | ds9/parsers/imgsvr.fin | 24 | ||||
-rw-r--r-- | ds9/parsers/imgsvr.tin | 21 | ||||
-rw-r--r-- | ds9/parsers/imgsvr.trl | 31 | ||||
-rw-r--r-- | ds9/parsers/skyviewparser.tac | 40 | ||||
-rw-r--r-- | ds9/parsers/twomasslex.fcl | 15 | ||||
-rw-r--r-- | ds9/parsers/twomassparser.tac | 41 |
15 files changed, 95 insertions, 263 deletions
diff --git a/ds9/parsers/coords.fin b/ds9/parsers/coords.fin index e7766bd..394be49 100644 --- a/ds9/parsers/coords.fin +++ b/ds9/parsers/coords.fin @@ -38,11 +38,6 @@ j2000 {return $FK5_} galactic {return $GALACTIC_} ecliptic {return $ECLIPTIC_} -degrees {return $DEGREES_} -sexagesimal {return $SEXAGESIMAL_} -arcmin {return $ARCMIN_} -arcsec {return $ARCSEC_} - # SEXAGESIMAL [+-]?{D}+:{D}+:{D}+"."? | [+-]?{D}+:{D}+:{D}*"."{D}+ {set yylval $yytext; return $SEXSTR_} diff --git a/ds9/parsers/coords.tin b/ds9/parsers/coords.tin index 4b8aa7b..ea9b92e 100644 --- a/ds9/parsers/coords.tin +++ b/ds9/parsers/coords.tin @@ -40,8 +40,3 @@ %token ECLIPTIC_ %token J2000_ %token B1950_ - -%token DEGREES_ -%token SEXAGESIMAL_ -%token ARCMIN_ -%token ARCSEC_ diff --git a/ds9/parsers/coords.trl b/ds9/parsers/coords.trl index e3735ff..75a0871 100644 --- a/ds9/parsers/coords.trl +++ b/ds9/parsers/coords.trl @@ -56,13 +56,3 @@ skyframe : FK4_ {set _ fk4} # yyerror "must be: fk4|fk5|icrs|galactic|ecliptic" # YYABORT # } - -skyformat : DEGREES_ {set _ degrees} - | ARCMIN_ {set _ arcmin} - | ARCSEC_ {set _ arcsec} - ; - -# | error { -# yyerror "must be: degrees|arcmin|arcsec" -# YYABORT -# } diff --git a/ds9/parsers/dssesolex.fcl b/ds9/parsers/dssesolex.fcl index 3b4fd0f..554d012 100644 --- a/ds9/parsers/dssesolex.fcl +++ b/ds9/parsers/dssesolex.fcl @@ -7,26 +7,13 @@ %% -close {return $CLOSE_} -coord {return $COORD_} -crosshair {return $CROSSHAIR_} -current {return $CURRENT_} -frame {return $FRAME_} -name {return $NAME_} -new {return $NEW_} -open {return $OPEN_} -save {return $SAVE_} -size {return $SIZE_} -survey {return $SURVEY_} -update {return $UPDATE_} - dss1 {return $DSS1_} dss2-red {return $DSS2RED_} dss2-blue {return $DSS2BLUE_} dss2-infrared {return $DSS2INFRARED_} #include yesno.fin -#include coords.fin +#include imgsvr.fin #include base.fin %% diff --git a/ds9/parsers/dssesoparser.tac b/ds9/parsers/dssesoparser.tac index 45b3fec..89dbf96 100644 --- a/ds9/parsers/dssesoparser.tac +++ b/ds9/parsers/dssesoparser.tac @@ -2,24 +2,11 @@ %} #include yesno.tin -#include coords.tin +#include imgsvr.tin #include base.tin %start command -%token CLOSE_ -%token COORD_ -%token CROSSHAIR_ -%token CURRENT_ -%token FRAME_ -%token NAME_ -%token NEW_ -%token OPEN_ -%token UPDATE_ -%token SAVE_ -%token SIZE_ -%token SURVEY_ - %token DSS1_ %token DSS2RED_ %token DSS2BLUE_ @@ -28,31 +15,13 @@ %% #include yesno.trl -#include coords.trl +#include imgsvr.trl #include base.trl command : dsseso | dsseso {yyclearin; YYACCEPT} CMD_ ; -deg : {set _ degrees} - | DEGREES_ {set _ degrees} - ; - -sex : {set _ sexagesimal} - | SEXAGESIMAL_ {set _ sexagesimal} - ; - -coordOpt : - | WCS_ - | FK5_ - | WCS_ FK5_ - ; - -sizeOpt : {set _ degrees} - | skyformat {set _ $1} - ; - # COORD_ is depricated # NAME_ is depricated # new optional WCS_ FK5_, does nothing @@ -62,7 +31,7 @@ dsseso : {IMGSVRApply deso 1} | OPEN_ {} | CLOSE_ {ARDestroy deso} | STRING_ {global deso; set deso(name) $1; IMGSVRApply deso 1} - | numeric numeric coordOpt {global deso; set deso(x) $1; set deso(y) $2; set deso(skyformat) degrees; set deso(skyformat,msg) degress; IMGSVRApply deso 1} + | numeric numeric coordOpt {global deso; set deso(x) $1; set deso(y) $2; set deso(skyformat) degrees; set deso(skyformat,msg) degrees; IMGSVRApply deso 1} | SEXSTR_ SEXSTR_ coordOpt {global deso; set deso(x) $1; set deso(y) $2; set deso(skyformat) sexagesimal; set deso(skyformat,msg) sexagesimal; IMGSVRApply deso 1} | SIZE_ numeric numeric sizeOpt {global deso; set deso(width) $2; set deso(height) $3; set deso(rformat) $4; set deso(rformat,msg) $4} | SAVE_ yesno {global deso; set deso(save) $2} @@ -79,10 +48,6 @@ update : FRAME_ {IMGSVRUpdate deso; IMGSVRApply deso 1} | CROSSHAIR_ {IMGSVRCrosshair deso; IMGSVRApply deso 1} ; -frame : NEW_ {set _ new} - | CURRENT_ {set _ current} - ; - survey : DSS1_ {set _ DSS1} | DSS2RED_ {set _ DSS2-red} | DSS2BLUE_ {set _ DSS2-blue} diff --git a/ds9/parsers/dsssaolex.fcl b/ds9/parsers/dsssaolex.fcl index 6df4736..843fd2f 100644 --- a/ds9/parsers/dsssaolex.fcl +++ b/ds9/parsers/dsssaolex.fcl @@ -7,20 +7,8 @@ %% -close {return $CLOSE_} -coord {return $COORD_} -crosshair {return $CROSSHAIR_} -current {return $CURRENT_} -frame {return $FRAME_} -name {return $NAME_} -new {return $NEW_} -open {return $OPEN_} -save {return $SAVE_} -size {return $SIZE_} -update {return $UPDATE_} - #include yesno.fin -#include coords.fin +#include imgsvr.fin #include base.fin %% diff --git a/ds9/parsers/dsssaoparser.tac b/ds9/parsers/dsssaoparser.tac index 3adff82..87b253a 100644 --- a/ds9/parsers/dsssaoparser.tac +++ b/ds9/parsers/dsssaoparser.tac @@ -2,51 +2,21 @@ %} #include yesno.tin -#include coords.tin +#include imgsvr.tin #include base.tin %start command -%token CLOSE_ -%token COORD_ -%token CROSSHAIR_ -%token CURRENT_ -%token FRAME_ -%token NAME_ -%token NEW_ -%token OPEN_ -%token UPDATE_ -%token SAVE_ -%token SIZE_ - %% #include yesno.trl -#include coords.trl +#include imgsvr.trl #include base.trl command : dsssao | dsssao {yyclearin; YYACCEPT} CMD_ ; -deg : {set _ degrees} - | DEGREES_ {set _ degrees} - ; - -sex : {set _ sexagesimal} - | SEXAGESIMAL_ {set _ sexagesimal} - ; - -coordOpt : - | WCS_ - | FK5_ - | WCS_ FK5_ - ; - -sizeOpt : {set _ degrees} - | skyformat {set _ $1} - ; - # COORD_ is depricated # NAME_ is depricated # new optional WCS_ FK5_, does nothing @@ -56,7 +26,7 @@ dsssao : {IMGSVRApply dsao 1} | OPEN_ {} | CLOSE_ {ARDestroy dsao} | STRING_ {global dsao; set dsao(name) $1; IMGSVRApply dsao 1} - | numeric numeric coordOpt {global dsao; set dsao(x) $1; set dsao(y) $2; set dsao(skyformat) degrees; set dsao(skyformat,msg) degress; IMGSVRApply dsao 1} + | numeric numeric coordOpt {global dsao; set dsao(x) $1; set dsao(y) $2; set dsao(skyformat) degrees; set dsao(skyformat,msg) degrees; IMGSVRApply dsao 1} | SEXSTR_ SEXSTR_ coordOpt {global dsao; set dsao(x) $1; set dsao(y) $2; set dsao(skyformat) sexagesimal; set dsao(skyformat,msg) sexagesimal; IMGSVRApply dsao 1} | SIZE_ numeric numeric sizeOpt {global dsao; set dsao(width) $2; set dsao(height) $3; set dsao(rformat) $4; set dsao(rformat,msg) $4} | SAVE_ yesno {global dsao; set dsao(save) $2} @@ -72,10 +42,6 @@ update : FRAME_ {IMGSVRUpdate dsao; IMGSVRApply dsao 1} | CROSSHAIR_ {IMGSVRCrosshair dsao; IMGSVRApply dsao 1} ; -frame : NEW_ {set _ new} - | CURRENT_ {set _ current} - ; - %% proc dsssao::yyerror {msg} { diff --git a/ds9/parsers/dssstscilex.fcl b/ds9/parsers/dssstscilex.fcl index c5b4bf9..67e163e 100644 --- a/ds9/parsers/dssstscilex.fcl +++ b/ds9/parsers/dssstscilex.fcl @@ -7,19 +7,6 @@ %% -close {return $CLOSE_} -coord {return $COORD_} -crosshair {return $CROSSHAIR_} -current {return $CURRENT_} -frame {return $FRAME_} -name {return $NAME_} -new {return $NEW_} -open {return $OPEN_} -save {return $SAVE_} -size {return $SIZE_} -survey {return $SURVEY_} -update {return $UPDATE_} - poss2ukstu_red {return $POSS2RED_} poss2ukstu_ir {return $POSS2INFRARED_} poss2ukstu_blue {return $POSS2BLUE_} @@ -31,7 +18,7 @@ phase2_gsc2 {return $GSC2_} phase2_gsc2 {return $GSC1_} #include yesno.fin -#include coords.fin +#include imgsvr.fin #include base.fin %% diff --git a/ds9/parsers/dssstsciparser.tac b/ds9/parsers/dssstsciparser.tac index e80fc2a..cb3ed8c 100644 --- a/ds9/parsers/dssstsciparser.tac +++ b/ds9/parsers/dssstsciparser.tac @@ -2,24 +2,11 @@ %} #include yesno.tin -#include coords.tin +#include imgsvr.tin #include base.tin %start command -%token CLOSE_ -%token COORD_ -%token CROSSHAIR_ -%token CURRENT_ -%token FRAME_ -%token NAME_ -%token NEW_ -%token OPEN_ -%token UPDATE_ -%token SAVE_ -%token SIZE_ -%token SURVEY_ - %token POSS2RED_ %token POSS2INFRARED_ %token POSS2BLUE_ @@ -33,31 +20,13 @@ %% #include yesno.trl -#include coords.trl +#include imgsvr.trl #include base.trl command : dssstsci | dssstsci {yyclearin; YYACCEPT} CMD_ ; -deg : {set _ degrees} - | DEGREES_ {set _ degrees} - ; - -sex : {set _ sexagesimal} - | SEXAGESIMAL_ {set _ sexagesimal} - ; - -coordOpt : - | WCS_ - | FK5_ - | WCS_ FK5_ - ; - -sizeOpt : {set _ degrees} - | skyformat {set _ $1} - ; - # COORD_ is depricated # NAME_ is depricated # new optional WCS_ FK5_, does nothing @@ -67,7 +36,7 @@ dssstsci : {IMGSVRApply dstscii 1} | OPEN_ {} | CLOSE_ {ARDestroy dstscii} | STRING_ {global dstscii; set dstscii(name) $1; IMGSVRApply dstscii 1} - | numeric numeric coordOpt {global dstscii; set dstscii(x) $1; set dstscii(y) $2; set dstscii(skyformat) degrees; set dstscii(skyformat,msg) degress; IMGSVRApply dstscii 1} + | numeric numeric coordOpt {global dstscii; set dstscii(x) $1; set dstscii(y) $2; set dstscii(skyformat) degrees; set dstscii(skyformat,msg) degrees; IMGSVRApply dstscii 1} | SEXSTR_ SEXSTR_ coordOpt {global dstscii; set dstscii(x) $1; set dstscii(y) $2; set dstscii(skyformat) sexagesimal; set dstscii(skyformat,msg) sexagesimal; IMGSVRApply dstscii 1} | SIZE_ numeric numeric sizeOpt {global dstscii; set dstscii(width) $2; set dstscii(height) $3; set dstscii(rformat) $4; set dstscii(rformat,msg) $4} | SAVE_ yesno {global dstscii; set dstscii(save) $2} @@ -84,10 +53,6 @@ update : FRAME_ {IMGSVRUpdate dstscii; IMGSVRApply dstscii 1} | CROSSHAIR_ {IMGSVRCrosshair dstscii; IMGSVRApply dstscii 1} ; -frame : NEW_ {set _ new} - | CURRENT_ {set _ current} - ; - survey : POSS2RED_ {set _ poss2ukstu_red} | POSS2INFRARED_ {set _ poss2ukstu_ir} | POSS2BLUE_ {set _ poss2ukstu_blue} diff --git a/ds9/parsers/imgsvr.fin b/ds9/parsers/imgsvr.fin new file mode 100644 index 0000000..b1a9904 --- /dev/null +++ b/ds9/parsers/imgsvr.fin @@ -0,0 +1,24 @@ +wcs {return $WCS_} +fk5 {return $FK5_} + +degrees {return $DEGREES_} +sexagesimal {return $SEXAGESIMAL_} +arcmin {return $ARCMIN_} +arcsec {return $ARCSEC_} + +close {return $CLOSE_} +coord {return $COORD_} +crosshair {return $CROSSHAIR_} +current {return $CURRENT_} +frame {return $FRAME_} +name {return $NAME_} +new {return $NEW_} +open {return $OPEN_} +save {return $SAVE_} +size {return $SIZE_} +survey {return $SURVEY_} +update {return $UPDATE_} + +# SEXAGESIMAL +[+-]?{D}+:{D}+:{D}+"."? | +[+-]?{D}+:{D}+:{D}*"."{D}+ {set yylval $yytext; return $SEXSTR_} diff --git a/ds9/parsers/imgsvr.tin b/ds9/parsers/imgsvr.tin new file mode 100644 index 0000000..fcfbef5 --- /dev/null +++ b/ds9/parsers/imgsvr.tin @@ -0,0 +1,21 @@ +%token SEXSTR_ +%token WCS_ +%token FK5_ + +%token DEGREES_ +%token SEXAGESIMAL_ +%token ARCMIN_ +%token ARCSEC_ + +%token CLOSE_ +%token COORD_ +%token CROSSHAIR_ +%token CURRENT_ +%token FRAME_ +%token NAME_ +%token NEW_ +%token OPEN_ +%token UPDATE_ +%token SAVE_ +%token SIZE_ +%token SURVEY_ diff --git a/ds9/parsers/imgsvr.trl b/ds9/parsers/imgsvr.trl new file mode 100644 index 0000000..959ea08 --- /dev/null +++ b/ds9/parsers/imgsvr.trl @@ -0,0 +1,31 @@ +deg : {set _ degrees} + | DEGREES_ {set _ degrees} + ; + +sex : {set _ sexagesimal} + | SEXAGESIMAL_ {set _ sexagesimal} + ; + +coordOpt : + | WCS_ + | FK5_ + | WCS_ FK5_ + ; + +sizeOpt : {set _ degrees} + | skyformat {set _ $1} + ; + +skyformat : DEGREES_ {set _ degrees} + | ARCMIN_ {set _ arcmin} + | ARCSEC_ {set _ arcsec} + ; + +frame : NEW_ {set _ new} + | CURRENT_ {set _ current} + ; + +# | error { +# yyerror "must be: degrees|arcmin|arcsec" +# YYABORT +# } diff --git a/ds9/parsers/skyviewparser.tac b/ds9/parsers/skyviewparser.tac index 0dc6022..276fa43 100644 --- a/ds9/parsers/skyviewparser.tac +++ b/ds9/parsers/skyviewparser.tac @@ -2,53 +2,23 @@ %} #include yesno.tin -#include coords.tin +#include imgsvr.tin #include base.tin %start command -%token CLOSE_ -%token COORD_ -%token CROSSHAIR_ -%token CURRENT_ -%token FRAME_ -%token NAME_ -%token NEW_ -%token OPEN_ %token PIXELS_ -%token UPDATE_ -%token SAVE_ -%token SIZE_ -%token SURVEY_ %% #include yesno.trl -#include coords.trl +#include imgsvr.trl #include base.trl command : skyview | skyview {yyclearin; YYACCEPT} CMD_ ; -deg : {set _ degrees} - | DEGREES_ {set _ degrees} - ; - -sex : {set _ sexagesimal} - | SEXAGESIMAL_ {set _ sexagesimal} - ; - -coordOpt : - | WCS_ - | FK5_ - | WCS_ FK5_ - ; - -sizeOpt : {set _ degrees} - | skyformat {set _ $1} - ; - # COORD_ is depricated # NAME_ is depricated # new optional WCS_ FK5_, does nothing @@ -58,7 +28,7 @@ skyview : {IMGSVRApply dskyview 1} | OPEN_ {} | CLOSE_ {ARDestroy dskyview} | STRING_ {global dskyview; set dskyview(name) $1; IMGSVRApply dskyview 1} - | numeric numeric coordOpt {global dskyview; set dskyview(x) $1; set dskyview(y) $2; set dskyview(skyformat) degrees; set dskyview(skyformat,msg) degress; IMGSVRApply dskyview 1} + | numeric numeric coordOpt {global dskyview; set dskyview(x) $1; set dskyview(y) $2; set dskyview(skyformat) degrees; set dskyview(skyformat,msg) degrees; IMGSVRApply dskyview 1} | SEXSTR_ SEXSTR_ coordOpt {global dskyview; set dskyview(x) $1; set dskyview(y) $2; set dskyview(skyformat) sexagesimal; set dskyview(skyformat,msg) sexagesimal; IMGSVRApply dskyview 1} | SIZE_ numeric numeric sizeOpt {global dskyview; set dskyview(width) $2; set dskyview(height) $3; set dskyview(rformat) $4; set dskyview(rformat,msg) $4} | PIXELS_ numeric numeric {global dskyview; set dskyview(width,pixels) $2; set dskyview(height,pixels) $3} @@ -76,10 +46,6 @@ update : FRAME_ {IMGSVRUpdate dskyview; IMGSVRApply dskyview 1} | CROSSHAIR_ {IMGSVRCrosshair dskyview; IMGSVRApply dskyview 1} ; -frame : NEW_ {set _ new} - | CURRENT_ {set _ current} - ; - %% proc skyview::yyerror {msg} { diff --git a/ds9/parsers/twomasslex.fcl b/ds9/parsers/twomasslex.fcl index aaaee4e..2a0d497 100644 --- a/ds9/parsers/twomasslex.fcl +++ b/ds9/parsers/twomasslex.fcl @@ -7,21 +7,8 @@ %% -close {return $CLOSE_} -coord {return $COORD_} -crosshair {return $CROSSHAIR_} -current {return $CURRENT_} -frame {return $FRAME_} -name {return $NAME_} -new {return $NEW_} -open {return $OPEN_} -save {return $SAVE_} -size {return $SIZE_} -survey {return $SURVEY_} -update {return $UPDATE_} - #include yesno.fin -#include coords.fin +#include imgsvr.fin #include base.fin %% diff --git a/ds9/parsers/twomassparser.tac b/ds9/parsers/twomassparser.tac index ea38b48..ecc4d13 100644 --- a/ds9/parsers/twomassparser.tac +++ b/ds9/parsers/twomassparser.tac @@ -2,52 +2,21 @@ %} #include yesno.tin -#include coords.tin +#include imgsvr.tin #include base.tin %start command -%token CLOSE_ -%token COORD_ -%token CROSSHAIR_ -%token CURRENT_ -%token FRAME_ -%token NAME_ -%token NEW_ -%token OPEN_ -%token UPDATE_ -%token SAVE_ -%token SIZE_ -%token SURVEY_ - %% #include yesno.trl -#include coords.trl +#include imgsvr.trl #include base.trl command : 2mass | 2mass {yyclearin; YYACCEPT} CMD_ ; -deg : {set _ degrees} - | DEGREES_ {set _ degrees} - ; - -sex : {set _ sexagesimal} - | SEXAGESIMAL_ {set _ sexagesimal} - ; - -coordOpt : - | WCS_ - | FK5_ - | WCS_ FK5_ - ; - -sizeOpt : {set _ degrees} - | skyformat {set _ $1} - ; - # COORD_ is depricated # NAME_ is depricated # new optional WCS_ FK5_, does nothing @@ -57,7 +26,7 @@ sizeOpt : {set _ degrees} | OPEN_ {} | CLOSE_ {ARDestroy dtwomass} | STRING_ {global dtwomass; set dtwomass(name) $1; IMGSVRApply dtwomass 1} - | numeric numeric coordOpt {global dtwomass; set dtwomass(x) $1; set dtwomass(y) $2; set dtwomass(skyformat) degrees; set dtwomass(skyformat,msg) degress; IMGSVRApply dtwomass 1} + | numeric numeric coordOpt {global dtwomass; set dtwomass(x) $1; set dtwomass(y) $2; set dtwomass(skyformat) degrees; set dtwomass(skyformat,msg) degrees; IMGSVRApply dtwomass 1} | SEXSTR_ SEXSTR_ coordOpt {global dtwomass; set dtwomass(x) $1; set dtwomass(y) $2; set dtwomass(skyformat) sexagesimal; set dtwomass(skyformat,msg) sexagesimal; IMGSVRApply dtwomass 1} | SIZE_ numeric numeric sizeOpt {global dtwomass; set dtwomass(width) $2; set dtwomass(height) $3; set dtwomass(rformat) $4; set dtwomass(rformat,msg) $4} | SAVE_ yesno {global dtwomass; set dtwomass(save) $2} @@ -74,10 +43,6 @@ update : FRAME_ {IMGSVRUpdate dtwomass; IMGSVRApply dtwomass 1} | CROSSHAIR_ {IMGSVRCrosshair dtwomass; IMGSVRApply dtwomass 1} ; -frame : NEW_ {set _ new} - | CURRENT_ {set _ current} - ; - survey : 'j' {set _ $1} | 'h' {set _ $1} | 'k' {set _ $1} |