diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-05-07 20:14:43 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-05-07 20:14:43 (GMT) |
commit | a69ff077638728f9650222acf7b688776610b8ec (patch) | |
tree | bbd7be5acc3dbd5f95c2c03b05fd384541457b71 /ds9/parsers/frameparser.tac | |
parent | 6b10755f738435f17e8b28139fbce26fa5bba970 (diff) | |
download | blt-a69ff077638728f9650222acf7b688776610b8ec.zip blt-a69ff077638728f9650222acf7b688776610b8ec.tar.gz blt-a69ff077638728f9650222acf7b688776610b8ec.tar.bz2 |
add ds9 frame parser
Diffstat (limited to 'ds9/parsers/frameparser.tac')
-rw-r--r-- | ds9/parsers/frameparser.tac | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/ds9/parsers/frameparser.tac b/ds9/parsers/frameparser.tac new file mode 100644 index 0000000..c1a429e --- /dev/null +++ b/ds9/parsers/frameparser.tac @@ -0,0 +1,114 @@ +%{ +%} + +#include coords.tin +#include numeric.tin +#include string.tin + +%start command + +%token 3D_ +%token ALL_ +%token BACK_ +%token CENTER_ +%token CLEAR_ +%token DELETE_ +%token FIRST_ +%token FORWARD_ +%token FRAMENO_ +%token HIDE_ +%token LAST_ +%token LOCK_ +%token MATCH_ +%token MOVE_ +%token NEW_ +%token NEXT_ +%token PREV_ +%token REFRESH_ +%token RESET_ +%token RGB_ +%token SHOW_ + +%% + +#include coords.trl +#include numeric.trl + +command : frame + | frame {yyclearin; YYACCEPT} STRING_ + ; + +frame : MATCH_ coordnone {MatchFrameCurrent $2} + | LOCK_ coordnone {PanZoomCmdSet lock $2; LockFrameCurrent} + | CENTER_ center + | CLEAR_ clear + | DELETE_ delete + | NEW_ new + | RESET_ reset + | REFRESH_ refresh + | HIDE_ hide + | SHOW_ show + | MOVE_ move + | FIRST_ {FirstFrame} + | LAST_ {LastFrame} + | PREV_ {PrevFrame} + | NEXT_ {NextFrame} + | INT_ {CreateGotoFrame $1 base} + | FRAMENO_ INT_ {CreateGotoFrame $2 base} + ; + +center : {CenterCurrentFrame} + | INT_ {CenterFrame "Frame$1"} + | ALL_ {CenterAllFrame} + ; + +clear : {ClearCurrentFrame} + | INT_ {ClearFrame "Frame$1"} + | ALL_ {ClearAllFrame} + ; + +delete : {DeleteCurrentFrame} + | INT_ {DeleteSingleFrame "Frame$1"} + | ALL_ {DeleteAllFrames} + ; + +new : {CreateFrame} + | RGB_ {CreateRGBFrame} + | 3D_ {Create3DFrame} + ; + +reset : {ResetCurrentFrame} + | INT_ {ResetFrame "Frame$1"} + | ALL_ {ResetAllFrame} + ; + +refresh : {UpdateCurrentFrame} + | INT_ {UpdateFrame "Frame$1"} + | ALL_ {UpdateAllFrame} + ; + +hide : {FrameCmdHideCurrent} + | INT_ {FrameCmdHide $1} + | ALL_ {ActiveFrameNone} + ; + +show : + | INT_ {FrameCmdShow $1} + | ALL_ {ActiveFrameAll} + ; + +move : FIRST_ {FirstFrame} + | LAST_ {LastFrame} + | BACK_ {PrevFrame} + | FORWARD_ {NextFrame} + ; + +%% + +proc frame::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |