diff options
-rw-r--r-- | ds9/parsers/gridlex.fcl | 8 | ||||
-rw-r--r-- | ds9/parsers/gridparser.tac | 190 |
2 files changed, 106 insertions, 92 deletions
diff --git a/ds9/parsers/gridlex.fcl b/ds9/parsers/gridlex.fcl index f69404d..23ac44a 100644 --- a/ds9/parsers/gridlex.fcl +++ b/ds9/parsers/gridlex.fcl @@ -7,7 +7,7 @@ %% -analyis {return $ANALYSIS_} +analysis {return $ANALYSIS_} axes {return $AXES_} border {return $BORDER_} close {return $CLOSE_} @@ -37,7 +37,8 @@ open {return $OPEN_} publication {return $PUBLICATION_} reset {return $RESET_} save {return $SAVE_} -sky {return $SKY_} +sky {return $SKYFRAME_} +skyframe {return $SKYFRAME_} skyformat {return $SKYFORMAT_} style {return $STYLE_} system {return $SYSTEM_} @@ -55,6 +56,9 @@ width {return $WIDTH_} #include yesno.fin #include font.fin +#include coords.fin +#include skyframe.fin +#include skyformat.fin #include numeric.fin #include string.fin diff --git a/ds9/parsers/gridparser.tac b/ds9/parsers/gridparser.tac index 486ae04..3ed9506 100644 --- a/ds9/parsers/gridparser.tac +++ b/ds9/parsers/gridparser.tac @@ -3,6 +3,9 @@ #include yesno.tin #include font.tin +#include coords.tin +#include skyframe.tin +#include skyformat.tin #include numeric.tin #include string.tin @@ -34,7 +37,7 @@ %token PUBLICATION_ %token RESET_ %token SAVE_ -%token SKY_ +%token SKYFRAME_ %token SKYFORMAT_ %token STYLE_ %token SYSTEM_ @@ -52,6 +55,9 @@ #include yesno.trl #include font.trl +#include coords.trl +#include skyframe.trl +#include skyformat.trl #include numeric.trl command : grid @@ -62,19 +68,19 @@ grid : yesno {global grid; set grid(view) $1; GridUpdateCurrent} | OPEN_ {GridDialog} | CLOSE_ {GridDestroyDialog} | TYPE_ type - | SYSTEM_ - | SKY_ - | SKYFORMAT_ + | 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 - | AXES_ axes - | FORMAT1_ - | FORMAT2_ - | TICKMARKS_ tickmarks - | BORDER_ border - | NUMERICS_ numerics - | TITLE_ title - | LABELS_ labels - | VIEW_ view + | FORMAT1_ STRING_ {global grid; set grid(format1) $2; GridUpdateCurrent} + | FORMAT2_ STRING_ {global grid; set grid(format2) $2; GridUpdateCurrent} + | AXES_ axes {GridUpdateCurrent} + | TICKMARKS_ tickmarks {GridUpdateCurrent} + | BORDER_ border {GridUpdateCurrent} + | NUMERICS_ numerics {GridUpdateCurrent} + | TITLE_ title {GridUpdateCurrent} + | LABELS_ labels {GridUpdateCurrent} + | VIEW_ view {GridUpdateCurrent} | RESET_ {GridResetDialog} | LOAD_ STRING_ {FileLast gridfbox $2; GridLoad $2} | SAVE_ STRING_ {FileLast gridfbox $2; GridSave $2} @@ -87,110 +93,114 @@ type : typegrid {global grid; set grid(type) $1; GridUpdateCurrent} | NUMERICS_ {global grid; set grid(numlab,type) $1; GridUpdateCurrent} ; +system : coordsys {set _ $1} + | wcssys {set _ $1} + ; + typegrid : ANALYSIS_ {set _ analysis} | PUBLICATION_ {set _ publication} ; -gridgrid : yesno - | COLOR_ - | WIDTH_ - | STYLE_ - | GAP1_ - | GAP2_ - | GAP3_ +interiortype : INTERIOR_ {set _ interior} + | EXTERIOR_ {set _ exterior} + ; + +gridgrid : yesno {global grid; set grid(grid) $2} + | 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} + | GAP1_ numeric {global grid; set grid(grid,gap1) $2} + | GAP2_ numeric {global grid; set grid(grid,gap2) $2} + | GAP3_ numeric {global grid; set grid(grid,gap3) $2} ; -axes : yesno - | COLOR_ - | WIDTH_ - | STYLE_ - | TYPE_ - | ORIGIN_ +axes : yesno {global grid; set grid(axes) $2} + | 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} ; -tickmarks : yesno - | COLOR_ - | WIDTH_ - | STYLE_ +tickmarks : yesno {global grid; set grid(tick) $2} + | 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 - | COLOR_ - | WIDTH_ - | STYLE_ +border : yesno {global grid; set grid(border) $2} + | 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 - | FONT_ font {global grid; set grid(numlab,font) $2; GridUpdateCurrent} - | FONTSIZE_ INT_ {global grid; set grid(numlab,size) $2; GridUpdateCurrent} - | FONTWEIGHT_ fontweight {global grid; set grid(numlab,weight) $2; GridUpdateCurrent} - | FONTSLANT_ fontslant {global grid; set grid(numlab,slant) $2; GridUpdateCurrent} +numerics : yesno {global grid; set grid(numlab) $2} + | 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} + | FONTSLANT_ fontslant {global grid; set grid(numlab,slant) $2} | FONTSTYLE_ numlabfontstyle - | COLOR_ STRING_ {global grid; set grid(numlab,color) $2; GridUpdateCurrent} - | GAP1_ numeric {global grid; set grid(numlab,gap1) $2; GridUpdateCurrent} - | GAP2_ numeric {global grid; set grid(numlab,gap2) $2; GridUpdateCurrent} - | GAP3_ numeric {global grid; set grid(numlab,gap3) $2; GridUpdateCurrent} - | TYPE_ numlabtype {global grid; set grid(numlab,type) $2; GridUpdateCurrent} - | VERTICAL_ yesno {global grid; set grid(numlab,vertical) $2; GridUpdateCurrent} + | COLOR_ STRING_ {global grid; set grid(numlab,color) $2} + | GAP1_ numeric {global grid; set grid(numlab,gap1) $2} + | GAP2_ numeric {global grid; set grid(numlab,gap2) $2} + | GAP3_ numeric {global grid; set grid(numlab,gap3) $2} + | TYPE_ interiortype {global grid; set grid(numlab,type) $2} + | VERTICAL_ yesno {global grid; set grid(numlab,vertical) $2} ; -numlabtype : INTERIOR_ {set _ interior} - | EXTERIOR_ {set _ exterior} - ; - -numlabfontstyle : NORMAL_ {global grid; set grid(numlab,weight) normal; set grid(numlab,slant) roman; GridUpdateCurrent} - | BOLD_ {global grid; set grid(numlab,weight) bold; set grid(numlab,slant) roman; GridUpdateCurrent} - | ITALIC_ {global grid; set grid(numlab,weight) normal; set grid(numlab,slant) italic; GridUpdateCurrent} +numlabfontstyle : NORMAL_ {global grid; set grid(numlab,weight) normal; set grid(numlab,slant) roman} + | BOLD_ {global grid; set grid(numlab,weight) bold; set grid(numlab,slant) roman} + | ITALIC_ {global grid; set grid(numlab,weight) normal; set grid(numlab,slant) italic} ; -title : yesno {global grid; set grid(title) $2; GridUpdateCurrent} - | TEXT_ STRING_ {global grid; set grid(title,text) $2; GridUpdateCurrent} - | DEF_ yesno {global grid; set grid(title,def) $2; GridUpdateCurrent} - | GAP_ numeric {global grid; set grid(title,gap) $2; GridUpdateCurrent} - | FONT_ font {global grid; set grid(title,font) $2; GridUpdateCurrent} - | FONTSIZE_ INT_ {global grid; set grid(title,size) $2; GridUpdateCurrent} - | FONTWEIGHT_ fontweight {global grid; set grid(title,weight) $2; GridUpdateCurrent} - | FONTSLANT_ fontslant {global grid; set grid(title,slant) $2; GridUpdateCurrent} +title : yesno {global grid; set grid(title) $2} + | 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} + | FONT_ font {global grid; set grid(title,font) $2} + | FONTSIZE_ INT_ {global grid; set grid(title,size) $2} + | FONTWEIGHT_ fontweight {global grid; set grid(title,weight) $2} + | FONTSLANT_ fontslant {global grid; set grid(title,slant) $2} | FONTSTYLE_ titlefontstyle - | COLOR_ STRING_ {global grid; set grid(title,color) $2; GridUpdateCurrent} + | COLOR_ STRING_ {global grid; set grid(title,color) $2} ; -titlefontstyle : NORMAL_ {global grid; set grid(title,weight) normal; set grid(title,slant) roman; GridUpdateCurrent} - | BOLD_ {global grid; set grid(title,weight) bold; set grid(title,slant) roman; GridUpdateCurrent} - | ITALIC_ {global grid; set grid(title,weight) normal; set grid(title,slant) italic; GridUpdateCurrent} - ; - -labels : yesno {global grid; set grid(textlab) $2; GridUpdateCurrent} - | TEXT1_ STRING_ {global grid; set grid(textlab,text1) $2; GridUpdateCurrent} - | TEXT2_ STRING_ {global grid; set grid(textlab,text2) $2; GridUpdateCurrent} - | DEF1_ yesno {global grid; set grid(textlab,def1) $2; GridUpdateCurrent} - | DEF2_ yesno {global grid; set grid(textlab,def2) $2; GridUpdateCurrent} - | GAP1_ numeric {global grid; set grid(textlab,gap1) $2; GridUpdateCurrent} - | GAP2_ numeric {global grid; set grid(textlab,gap2) $2; GridUpdateCurrent} - | FONT_ font {global grid; set grid(textlab,font) $2; GridUpdateCurrent} - | FONTSIZE_ INT_ {global grid; set grid(textlab,size) $2; GridUpdateCurrent} - | FONTWEIGHT_ fontweight {global grid; set grid(textlab,weight) $2; GridUpdateCurrent} - | FONTSLANT_ fontslant {global grid; set grid(textlab,slant) $2; GridUpdateCurrent} +titlefontstyle : NORMAL_ {global grid; set grid(title,weight) normal; set grid(title,slant) roman} + | BOLD_ {global grid; set grid(title,weight) bold; set grid(title,slant) roman} + | ITALIC_ {global grid; set grid(title,weight) normal; set grid(title,slant) italic} + ; + +labels : yesno {global grid; set grid(textlab) $2} + | 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} + | DEF2_ yesno {global grid; set grid(textlab,def2) $2} + | GAP1_ numeric {global grid; set grid(textlab,gap1) $2} + | GAP2_ numeric {global grid; set grid(textlab,gap2) $2} + | FONT_ font {global grid; set grid(textlab,font) $2} + | FONTSIZE_ INT_ {global grid; set grid(textlab,size) $2} + | FONTWEIGHT_ fontweight {global grid; set grid(textlab,weight) $2} + | FONTSLANT_ fontslant {global grid; set grid(textlab,slant) $2} | FONTSTYLE_ labelsfontstyle - | COLOR_ STRING_ {global grid; set grid(textlab,color) $2; GridUpdateCurrent} + | COLOR_ STRING_ {global grid; set grid(textlab,color) $2} ; -labelsfontstyle : NORMAL_ {global grid; set grid(textlab,weight) normal; set grid(textlab,slant) roman; GridUpdateCurrent} - | BOLD_ {global grid; set grid(textlab,weight) bold; set grid(textlab,slant) roman; GridUpdateCurrent} - | ITALIC_ {global grid; set grid(textlab,weight) normal; set grid(textlab,slant) italic; GridUpdateCurrent} +labelsfontstyle : NORMAL_ {global grid; set grid(textlab,weight) normal; set grid(textlab,slant) roman} + | BOLD_ {global grid; set grid(textlab,weight) bold; set grid(textlab,slant) roman} + | ITALIC_ {global grid; set grid(textlab,weight) normal; set grid(textlab,slant) italic} ; -view : GRID_ yesno {global grid; set grid(grid) $2; GridUpdateCurrent} - | AXES_ viewaxes {GridUpdateCurrent} - | TITLE_ yesno {global grid; set grid(title) $2; GridUpdateCurrent} - | BORDER_ yesno {global grid; set grid(border) $2; GridUpdateCurrent} - | VERTICAL_ yesno {global grid; set grid(numlab,vertical) $2; GridUpdateCurrent} +view : GRID_ yesno {global grid; set grid(grid) $2} + | 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; GridUpdateCurrent} - | NUMBERS_ yesno {global grid; set grid(numlab) $2; GridUpdateCurrent} - | TICKMARKS_ yesno {global grid; set grid(tick) $2; GridUpdateCurrent} - | LABELS_ yesno {global grid; set grid(textlab) $2; GridUpdateCurrent} +viewaxes : yesno {global grid; set grid(axes) $2} + | NUMBERS_ yesno {global grid; set grid(numlab) $2} + | TICKMARKS_ yesno {global grid; set grid(tick) $2} + | LABELS_ yesno {global grid; set grid(textlab) $2} ; %% |