blob: 413499becb537595775f0b8124b54b113280bc2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
%{
source $ds9(root)/library/panparser.tab.tcl
%}
%option noyywrap
%option caseless
%option nodefault
%option nointeractive
#%option stack
%option yylineno
#%option debug
D [0-9]
E [Ee][+-]?{D}+
%%
close {return $pan::CLOSE_}
open {return $pan::OPEN_}
to {return $pan::TO_}
wcs {return $pan::WCS_}
wcsa {return $pan::WCSA_}
wcsb {return $pan::WCSB_}
wcsc {return $pan::WCSC_}
wcsd {return $pan::WCSD_}
wcse {return $pan::WCSE_}
wcsf {return $pan::WCSF_}
wcsg {return $pan::WCSG_}
wcsh {return $pan::WCSH_}
wcsi {return $pan::WCSI_}
wcsj {return $pan::WCSJ_}
wcsk {return $pan::WCSK_}
wcsl {return $pan::WCSL_}
wcsm {return $pan::WCSM_}
wcsn {return $pan::WCSN_}
wcso {return $pan::WCSO_}
wcsp {return $pan::WCSP_}
wcsq {return $pan::WCSQ_}
wcsr {return $pan::WCSR_}
wcss {return $pan::WCSS_}
wcst {return $pan::WCST_}
wcsu {return $pan::WCSU_}
wcsv {return $pan::WCSV_}
wcsw {return $pan::WCSW_}
wcsx {return $pan::WCSX_}
wcsy {return $pan::WCSY_}
wcsz {return $pan::WCSZ_}
image {return $pan::IMAGE_}
physical {return $pan::PHYSICAL_}
amplifier {return $pan::AMPLIFIER_}
detector {return $pan::DETECTOR_}
fk4 {return $pan::FK4_}
b1950 {return $pan::FK4_}
fk5 {return $pan::FK5_}
j2000 {return $pan::FK5_}
galactic {return $pan::GALACTIC_}
ecliptic {return $pan::ECLIPTIC_}
# INT
[+-]?{D}+ {set pan::yylval $yytext; return $pan::INT_}
# REAL
[+-]?{D}+"."?({E})? |
[+-]?{D}*"."{D}+({E})? {set pan::yylval $yytext; return $pan::REAL_}
# SEXAGESIMAL
[+-]?{D}+:{D}+:{D}+"."? |
[+-]?{D}+:{D}+:{D}*"."{D}+ {set pan::yylval $yytext; return $pan::SEXSTR_}
# HMS
[+-]?{D}+h{D}+m{D}+"."?s |
[+-]?{D}+h{D}+m{D}*"."{D}+s {set pan::yylval $yytext; return $pan::HMSSTR_}
# DMS
[+-]?{D}+d{D}+m{D}+"."?s |
[+-]?{D}+d{D}+m{D}*"."{D}+s {set pan::yylval $yytext; return $pan::SMSSTR_}
# Quoted STRING
\"[^\"]*\" {set pan::yylval [string range $yytext 1 end-1]; return $pan::STRING_}
# Quoted STRING
\'[^\']*\' {set pan::yylval [string range $yytext 1 end-1]; return $pan::STRING_}
# Quoted STRING
\{[^\}]*\} {set pan::yylval [string range $yytext 1 end-1]; return $pan::STRING_}
# CMD
#-\S+\S+ {set pan::yylval $yytext; return $pan::CMD_}
# STRING
\S+\S+ {set pan::yylval $yytext; return $pan::STRING_}
\s # ignore whitespace
. {set pan::yylval $yytext; return $pan::yylval}
%%
|