diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-06-11 18:22:51 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-06-11 18:22:51 (GMT) |
commit | 9f07551b5d68463d04eaefa61e8e5000df610b47 (patch) | |
tree | 76c5b23d85983b7fadd7d1d58eb936d8d47b1233 | |
parent | e69460ddd490adbfa8a46b479aa11d0da659c45a (diff) | |
download | blt-9f07551b5d68463d04eaefa61e8e5000df610b47.zip blt-9f07551b5d68463d04eaefa61e8e5000df610b47.tar.gz blt-9f07551b5d68463d04eaefa61e8e5000df610b47.tar.bz2 |
add ds9 pagesetup send parser
-rw-r--r-- | ds9/library/pagesetup.tcl | 15 | ||||
-rw-r--r-- | ds9/library/source.tcl | 2 | ||||
-rw-r--r-- | ds9/parsers/pagesetupsendlex.fcl | 16 | ||||
-rw-r--r-- | ds9/parsers/pagesetupsendparser.tac | 25 |
4 files changed, 49 insertions, 9 deletions
diff --git a/ds9/library/pagesetup.tcl b/ds9/library/pagesetup.tcl index 0b1f3db..79ecae0 100644 --- a/ds9/library/pagesetup.tcl +++ b/ds9/library/pagesetup.tcl @@ -188,15 +188,12 @@ proc ProcessPSPageSetupCmd {varname iname} { } proc ProcessSendPSPageSetupCmd {proc id param {sock {}} {fn {}}} { - global ps + global parse + set parse(proc) $proc + set parse(id) $id - switch -- [string tolower $param] { - orientation - - orient {$proc $id "$ps(orient)\n"} - pagescale - - scale {$proc $id "$ps(scale)\n"} - pagesize - - size {$proc $id "$ps(size)\n"} - } + pagesetupsend::YY_FLUSH_BUFFER + pagesetupsend::yy_scan_string $param + pagesetupsend::yyparse } diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index 810c0db..29e11c7 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -320,6 +320,8 @@ source $ds9(root)/library/rotateparser.tcl source $ds9(root)/library/rotatelex.tcl source $ds9(root)/library/pagesetupparser.tcl source $ds9(root)/library/pagesetuplex.tcl +source $ds9(root)/library/pagesetupsendparser.tcl +source $ds9(root)/library/pagesetupsendlex.tcl source $ds9(root)/library/panparser.tcl source $ds9(root)/library/panlex.tcl source $ds9(root)/library/pansendparser.tcl diff --git a/ds9/parsers/pagesetupsendlex.fcl b/ds9/parsers/pagesetupsendlex.fcl new file mode 100644 index 0000000..5455834 --- /dev/null +++ b/ds9/parsers/pagesetupsendlex.fcl @@ -0,0 +1,16 @@ +#tab pagesetupsendparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +orient {return $ORIENT_} +scale {return $SCALE_} +size {return $SIZE_} + +#include ws.fin + +%% diff --git a/ds9/parsers/pagesetupsendparser.tac b/ds9/parsers/pagesetupsendparser.tac new file mode 100644 index 0000000..a257d8a --- /dev/null +++ b/ds9/parsers/pagesetupsendparser.tac @@ -0,0 +1,25 @@ +%{ +%} + +%start pagesetupsend + +%token ORIENT_ +%token SCALE_ +%token SIZE_ + +%% + +pagesetupsend : ORIENT_ {ProcessSendCmdGet ps orient} + | SCALE_ {ProcessSendCmdGet ps scale} + | SIZE_ {ProcessSendCmdGet ps size} + ; + +%% + +proc pagesetupsend::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |