diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-26 20:34:38 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-26 20:34:38 (GMT) |
commit | f40d4ead0b7592cdd1dc46d23286197bc818bdb8 (patch) | |
tree | 73c983e829304ef5aba9a0906b8adef2134dbfbe /ds9/parsers | |
parent | 1f82f52029dceecfbeec9d2a1f81c07cbe5c2ed4 (diff) | |
download | blt-f40d4ead0b7592cdd1dc46d23286197bc818bdb8.zip blt-f40d4ead0b7592cdd1dc46d23286197bc818bdb8.tar.gz blt-f40d4ead0b7592cdd1dc46d23286197bc818bdb8.tar.bz2 |
add ds9 cat parser
Diffstat (limited to 'ds9/parsers')
-rw-r--r-- | ds9/parsers/catlex.fcl | 13 | ||||
-rw-r--r-- | ds9/parsers/catparser.tac | 44 |
2 files changed, 53 insertions, 4 deletions
diff --git a/ds9/parsers/catlex.fcl b/ds9/parsers/catlex.fcl index 18b6279..b29e86f 100644 --- a/ds9/parsers/catlex.fcl +++ b/ds9/parsers/catlex.fcl @@ -7,8 +7,14 @@ %% +1and2 {return $1AND2_} +1not2 {return $1NOT2_} +1only {return $1ONLY_} +2not1 {return $2NOT1_} +2only {return $2ONLY_} allcols {return $ALLCOLS_} allrows {return $ALLROWS_} +broadcast {return $BROADCAST_} cancel {return $CANCEL_} cds {return $CDS_} clear {return $CLEAR_} @@ -17,13 +23,17 @@ coordinate {return $COORDINATE_} crosshair {return $CROSSHAIR_} csv {return $CSV_} dec {return $DEC_} +decr {return $DECR_} edit {return $EDIT_} +error {return $ERROR_} export {return $EXPORT_} file {return $FILE_} filter {return $FILTER_} +function {return $FUNCTION_} header {return $HEADER_} hide {return $HIDE_} import {return $IMPORT_} +incr {return $INCR_} load {return $LOAD_} location {return $LOCATION_} match {return $MATCH_} @@ -37,6 +47,7 @@ psystem {return $PSYSTEM_} ra {return $RA_} regions {return $REGIONS_} retrieve {return $RETRIEVE_} +return {return $RETURN_} samp {return $SAMP_} save {return $SAVE_} sb {return $SB_} @@ -50,11 +61,11 @@ starbase {return $STARBASE_} symbol {return $SYMBOL_} system {return $SYSTEM_} tsv {return $TSV_} +unique {return $UNIQUE_} update {return $UPDATE_} vot {return $VOT_} xml {return $XML_} - #include yesno.fin #include skyformat.fin #include skyframe.fin diff --git a/ds9/parsers/catparser.tac b/ds9/parsers/catparser.tac index 7fc9016..ba4d9c6 100644 --- a/ds9/parsers/catparser.tac +++ b/ds9/parsers/catparser.tac @@ -1,4 +1,8 @@ %{ + global icat + set ref [lindex $icat(cats) end] + global cvarname + set cvarname $ref %} #include yesno.tin @@ -10,8 +14,14 @@ %start command +%token 1AND2_ +%token 1NOT2_ +%token 1ONLY_ +%token 2NOT1_ +%token 2ONLY_ %token ALLCOLS_ %token ALLROWS_ +%token BROADCAST_ %token CANCEL_ %token CDS_ %token CLEAR_ @@ -22,8 +32,10 @@ %token DEC_ %token EDIT_ %token EXPORT_ +%token ERROR_ %token FILE_ %token FILTER_ +%token FUNCTION_ %token HEADER_ %token HIDE_ %token IMPORT_ @@ -40,9 +52,11 @@ %token RA_ %token REGIONS_ %token RETRIEVE_ +%token RETURN_ %token SAMP_ %token SAVE_ %token SB_ +%token SEND_ %token SERVER_ %token SHOW_ %token SIZE_ @@ -53,6 +67,7 @@ %token SYMBOL_ %token SYSTEM_ %token TSV_ +%token UNIQUE_ %token UPDATE_ %token VOT_ %token XML_ @@ -93,7 +108,7 @@ cat : | HEADER_ {global cvarname; CATHeader $cvarname} | HIDE_ {global cvarname; global $cvarname; set ${cvarname}(show) 0; CATGenerate $cvarname} | LOCATION_ INT_ {global cvarname; global $cvarname; set ${cvarname}(loc) $2; CATGenerate $cvarname} - | MATCH_ + | MATCH_ match | MAXROWS_ INT_ {global cvarname; global $cvarname; set ${cvarname}(max) $2} | NAME_ STRING_ {global cvarname; global $cvarname; set ${cvarname}(name) $2} | PANTO_ yesno {global cvarname; global $cvarname; set ${cvarname}(panto) $2} @@ -103,11 +118,11 @@ cat : | PSYSTEM_ wcssys {global cvarname; global $cvarname; set ${cvarname}(psystem) $2; CATGenerate $cvarname} | REGIONS_ {global cvarname; CATGenerateRegions $cvarname} | RETRIEVE_ {global cvarname; CATApply $cvarname 1} - | SAMP_ + | SAMP_ samp | SAVE_ STRING_ {global cvarname; CatalogCmdSave $cvarname $2 VOTWrite} | SERVER_ STRING_ {global cvarname; global $cvarname; set ${cvarname}(server) $2} | SHOW_ {global cvarname; global $cvarname; set ${cvarname}(show) 1; CATGenerate $cvarname} - | SIZE_ + | SIZE_ numeric numeric skyformat {global cvarname; global $cvarname; set ${cvarname}(width) $1; set ${cvarname}(height) $2; set ${cvarname}(rformat) $3; set ${cvarname}(rformat,msg) $3} | SKY_ skyframe {global cvarname; global $cvarname; set ${cvarname}(sky) $1; CoordMenuButtonCmd $cvarname system sky [list CATWCSMenuUpdate $cvarname]} | SKYFORMAT_ skyformat {global cvarname; global $cvarname; set ${cvarname}(skyformat) $2} | SORT_ @@ -131,6 +146,24 @@ filter : LOAD_ STRING_ {global cvarname; CatalogCmdFilter $cvarname $2} | STRING_ {global cvarname; global $cvarname; set ${cvarname}(filter) $1; CATable $cvarname} ; +match : {CatalogCmdMatch} + | ERROR_ numeric skyformat {global icat; set icat(error) $2; set icat(eformat) $3} + | FUNCTION_ matchFunction {global icat; set icat(function) $2} + | UNIQUE_ yesno {global icat; set icat(unique) $2} + | RETURN_ matchReturn {global icat; set icat(return) $2} + | STRING_ STRING_ {CatalogCmdMatchParams $1 $2} + ; + +matchFunction : 1AND2_ {set _ 1and2} + | 1NOT2_ {set _ 1not2} + | 2NOT1_ {set _ 2not1} + ; + +matchReturn : 1AND2_ {set _ 1and2} + | 1ONLY_ {set _ 1only} + | 2ONLY_ {set _ 2only} + ; + reader : XML_ {set _ VOTRead} | VOT_ {set _ VOTRead} | SB_ {set _ starbase_read} @@ -139,6 +172,11 @@ reader : XML_ {set _ VOTRead} | TSV_ {set _ TSVRead} ; +samp : {global cvarname; SAMPSendTableLoadVotable {} $cvarname} + | BROADCAST_ {global cvarname; SAMPSendTableLoadVotable {} $cvarname} + | SEND_ STRING_ {CatalogSAMPCmd $2} + ; + writer : XML_ {set _ VOTWrite} | VOT_ {set _ VOTWrite} | SB_ {set _ starbase_write} |