HOPS
HOPS class reference
parser.h
Go to the documentation of this file.
1 #ifndef PARSER_H__
2 #define PARSER_H__
3 
4  /* Structure definitions for the FSM table */
5 
7  {
8  short current_state; /* small integer index for current state */
9  short token_type; /* category of current token */
10  short action; /* action to be performed for current state*/
11  short next_state; /* index of possible following state */
12  };
13 
14  /* Structure def. for tokenized input arrays */
15 
17  {
18  short symbol; /* small integer to represent which token it is */
19  short category; /* small integer to define type of token this is*/
20  int value; /* either null, an integer value for integer tokens,
21  or an index into float and char ptr arrays */
22  int line; /* control file line number that this token is in */
23  };
24 
25 
26 
27 
28  /* Definitions for tokens which represent the
29  original symbols in the input control file. */
30 
31 
32 #define STATION_ 1
33 #define BASELINE_ 2
34 #define SOURCE_ 3
35 #define SCAN_ 4
36 #define F_GROUP_ 5
37 #define IF_ 6
38 #define ELSE_ 7
39 #define AND_ 8
40 #define OR_ 9
41 #define NOT_ 10
42 #define LPAREN_ 11
43 #define RPAREN_ 12
44 #define LESS_THAN_ 13
45 #define GREATER_THAN_ 14
46 #define MIN_WEIGHT_ 15
47 #define X_CRC_ 16
48 #define Y_CRC_ 17
49 #define X_SLIP_SYNC_ 18
50 #define Y_SLIP_SYNC_ 19
51 #define FREQS_ 20
52 #define INDEX_ 21
53 #define PC_PHASE_ 22
54 #define PC_MODE_ 23
55 #define SB_WIN_ 24
56 #define MB_WIN_ 25
57 #define DR_WIN_ 26
58 #define SKIP_ 27
59 #define WILDCARD_ 28
60 #define INT_ 29
61 #define FLOAT_ 30
62 #define TIME_VAL_ 31
63 #define ONE_CHAR_ 32
64 #define TWO_CHAR_ 33
65 #define MANY_CHAR_ 34
66 #define START_ 35
67 #define STOP_ 36
68 #define KEEP_ 37
69 #define DISCARD_ 38
70 #define NORMAL_ 39
71 #define AP_BY_AP_ 40
72 #define MANUAL_ 41
73 #define SCAN_START_ 42
74 #define EACH_MINUTE_ 43
75 #define LSB_OFFSET_ 44
76 #define REF_FREQ_ 45
77 #define SWITCHED_ 46
78 #define PERIOD_ 47
79 #define GATES_ 48
80 #define TRUE_ 49
81 #define FALSE_ 50
82 #define RA_OFFSET_ 51
83 #define DEC_OFFSET_ 52
84 #define TO_ 53
85 #define ADHOC_PHASE_ 54
86 #define SINEWAVE_ 55
87 #define POLYNOMIAL_ 56
88 #define ADHOC_PERIOD_ 57
89 #define ADHOC_AMP_ 58
90 #define ADHOC_POLY_ 59
91 #define ADHOC_TREF_ 60
92 #define PC_FREQ_ 61
93 #define USE_SAMPLES_ 62
94 #define PASSBAND_ 63
95 #define T_COHERE_ 64
96 #define MULTITONE_ 65
97 #define IONOSPHERE_ 66
98 #define PC_PERIOD_ 67
99 #define PC_TONEMASK_ 68
100 #define DELAY_OFFS_ 69
101 #define DC_BLOCK_ 70
102 #define SAMPLERS_ 71
103 #define OPTIMIZE_CLOSURE_ 72
104 #define PC_PHASE_L_ 73
105 #define PC_PHASE_R_ 74
106 #define ION_WIN_ 75
107 #define ION_NPTS_ 76
108 #define INTERPOLATOR_ 77
109 #define ITERATE_ 78
110 #define SIMUL_ 79
111 #define STATION_DELAY_ 80
112 #define PC_DELAY_L_ 81
113 #define PC_DELAY_R_ 82
114 #define WEAK_CHANNEL_ 83
115 #define PC_AMP_HCODE_ 84
116 #define FMATCH_BW_PCT_ 85
117 #define FILE_ 86
118 #define ADHOC_FILE_ 87
119 #define ADHOC_FILE_CHANS_ 88
120 #define MBD_ANCHOR_ 89
121 #define MODEL_ 90
122 #define SBD_ 91
123 #define PC_PHASE_X_ 92
124 #define PC_PHASE_Y_ 93
125 #define PC_DELAY_X_ 94
126 #define PC_DELAY_Y_ 95
127 #define SAMPLER_DELAY_L_ 96
128 #define SAMPLER_DELAY_R_ 97
129 #define SAMPLER_DELAY_X_ 98
130 #define SAMPLER_DELAY_Y_ 99
131 #define ION_SMOOTH_ 100
132 #define DELAY_OFFS_L_ 101
133 #define DELAY_OFFS_R_ 102
134 #define DELAY_OFFS_X_ 103
135 #define DELAY_OFFS_Y_ 104
136 #define PC_PHASE_OFFSET_L_ 105
137 #define PC_PHASE_OFFSET_R_ 106
138 #define PC_PHASE_OFFSET_X_ 107
139 #define PC_PHASE_OFFSET_Y_ 108
140 #define NOTCHES_ 109
141 #define GEN_CF_RECORD_ 110
142 #define EST_PC_MANUAL_ 111
143 #define ADHOC_FLAG_FILE_ 112
144 #define PLOT_DATA_DIR_ 113
145 #define CHAN_IDS_ 114
146 #define VBP_CORRECT_ 115
147 #define VBP_FIT_ 116
148 #define VBP_COEFFS_ 117
149 #define VBP_FILE_ 118
150 #define AVXPZOOM_ 119
151 #define AVXPLOPT_ 120
152 #define MOUNT_TYPE_ 121
153 #define NO_MOUNT_TYPE_ 122
154 #define CASSEGRAIN_ 123
155 #define NASMYTHLEFT_ 124
156 #define NASMYTHRIGHT_ 125
157 #define MIXED_MODE_ROT_ 126
158 #define NOAUTOFRINGES_ 127
159 #define MOD4NUMBERING_ 128
160 #define POLFRINGNAMES_ 129
161 #define MBDRPLOPT_ 130
162 #define FRINGEOUT_DIR_ 131
163 #define FRQS_ 132
164 #define CLONE_IDS_ 133
165 #define CHAN_NOTCHES_ 134
166 #define CLONE_SNR_CHK_ 135
167 #define DISPLAY_CHANS_ 136
168  /* add new tokens at the bottom of the list */
169 #define MAX_TOKENS 137 /* increase to equal or exceed # tokens */
170 
171 
172  /* Definitions of token categories */
173 
174 #define INT_PARAM 1
175 #define FLOAT_PARAM 2
176 #define TWO_FLOAT_PARAM 3
177 #define VECTOR_INT_PARAM 4
178 #define VECTOR_FLOAT_PARAM 5
179 #define INTEGER 6
180 #define FLOAT 7
181 #define PARAMETER 8
182 #define IF 9
183 #define MATCH_ALL 10
184 #define ONE_CHAR 11
185 #define TWO_CHAR 12
186 #define MANY_CHAR 13
187 #define TIME_VAL 14
188 #define STATION 15
189 #define BASELINE 16
190 #define SOURCE 17
191 #define SCAN 18
192 #define F_GROUP 19
193 #define NOT 20
194 #define AND 21
195 #define CHAN_PARAM 22
196 #define VECTOR_CHAR_PARAM 23
197 #define OR 24
198 #define LESS_THAN 25
199 #define GREATER_THAN 26
200 #define TO 27
201 #define VECTOR_STRING_PARAM 28
202 #define STRING_PARAM 29
203 #define SAVE_CHAR_PARAM 30
204 #define INT_CONST 1048576
205 
206 
207  /* Definitions of various FSM states */
208 
209 #define BLOCK_INTERIOR 1
210 #define NEED_INT 2
211 #define NEED_FLOAT 3
212 #define NEED_TWO_FLOAT_1 4
213 #define NEED_TWO_FLOAT_2 5
214 #define NEED_VECTOR_INT 6
215 #define NEED_VECTOR_FLOAT 7
216 #define NEED_CONDITION 8
217 #define NEED_F_GROUP 9
218 #define END_STATE 10
219 #define NEED_STATION 11
220 #define NEED_SCAN 12
221 #define NEED_SOURCE 13
222 #define NEED_BASELINE 14
223 #define NEED_VECTOR_CHAR 15
224 #define NEED_CODES 16
225 #define NEED_OR 17
226 #define MAY_HAVE_TO 18
227 #define NEED_2ND_SCAN 19
228 #define NEED_VECTOR_STRING 20
229 #define NEED_VS_NUMBER 21
230 #define NEED_STRING 22
231 #define NEED_STRING_CHANS 23
232 #define MAX_STATES 25 /* Increase to equal or exceed # states */
233 
234  /* Definitions of FSM actions */
235 
236 #define NO_OP 1
237 #define SAVE_TOKEN_NUM 2
238 #define EOF_CLEANUP 3
239 #define INSERT_PAR 4
240 #define INSERT_V_PAR 5
241 #define POP_TOKEN 6
242 #define GEN_CBLOCKS 7
243 #define NEGATE 8
244 #define SAVE_FG 9
245 #define SAVE_STAT 10
246 #define SAVE_BASE 11
247 #define SAVE_SCAN 12
248 #define SAVE_SOURCE 13
249 #define CLEAR_CONDS 14
250 #define INSERT_V_CHAR 15
251 #define SAVE_CODES 16
252 #define CLEAR_FREQS 17
253 #define SAVE_2ND_SCAN 18
254 #define INSERT_STRING 19
255 #define SAVE_CSV_LIST 20
256 #define NEW_CODES 21
257 
258 #endif
int line
Definition: parser.h:22
int value
Definition: parser.h:20
short next_state
Definition: parser.h:11
short token_type
Definition: parser.h:9
short category
Definition: parser.h:19
short current_state
Definition: parser.h:8
short action
Definition: parser.h:10
short symbol
Definition: parser.h:18
Definition: parser.h:7
Definition: parser.h:17