2 CONSTRNT PATTERN FLOWP COM
3 QUOTE THAN FROM UNTIL ON
12 %token <integer> INTEGER
15 %token <string> STRING
20 %token <integer> GREATER
30 %token <integer> ROUTE
36 %token <integer> EQUIP
38 %token <integer> TRAVEL_TYPE
39 %token <integer> TIMESEP
45 %type <string> constrnt
47 %type <integer> string_array
48 %type <integer> int_array
49 %type <integer> int_pt
50 %type <integer> char_pt
51 %type <integer> string_pt
52 %type <integer> string_array_pt
53 %type <integer> char_array_pt
54 %type <integer> int_op
55 %type <integer> string_op
56 %type <integer> string_array_op
57 %type <integer> string_string_array_op
58 %type <integer> si_unit
66 | error ')' { yyerrok; yyclearin;}
69 rule: pttrn { if (!pattern($1)) printf("Error: %s\n", last_error()); }
70 | constrnt { if (!constraint($1)) printf("Error: %s\n", last_error()); }
71 | flowp { if (!flowpoint($1)) printf("Error: %s\n", last_error()); }
75 flowp: FLOWP STRING '(' flowp_entry ')' { $$ = $2; }
78 flowp_entry: pttrn_lbl ':' constrnt_lbl
81 pttrn_lbl: STRING { if (!pattern_id($1)) printf("Error: %s\n", last_error()); }
84 constrnt_lbl: STRING { if (!constraint_id($1)) printf("Error: %s\n", last_error()); }
87 constrnt: CONSTRNT STRING '(' cterm ')' { $$ = $2; }
90 cterm: TIMESEP AT string IS INTEGER si_unit
91 { intpt_string_int_cterm(PT_TIMESEP, $3, $5 * $6, 0, 0, 0); }
92 | TIMESEP AT string_array IS INTEGER si_unit
93 { intpt_stringarray_int_cterm(PT_TIMESEP, $3, $5 * $6, 0, 0, 0); }
94 | TIMESEP AT string IS INTEGER si_unit FROM INTEGER UNTIL INTEGER
95 { intpt_string_int_cterm(PT_TIMESEP, $3, $5 * $6, $8, $10, 0); }
96 | TIMESEP AT string_array IS INTEGER si_unit FROM INTEGER UNTIL INTEGER
97 { intpt_stringarray_int_cterm(PT_TIMESEP, $3, $5 * $6, $8, $10, 0); }
99 | TIMESEP AT string IS INTEGER si_unit AT FL int_array
100 { intpt_string_int_cterm(PT_TIMESEP, $3, $5 * $6, 0, 0, $9); }
101 | TIMESEP AT string_array IS INTEGER si_unit AT FL int_array
102 { intpt_stringarray_int_cterm(PT_TIMESEP, $3, $5 * $6, 0, 0, $9); }
103 | TIMESEP AT string IS INTEGER si_unit FROM INTEGER UNTIL INTEGER AT FL int_array
104 { intpt_string_int_cterm(PT_TIMESEP, $3, $5 * $6, $8, $10, $13); }
105 | TIMESEP AT string_array IS INTEGER si_unit FROM INTEGER UNTIL INTEGER AT FL int_array
106 { intpt_stringarray_int_cterm(PT_TIMESEP, $3, $5 * $6, $8, $10, $13); }
114 if (!strcmp($1, "s")) { $$ = 1; }
115 else if (!strcmp($1, "min")) { $$ = 60; }
119 pttrn: PATTERN STRING '(' term ')' { $$ = $2; }
120 | PATTERN '(' term ')' { $$ = get_pattern_id(); }
123 term: int_pt int_op INTEGER
124 { intpt_int_term($2, $1, $3); }
126 | char_pt string_op string
127 { charpt_char_term($2, $1, $3); }
129 | string_pt string_op string
130 { stringpt_string_term($2, $1, $3); }
132 | string_array_pt string_array_op string_array
133 { stringarraypt_stringarray_term($2, $1, $3); }
135 | string_array string_array_op string_array_pt
141 else if ($2 == OT_NOTIN_C)
145 stringarraypt_stringarray_term($2, $3, $1);
148 | string string_string_array_op string_array_pt
154 else if ($2 == OT_NOTIN_C)
158 stringarraypt_string_term($2, $3, $1);
161 | string string_string_array_op char_array_pt
167 else if ($2 == OT_NOTIN_C)
171 chararraypt_char_term($2, $3, $1);
184 int_op: IS { $$ = OT_IS; }
185 | IS NOT { $$ = OT_ISNOT; }
186 | GREATER THAN { $$ = OT_GREATER; }
187 | LESS THAN { $$ = OT_LESS; }
190 string_op: IS { $$ = OT_IS; }
191 | IS NOT { $$ = OT_ISNOT; }
194 string_array_op:IS { $$ = OT_IS; }
195 | IS NOT { $$ = OT_ISNOT; }
196 | IN { $$ = OT_IN_P; }
197 | NOT IN { $$ = OT_NOTIN_P; }
200 string_string_array_op: IN { $$ = OT_IN_P; }
201 | NOT IN { $$ = OT_NOTIN_P; }
204 int_array: '[' ints ']' { $$ = integer_array(); }
211 int: INTEGER { integer($1); $$ = $1; }
214 string_array: '[' strings ']' { $$ = string_array(); }
217 strings: | strings ',' string
221 int_pt: TAS { $$ = PT_TAS; }
224 char_pt: FTYP { $$ = PT_FTYP; }
226 string_pt: ADEP { $$ = PT_ADEP; }
227 | ADES { $$ = PT_ADES; }
228 | RWY { $$ = PT_RWY; }
229 | ATYP { $$ = PT_ATYP; }
230 | COPX { $$ = PT_COPX; }
231 | FRUL { $$ = PT_FRUL; }
232 | RFL { $$ = PT_RFL; }
233 | TRAVEL_TYPE { $$ = PT_TRAVEL_TYPE; }
236 string_array_pt:ROUTE { $$ = PT_ROUTE; }
239 char_array_pt: EQUIP { $$ = PT_EQUIP; }
242 string: QUOTE STRING QUOTE { string($2); $$ = $2; }