diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-07-12 17:33:26 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-07-12 17:33:26 (GMT) |
commit | 258f1d74b845cbe821d38235add45a2ee1f16635 (patch) | |
tree | 9979bd0ef17226af4a2e8340f800e5ed813b0b30 /ds9/library | |
parent | e0b5aa9e0ecf6fc11d790887b49ee3d8c5d98da6 (diff) | |
download | blt-258f1d74b845cbe821d38235add45a2ee1f16635.zip blt-258f1d74b845cbe821d38235add45a2ee1f16635.tar.gz blt-258f1d74b845cbe821d38235add45a2ee1f16635.tar.bz2 |
update parser
Diffstat (limited to 'ds9/library')
-rw-r--r-- | ds9/library/lex.fcl | 61 | ||||
-rw-r--r-- | ds9/library/parser.tac | 195 |
2 files changed, 255 insertions, 1 deletions
diff --git a/ds9/library/lex.fcl b/ds9/library/lex.fcl index 8c56027..0d32162 100644 --- a/ds9/library/lex.fcl +++ b/ds9/library/lex.fcl @@ -28,6 +28,7 @@ E [Ee][+-]?{D}+ -console {return $::CONSOLECMD_} -cursor {return $::CURSORCMD_} -exit {return $::QUITCMD_} +-frame {return $::FRAMECMD_} -green {return $::GREENCMD_} -help {return $::HELPCMD_} -histequ {return $::HISTEQUCMD_} @@ -47,6 +48,7 @@ E [Ee][+-]?{D}+ -raise {return $::RAISECMD_} -red {return $::REDCMD_} -scale {return $::SCALECMD_} +-single {return $::SINGLECMD_} -sinh {return $::SINHCMD_} -sleep {return $::SLEEPCMD_} -source {return $::SOURCECMD_} @@ -54,53 +56,76 @@ E [Ee][+-]?{D}+ -sqrt {return $::SQRTCMD_} -theme {return $::THREMECMD_} -threads {return $::THREADSCMD_} +-tile {return $::TILECMD_} -zoom {return $::ZOOMCMD_} -zscale {return $::ZSCALECMD_} +3d {return $::3D_} aip {return $::AIP_} +all {return $::ALL_} +amplifier {return $::AMPLIFIER_} arcmin {return $::ARCMIN_} arcsec {return $::ARCSEC_} asinh {return $::ASINH_} azimuth {return $::AZIMUTH_} az {return $::AZIMUTH_} +automatic {return $::AUTOMATIC_} +back {return $::BACK_} background {return $::BACKGROUND_} bg {return $::BACKGROUND_} bgcolor {return $::BGCOLOR_} border {return $::BORDER_} +center {return $::CENTER_} clear {return $::CLEAR_} close {return $::CLOSE_} color {return $::COLOR_} +column {return $::COLUMN_} compass {return $::COMPASS_} contrast {return $::CONTRAST_} coord {return $::COORD_} crosshair {return $::CROSSHAIR_} current {return $::CURRENT_} datasec {return $::DATASEC_} +delete {return $::DELETE_} +detector {return $::DETECTOR_} degrees {return $::DEGREES_} +direction {return $::DIRECTION_} elevation {return $::ELEVATION_} el {return $::ELEVATION_} exp {return $::EXP_} false {return $::FALSE_} +first {return $::FIRST_} fit {return $::FIT_} +foward {return $::FOWARD_} frame {return $::FRAME_} +frameno {return $::FRAMENO_} +gap {return $::GAP_} global {return $::GLOBAL_} +grid {return $::GRID_} +hide {return $::HIDE_} highlite {return $::HIGHLITE_} histequ {return $::HISTEQU_} +image {return $::IMAGE_} in {return $::IN_} irafalign {return $::IRAFALIGN_} -linear {return $::LINEAR_} +last {return $::LAST_} +layout {return $::LAYOUT_} limits {return $::LIMITS_} +linear {return $::LINEAR_} line {return $::LINE_} local {return $::LOCAL_} lock {return $::LOCK_} log {return $::LOG_} +manual {return $::MANUAL_} match {return $::MATCH_} method {return $::METHOD_} minmax {return $::MINMAX_} mip {return $::MIP_} mode {return $::MODE_} +move {return $::MOVE_} name {return $::NAME_} nancolor {return $::NANCOLOR_} +next {return $::NEXT_} new {return $::NEW_} no {return $::NO_} none {return $::NONE_} @@ -109,12 +134,19 @@ on {return $::ON_} open {return $::OPEN_} out {return $::OUT_} pow {return $::POW_} +prev {return $::PREV_} +physical {return $::PHYSICAL_} +refresh {return $::REFRESH_} +reset {return $::RESET_} +rgb {return $::RGB_} +row {return $::ROW_} sample {return $::SAMPLE_} save {return $::SAVE_} scale {return $::SCALE_} scalelimits {return $::SCALELIMITS_} scope {return $::SCOPE_} sexagesimal {return $::SEXAGESIMAL_} +show {return $::SHOW_} sinh {return $::SINH_} size {return $::SIZE_} squared {return $::SQUARED_} @@ -127,6 +159,33 @@ update {return $::UPDATE_} user {return $::USER_} view {return $::VIEW_} vp {return $::VIEW_} +wcs {return $::WCS_} +wcsa {return $::WCSA_} +wcsb {return $::WCSB_} +wcsc {return $::WCSC_} +wcsd {return $::WCSD_} +wcse {return $::WCSE_} +wcsf {return $::WCSF_} +wcsg {return $::WCSG_} +wcsh {return $::WCSH_} +wcsi {return $::WCSI_} +wcsj {return $::WCSJ_} +wcsk {return $::WCSK_} +wcsl {return $::WCSL_} +wcsm {return $::WCSM_} +wcsn {return $::WCSN_} +wcso {return $::WCSO_} +wcsp {return $::WCSP_} +wcsq {return $::WCSQ_} +wcsr {return $::WCSR_} +wcss {return $::WCSS_} +wcst {return $::WCST_} +wcsu {return $::WCSU_} +wcsv {return $::WCSV_} +wcsw {return $::WCSW_} +wcsx {return $::WCSX_} +wcsy {return $::WCSY_} +wcsz {return $::WCSZ_} x {return $::X_} xy {return $::XY_} y {return $::Y_} diff --git a/ds9/library/parser.tac b/ds9/library/parser.tac index ae3e5a4..adc1388 100644 --- a/ds9/library/parser.tac +++ b/ds9/library/parser.tac @@ -24,6 +24,7 @@ set file(load) 0 %token CONSOLECMD_ %token CURSORCMD_ %token GREENCMD_ +%token FRAMECMD_ %token HELPCMD_ %token HISTEQUCMD_ %token ICONIFYCMD_ @@ -42,6 +43,7 @@ set file(load) 0 %token RAISECMD_ %token REDCMD_ %token SCALECMD_ +%token SINGLECMD_ %token SINHCMD_ %token SLEEPCMD_ %token SOURCECMD_ @@ -49,20 +51,28 @@ set file(load) 0 %token SQRTCMD_ %token THEMECMD_ %token THREADSCMD_ +%token TILECMD_ %token ZOOMCMD_ %token ZSCALECMD_ +%token 3D_ %token AIP_ +%token ALL_ +%token AMPLIFIER_ %token ARCMIN_ %token ARCSEC_ %token ASINH_ %token AZIMUTH_ +%token AUTOMATIC_ +%token BACK_ %token BACKGROUND_ %token BGCOLOR_ %token BORDER_ +%token CENTER_ %token CLEAR_ %token CLOSE_ %token COLOR_ +%token COLUMN_ %token COMPASS_ %token CONTRAST_ %token COORD_ @@ -70,30 +80,45 @@ set file(load) 0 %token CURRENT_ %token DATASEC_ %token DEGREES_ +%token DETECTOR_ +%token DELETE_ +%token DIRECTION_ %token ELEVATION_ %token EXP_ %token FALSE_ +%token FIRST_ %token FIT_ +%token FORWARD_ %token FRAME_ +%token FRAMENO_ +%token GAP_ %token GLOBAL_ +%token GRID_ +%token HIDE_ %token HIGHLITE_ %token HISTEQU_ +%token IMAGE_ %token IN_ %token IRAFALIGN_ +%token LAST_ +%token LAYOUT_ %token LIMITS_ %token LINE_ %token LINEAR_ %token LOCAL_ %token LOCK_ %token LOG_ +%token MANUAL_ %token MATCH_ %token METHOD_ %token MINMAX_ %token MIP_ %token MODE_ +%token MOVE_ %token NAME_ %token NANCOLOR_ %token NEW_ +%token NEXT_ %token NO_ %token NONE_ %token OFF_ @@ -101,12 +126,19 @@ set file(load) 0 %token OPEN_ %token OUT_ %token POW_ +%token PREV_ +%token PHYSICAL_ +%token REFRESH_ +%token RESET_ +%token RGB_ +%token ROW_ %token SAMPLE_ %token SAVE_ %token SCALE_ %token SCALELIMITS_ %token SCOPE_ %token SEXAGESIMAL_ +%token SHOW_ %token SINH_ %token SIZE_ %token SQUARED_ @@ -118,6 +150,33 @@ set file(load) 0 %token UPDATE_ %token USER_ %token VIEW_ +%token WCS_ +%token WCSA_ +%token WCSB_ +%token WCSC_ +%token WCSD_ +%token WCSE_ +%token WCSF_ +%token WCSG_ +%token WCSH_ +%token WCSI_ +%token WCSJ_ +%token WCSK_ +%token WCSL_ +%token WCSM_ +%token WCSN_ +%token WCSO_ +%token WCSP_ +%token WCSQ_ +%token WCSR_ +%token WCSS_ +%token WCST_ +%token WCSU_ +%token WCSV_ +%token WCSW_ +%token WCSX_ +%token WCSY_ +%token WCSZ_ %token X_ %token XY_ %token Y_ @@ -140,6 +199,7 @@ command : 2MASSCMD_ {2MASSDialog} 2mass | CDCMD_ cd | CONSOLECMD_ {global ds9; OpenConsole; InitError $ds9(msg,src)} | CURSORCMD_ INT_ INT_ {CursorCmd $2 $3} + | FRAMECMD_ frame | GREENCMD_ {global current; set current(rgb) green; RGBChannel} | HELPCMD_ {HelpCommand} | HISTEQUCMD_ {global scale; set scale(type) histequ; ChangeScale} @@ -160,6 +220,7 @@ command : 2MASSCMD_ {2MASSDialog} 2mass | QUITCMD_ {QuitDS9} | RAISECMD_ {global ds9; raise $ds9(top)} | REDCMD_ {global current; set current(rgb) red; RGBChannel} + | SINGLECMD_ {global current; ProcessRealizeDS9; set current(display) single; DisplayMode} | SINHCMD_ {global scale; set scale(type) sinh; ChangeScale} | SLEEPCMD_ {UpdateDS9; RealizeDS9} sleep | SOURCECMD_ STRING_ {SourceFileCmd $2} @@ -169,6 +230,7 @@ command : 2MASSCMD_ {2MASSDialog} 2mass # backward compatibility | THEMECMD_ | THREADSCMD_ INT_ {global ds9; set ds9(threads) $2; ChangeThreads} + | TILECMD_ tile | ZOOMCMD_ {ProcessRealizeDS9} zoom | ZSCALECMD_ zscale | STRING_ {CommandLineFileName $1} @@ -213,6 +275,42 @@ optDeg : {set _ degrees} | DEGREES_ {set _ degrees} ; +coordsys : IMAGE_ {set _ image} + | PHYSICAL_ {set _ physical} + | AMPLIFIER_ {set _ amplifier} + | DETECTOR_ {set _ detector} + | wcssys {set _ $1} + ; + +wcssys : WCS_ {set _ wcs} + | WCSA_ {set _ wcsa} + | WCSB_ {set _ wcsb} + | WCSC_ {set _ wcsc} + | WCSD_ {set _ wcsd} + | WCSE_ {set _ wcse} + | WCSF_ {set _ wcsf} + | WCSG_ {set _ wcsg} + | WCSH_ {set _ wcsh} + | WCSI_ {set _ wcsi} + | WCSJ_ {set _ wcsj} + | WCSK_ {set _ wcsk} + | WCSL_ {set _ wcsl} + | WCSM_ {set _ wcsm} + | WCSN_ {set _ wcsn} + | WCSO_ {set _ wcso} + | WCSP_ {set _ wcsp} + | WCSQ_ {set _ wcsq} + | WCSR_ {set _ wcsr} + | WCSS_ {set _ wcss} + | WCST_ {set _ wcst} + | WCSU_ {set _ wcsu} + | WCSV_ {set _ wcsv} + | WCSW_ {set _ wcsw} + | WCSX_ {set _ wcsx} + | WCSY_ {set _ wcsy} + | WCSZ_ {set _ wcsz} + ; + 2mass : {IMGSVRApply dtwomass 1} | STRING_ {global dtwomass; set dtwomass(name) $1; IMGSVRApply dtwomass 1} | NAME_ STRING_ {global dtwomass; set dtwomass(name) $2; IMGSVRApply dtwomass 1} @@ -310,6 +408,74 @@ cd : STRING_ {cd $2} | '/' {cd /} ; +frame : + | MATCH_ coordsys {MatchFrameCurrent $2} + | LOCK_ frameLock + | CENTER_ frameCenter + | CLEAR_ frameClear + | DELETE_ frameDelete + | NEW_ frameNew + | RESET_ frameReset + | REFRESH_ frameRefresh + | HIDE_ frameHide + | SHOW_ frameShow + | MOVE_ frameMove + | FIRST_ {FirstFrame} + | PREV_ {PrevFrame} + | NEXT_ {NextFrame} + | LAST_ {LastFrame} + | FRAMENO_ INT_ {CreateGotoFrame $2 base} + ; + +frameLock : coordsys {global panzoom; set panzoom(lock) $1; LockFrameCurrent} + | NONE_ {global panzoom; set panzoom(lock) none; LockFrameCurrent} + ; + +frameCenter: {CenterCurrentFrame} + | ALL_ {CenterAllFrame} + | INT_ {CenterFrame "Frame$1"} + ; + +frameClear: {ClearCurrentFrame} + | ALL_ {ClearAllFrame} + | INT_ {ClearFrame "Frame$1"} + ; + +frameDelete: {DeleteCurrentFrame} + | ALL_ {DeleteAllFrames} + | INT_ {DeleteFrame "Frame$1"} + ; + +frameNew: {CreateFrame} + | RGB_ {CreateRGBFrame} + | 3D_ {Create3DFrame} + ; + +frameReset: {ResetCurrentFrame} + | ALL_ {ResetAllFrame} + | INT_ {ResetFrame "Frame$1"} + ; + +frameRefresh: {UpdateCurrentFrame} + | ALL_ {UpdateAllFrame} + | INT_ {UpdateFrame "Frame$1"} + ; + +frameHide: {global active; global current; set active($current(frame)) 0; UpdateActiveFrames} + | ALL_ {ActiveFrameNone} + | INT_ {global active; set active("Frame$1") 0; UpdateActiveFrames} + ; + +frameShow: ALL_ {ActiveFrameAll} + | INT_ {global active; set active("Frame$1") 1; UpdateActiveFrames} + ; + +frameMove : FIRST_ {MoveFirstFrame} + | BACK_ {MovePrevFrame} + | FORWARD_ {MoveNextFrame} + | LAST_ {MoveLastFrame} + ; + iconify : {global ds9; wm iconify $ds9(top)} | yes {global ds9; wm iconify $ds9(top)} | no {global ds9; wm deiconify $ds9(top)} @@ -411,6 +577,35 @@ sleep : {after 1000} | numeric {after [expr int($1*1000)]} ; +tile: {global current; set current(display) tile; DisplayMode} + | yes {global current; set current(display) tile; DisplayMode} + | no {global current; set current(display) single; DisplayMode} + | MODE_ tileMode {global tile; set tile(mode) $2; DisplayMode} + | GRID_ tileGrid + | COLUMN_ {global tile; set tile(mode) column; DisplayMode} + | ROW_ {global tile; set tile(mode) row; DisplayMode} + ; + +tileMode : GRID_ {set _ grid} + | COLUMN_ {set _ column} + | ROW_ {set _ row} + ; + +tileGrid : {global tile; set tile(mode) grid; DisplayMode} + | MODE_ tileGridMode {global tile; set tile(grid,mode) $2; DisplayMode} + | DIRECTION_ tileGridDir {global tile; set tile(grid,dir) $2; DisplayMode} + | LAYOUT_ INT_ INT_ {global tile; set tile(grid,col) $2; set tile(grid,row) $3; set tile(grid,mode) manual; DisplayMode} + | GAP_ INT_ {global tile; set tile(grid,gap) $2; DisplayMode} + ; + +tileGridMode : AUTOMATIC_ {set _ automatic} + | MANUAL_ {set _ manual} + ; + +tileGridDir : X_ {set _ x} + | Y_ {set _ y} + ; + zoom : numeric {Zoom $1 $1} | numeric numeric {Zoom $1 $2} | OPEN_ {PanZoomDialog} |