%{ source $ds9(root)/library/parser.tab.tcl %} %option noyywrap %option caseless %option nodefault %option nointeractive %option stack %option yylineno %option debug %x FOO %s BAR D [0-9] E [Ee][+-]?{D}+ %% close {return $yy::CLOSE_} in {return $yy::IN_} fit {return $yy::FIT_} open {return $yy::OPEN_} out {return $yy::OUT_} to {return $yy::TO_} # INT [+-]?{D}+ {set yy::yylval $yytext; return $yy::INT_} # REAL [+-]?{D}+"."?({E})? | [+-]?{D}*"."{D}+({E})? {set yy::yylval $yytext; return $yy::REAL_} # Quoted STRING \"[^\"]*\" {set yy::yylval [string range $yytext 1 end-1]; return $yy::STRING_} # Quoted STRING \'[^\']*\' {set yy::yylval [string range $yytext 1 end-1]; return $yy::STRING_} # Quoted STRING \{[^\}]*\} {set yy::yylval [string range $yytext 1 end-1]; return $yy::STRING_} # STRING \S+\S+ {set yy::yylval $yytext; return $yy::STRING_} \s # ignore whitespace . {set yy::yylval $yytext; return $yy::yylval} %%