diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-06-23 19:27:47 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-06-23 19:27:47 (GMT) |
commit | d6c3ee821cffa1719a2b730337ad67abe9b7e593 (patch) | |
tree | fe587021df801a03c2b30f2a2e296744f571cb3c /ds9 | |
parent | a5f2cd50b9abc36ededa34e3982064e5f7f07829 (diff) | |
download | blt-d6c3ee821cffa1719a2b730337ad67abe9b7e593.zip blt-d6c3ee821cffa1719a2b730337ad67abe9b7e593.tar.gz blt-d6c3ee821cffa1719a2b730337ad67abe9b7e593.tar.bz2 |
new parser
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/lex.fcl | 26 | ||||
-rw-r--r-- | ds9/library/parser.tac | 47 | ||||
-rw-r--r-- | ds9/library/source.tcl | 4 | ||||
-rw-r--r-- | ds9/make.include | 4 |
4 files changed, 69 insertions, 12 deletions
diff --git a/ds9/library/lex.fcl b/ds9/library/lex.fcl index eb3ca74..c07811f 100644 --- a/ds9/library/lex.fcl +++ b/ds9/library/lex.fcl @@ -2,9 +2,27 @@ source $ds9(root)/library/parser.tab.tcl %} +%option noyywrap +%option caseless +%option nodefault +%option nointeractive + %% -about {return ABOUT_} -. {set ::yylval $yytext; return $yytext} -%% -#yylex +\n # +\s # ignore whitespace +. { set ::yylval $yytext; return $yytext } + +2mass {return $::2MASS_} +3d {return $::3D_} +about {return $::ABOUT_} +align {return $::ALIGN_} +analysis {return $::ANALYSIS_} +array {return $::ARRAY_} +asinh {return $::ASINH_} + +no {return $::NO_} + +yes {return $::YES_} + + diff --git a/ds9/library/parser.tac b/ds9/library/parser.tac index f791f7e..e0dd3d3 100644 --- a/ds9/library/parser.tac +++ b/ds9/library/parser.tac @@ -1,14 +1,53 @@ %{ -source $ds9(root)/library/lex.tcl %} +%token 2MASS_ +%token 3D_ %token ABOUT_ +%token ALIGN_ +%token ANALYSIS_ +%token ARRAY_ +%token ASINH_ + +%token NO_ + +%token YES_ %% -command : ABOUT_ - ; +commands : commands command + | command + ; + +command : 2MASS_ 2mass + | 3D_ 3d + | ABOUT_ about + | ALIGN_ align + | ANALYSIS_ analysis + | ARRAY_ array + | ASINH_ asinh + ; + +2mass : {puts "*** 3D ***"} + ; + +3d : {puts "*** 2MASS ***"} + ; + +about : {puts "*** ABOUT ***"} + ; + +align : {puts "*** ALIGN ***"} + ; + +analysis : {puts "*** ANALYSIS ***"} + ; + +array : {puts "*** ARRAY ***"} + ; + +asinh : {puts "*** ASINH ***"} + ; %% -#yyparse diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index 7eb3603..cf78a6b 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -187,8 +187,8 @@ source $ds9(root)/library/wcs.tcl source $ds9(root)/library/xmfbox.tcl source $ds9(root)/library/xmlrpc.tcl source $ds9(root)/library/xpa.tcl -#source $ds9(root)/library/lex.tcl -#source $ds9(root)/library/parser.tcl +source $ds9(root)/library/lex.tcl +source $ds9(root)/library/parser.tcl switch [tk windowingsystem] { x11 {} diff --git a/ds9/make.include b/ds9/make.include index 7692b2b..ff5930e 100644 --- a/ds9/make.include +++ b/ds9/make.include @@ -1,10 +1,10 @@ #--------------------------parser $(prefix)/ds9/library/lex.tcl : $(prefix)/ds9/library/lex.fcl - $(TCLSH_PROG) $(prefix)/fickle/fickle.tcl -v -i -o $@ $? + $(TCLSH_PROG) $(prefix)/fickle/fickle.tcl -o $@ $? $(prefix)/ds9/library/parser.tcl : $(prefix)/ds9/library/parser.tac - $(TCLSH_PROG) $(prefix)/taccle/taccle.tcl -d -v -w -o $@ $? + $(TCLSH_PROG) $(prefix)/taccle/taccle.tcl -d -o $@ $? #--------------------------framework |