diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-15 18:03:06 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-15 18:03:06 (GMT) |
commit | 988c6b480da724e189ece0a7abdc202d74c0eaaf (patch) | |
tree | af191d91e069d5206174ba99ef52e93c04489cdf /ds9/parsers/gridparser.tac | |
parent | eeb893f8d030661c17b501b369bbf317a1cc3584 (diff) | |
download | blt-988c6b480da724e189ece0a7abdc202d74c0eaaf.zip blt-988c6b480da724e189ece0a7abdc202d74c0eaaf.tar.gz blt-988c6b480da724e189ece0a7abdc202d74c0eaaf.tar.bz2 |
add ds9 grid parser
Diffstat (limited to 'ds9/parsers/gridparser.tac')
-rw-r--r-- | ds9/parsers/gridparser.tac | 68 |
1 files changed, 43 insertions, 25 deletions
diff --git a/ds9/parsers/gridparser.tac b/ds9/parsers/gridparser.tac index 3ed9506..1c45bdd 100644 --- a/ds9/parsers/gridparser.tac +++ b/ds9/parsers/gridparser.tac @@ -51,6 +51,15 @@ %token VIEW_ %token WIDTH_ +%token LLL_ +%token LLU_ +%token LUL_ +%token LUU_ +%token ULL_ +%token ULU_ +%token UUL_ +%token UUU_ + %% #include yesno.trl @@ -64,14 +73,23 @@ command : grid | grid {yyclearin; YYACCEPT} STRING_ ; +typegrid : ANALYSIS_ {set _ analysis} + | PUBLICATION_ {set _ publication} + ; + +interiortype : INTERIOR_ {set _ interior} + | EXTERIOR_ {set _ exterior} + ; + grid : yesno {global grid; set grid(view) $1; GridUpdateCurrent} | OPEN_ {GridDialog} | CLOSE_ {GridDestroyDialog} - | TYPE_ type + # backward compatible + | TYPE_ type {GridUpdateCurrent} | SYSTEM_ system {global grid; set grid(system) $2; GridUpdateCurrent} | SKYFRAME_ skyframe {global grid; set grid(sky) $2; GridUpdateCurrent} | SKYFORMAT_ skyformat {global grid; set grid(skyformat) $2; GridUpdateCurrent} - | GRID_ gridgrid + | GRID_ gridgrid {GridUpdateCurrent} | FORMAT1_ STRING_ {global grid; set grid(format1) $2; GridUpdateCurrent} | FORMAT2_ STRING_ {global grid; set grid(format2) $2; GridUpdateCurrent} | AXES_ axes {GridUpdateCurrent} @@ -86,26 +104,16 @@ grid : yesno {global grid; set grid(view) $1; GridUpdateCurrent} | SAVE_ STRING_ {FileLast gridfbox $2; GridSave $2} ; -type : typegrid {global grid; set grid(type) $1; GridUpdateCurrent} - # backward compatible - | AXES_ {global grid; set grid(axes,type) $1; GridUpdateCurrent} - # backward compatible - | NUMERICS_ {global grid; set grid(numlab,type) $1; GridUpdateCurrent} +type : typegrid {global grid; set grid(type) $1} + | AXES_ interiortype {global grid; set grid(axes,type) $2} + | NUMERICS_ interiortype {global grid; set grid(numlab,type) $2} ; system : coordsys {set _ $1} | wcssys {set _ $1} ; -typegrid : ANALYSIS_ {set _ analysis} - | PUBLICATION_ {set _ publication} - ; - -interiortype : INTERIOR_ {set _ interior} - | EXTERIOR_ {set _ exterior} - ; - -gridgrid : yesno {global grid; set grid(grid) $2} +gridgrid : yesno {global grid; set grid(grid) $1} | COLOR_ STRING_ {global grid; set grid(grid,color) $2} | WIDTH_ INT_ {global grid; set grid(grid,color) $2} | STYLE_ INT_ {global grid; set grid(grid,style) $2} @@ -114,27 +122,37 @@ gridgrid : yesno {global grid; set grid(grid) $2} | GAP3_ numeric {global grid; set grid(grid,gap3) $2} ; -axes : yesno {global grid; set grid(axes) $2} +axes : yesno {global grid; set grid(axes) $1} | COLOR_ STRING_ {global grid; set grid(axes,color) $2} | WIDTH_ INT_ {global grid; set grid(axes,color) $2} | STYLE_ INT_ {global grid; set grid(axes,style) $2} | TYPE_ interiortype {global grid; set grid(axes,type) $2} - | ORIGIN_ STRING_ {global grid; set grid(axes,origin) $2} + | ORIGIN_ origin {global grid; set grid(axes,origin) $2} ; -tickmarks : yesno {global grid; set grid(tick) $2} +origin : LLL_ {set _ lll} + | LLU_ {set _ llu} + | LUL_ {set _ lul} + | LUU_ {set _ luu} + | ULL_ {set _ ull} + | ULU_ {set _ ulu} + | UUL_ {set _ uul} + | UUU_ {set _ uuu} + ; + +tickmarks : yesno {global grid; set grid(tick) $1} | COLOR_ STRING_ {global grid; set grid(tick,color) $2} | WIDTH_ INT_ {global grid; set grid(tick,color) $2} | STYLE_ INT_ {global grid; set grid(tick,style) $2} ; -border : yesno {global grid; set grid(border) $2} +border : yesno {global grid; set grid(border) $1} | COLOR_ STRING_ {global grid; set grid(border,color) $2} | WIDTH_ INT_ {global grid; set grid(border,color) $2} | STYLE_ INT_ {global grid; set grid(border,style) $2} ; -numerics : yesno {global grid; set grid(numlab) $2} +numerics : yesno {global grid; set grid(numlab) $1} | FONT_ font {global grid; set grid(numlab,font) $2} | FONTSIZE_ INT_ {global grid; set grid(numlab,size) $2} | FONTWEIGHT_ fontweight {global grid; set grid(numlab,weight) $2} @@ -153,7 +171,7 @@ numlabfontstyle : NORMAL_ {global grid; set grid(numlab,weight) normal; set gri | ITALIC_ {global grid; set grid(numlab,weight) normal; set grid(numlab,slant) italic} ; -title : yesno {global grid; set grid(title) $2} +title : yesno {global grid; set grid(title) $1} | TEXT_ STRING_ {global grid; set grid(title,text) $2} | DEF_ yesno {global grid; set grid(title,def) $2} | GAP_ numeric {global grid; set grid(title,gap) $2} @@ -170,7 +188,7 @@ titlefontstyle : NORMAL_ {global grid; set grid(title,weight) normal; set grid( | ITALIC_ {global grid; set grid(title,weight) normal; set grid(title,slant) italic} ; -labels : yesno {global grid; set grid(textlab) $2} +labels : yesno {global grid; set grid(textlab) $1} | TEXT1_ STRING_ {global grid; set grid(textlab,text1) $2} | TEXT2_ STRING_ {global grid; set grid(textlab,text2) $2} | DEF1_ yesno {global grid; set grid(textlab,def1) $2} @@ -190,14 +208,14 @@ labelsfontstyle : NORMAL_ {global grid; set grid(textlab,weight) normal; set gr | ITALIC_ {global grid; set grid(textlab,weight) normal; set grid(textlab,slant) italic} ; -view : GRID_ yesno {global grid; set grid(grid) $2} +view : GRID_ yesno {global grid; set grid(grid) $1} | AXES_ viewaxes | TITLE_ yesno {global grid; set grid(title) $2} | BORDER_ yesno {global grid; set grid(border) $2} | VERTICAL_ yesno {global grid; set grid(numlab,vertical) $2} ; -viewaxes : yesno {global grid; set grid(axes) $2} +viewaxes : yesno {global grid; set grid(axes) $1} | NUMBERS_ yesno {global grid; set grid(numlab) $2} | TICKMARKS_ yesno {global grid; set grid(tick) $2} | LABELS_ yesno {global grid; set grid(textlab) $2} |