2136 /* ERROR_CHECK_BEGIN */ |
2137 /* ERROR_CHECK_BEGIN */ |
2137 | TIME interval |
2138 | TIME interval |
2138 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2139 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2139 | TIME '-' interval |
2140 | TIME '-' interval |
2140 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2141 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2141 | TIME '#' error |
2142 | TIME '#' erroneous_interval_token |
2142 {$$ = NULL; |
2143 {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yynerrs++;} |
2143 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for duration.");} |
2144 | T_SHARP erroneous_interval_token |
2144 else {print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yyclearin;} |
2145 {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yynerrs++;} |
2145 yyerrok; |
2146 | TIME '#' '-' erroneous_interval_token |
2146 } |
2147 {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yynerrs++;} |
2147 | T_SHARP error |
2148 | T_SHARP '-' erroneous_interval_token |
2148 {$$ = NULL; |
2149 {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yynerrs++;} |
2149 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for duration.");} |
2150 /* ERROR_CHECK_END */ |
2150 else {print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yyclearin;} |
2151 ; |
2151 yyerrok; |
2152 |
2152 } |
2153 fixed_point: |
2153 /* ERROR_CHECK_END */ |
2154 integer |
2154 ; |
2155 | fixed_point_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2155 |
2156 |
2156 |
2157 |
2157 interval: |
2158 interval: |
2158 days |
2159 days hours minutes seconds milliseconds end_interval_token |
2159 | hours |
2160 {$$ = new interval_c($1, $2, $3, $4, $5, locloc(@$));}; |
2160 | minutes |
2161 ; |
2161 | seconds |
2162 |
2162 | milliseconds |
2163 |
2163 ; |
2164 days: /* fixed_point ('d') */ |
2164 |
2165 /* empty */ {$$ = NULL;} |
2165 integer_d: integer_d_token {$$ = new integer_c($1, locloc(@$));}; |
2166 | fixed_point_d_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2166 integer_h: integer_h_token {$$ = new integer_c($1, locloc(@$));}; |
2167 | integer_d_token {$$ = new integer_c($1, locloc(@$));}; |
2167 integer_m: integer_m_token {$$ = new integer_c($1, locloc(@$));}; |
2168 ; |
2168 integer_s: integer_s_token {$$ = new integer_c($1, locloc(@$));}; |
2169 |
2169 integer_ms: integer_ms_token {$$ = new integer_c($1, locloc(@$));}; |
2170 hours: /* fixed_point ('h') */ |
2170 |
2171 /* empty */ {$$ = NULL;} |
2171 fixed_point_d: |
2172 | fixed_point_h_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2172 fixed_point_d_token |
2173 | integer_h_token {$$ = new integer_c($1, locloc(@$));}; |
2173 {$$ = new fixed_point_c($1, locloc(@$));} |
2174 ; |
2174 | integer_d |
2175 |
2175 ; |
2176 minutes: /* fixed_point ('m') */ |
2176 |
2177 /* empty */ {$$ = NULL;} |
2177 fixed_point_h: |
2178 | fixed_point_m_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2178 fixed_point_h_token |
2179 | integer_m_token {$$ = new integer_c($1, locloc(@$));}; |
2179 {$$ = new fixed_point_c($1, locloc(@$));} |
2180 ; |
2180 | integer_h |
2181 |
2181 ; |
2182 seconds: /* fixed_point ('s') */ |
2182 |
2183 /* empty */ {$$ = NULL;} |
2183 fixed_point_m: |
2184 | fixed_point_s_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2184 fixed_point_m_token |
2185 | integer_s_token {$$ = new integer_c($1, locloc(@$));}; |
2185 {$$ = new fixed_point_c($1, locloc(@$));} |
2186 ; |
2186 | integer_m |
2187 |
2187 ; |
2188 milliseconds: /* fixed_point ('ms') */ |
2188 |
2189 /* empty */ {$$ = NULL;} |
2189 fixed_point_s: |
2190 | fixed_point_ms_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2190 fixed_point_s_token |
2191 | integer_ms_token {$$ = new integer_c($1, locloc(@$));}; |
2191 {$$ = new fixed_point_c($1, locloc(@$));} |
|
2192 | integer_s |
|
2193 ; |
|
2194 |
|
2195 fixed_point_ms: |
|
2196 fixed_point_ms_token |
|
2197 {$$ = new fixed_point_c($1, locloc(@$));} |
|
2198 | integer_ms |
|
2199 ; |
|
2200 |
|
2201 |
|
2202 fixed_point: |
|
2203 fixed_point_token |
|
2204 {$$ = new fixed_point_c($1, locloc(@$));} |
|
2205 | integer |
|
2206 ; |
|
2207 |
|
2208 |
|
2209 days: |
|
2210 /* fixed_point ('d') */ |
|
2211 fixed_point_d |
|
2212 {$$ = new days_c($1, NULL, locloc(@$));} |
|
2213 /*| integer ('d') ['_'] hours */ |
|
2214 | integer_d hours |
|
2215 {$$ = new days_c($1, $2, locloc(@$));} |
|
2216 | integer_d '_' hours |
|
2217 {$$ = new days_c($1, $3, locloc(@$));} |
|
2218 /* ERROR_CHECK_BEGIN */ |
|
2219 | integer_d '_' error |
|
2220 {$$ = NULL; |
|
2221 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for hours in duration.");} |
|
2222 else {print_err_msg(locf(@3), locl(@3), "invalid value for hours in duration."); yyclearin;} |
|
2223 yyerrok; |
|
2224 } |
|
2225 /* ERROR_CHECK_END */ |
|
2226 ; |
|
2227 |
|
2228 |
|
2229 hours: |
|
2230 /* fixed_point ('h') */ |
|
2231 fixed_point_h |
|
2232 {$$ = new hours_c($1, NULL, locloc(@$));} |
|
2233 /*| integer ('h') ['_'] minutes */ |
|
2234 | integer_h minutes |
|
2235 {$$ = new hours_c($1, $2, locloc(@$));} |
|
2236 | integer_h '_' minutes |
|
2237 {$$ = new hours_c($1, $3, locloc(@$));} |
|
2238 /* ERROR_CHECK_BEGIN */ |
|
2239 | integer_h '_' error |
|
2240 {$$ = NULL; |
|
2241 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for minutes in duration.");} |
|
2242 else {print_err_msg(locf(@3), locl(@3), "invalid value for minutes in duration."); yyclearin;} |
|
2243 yyerrok; |
|
2244 } |
|
2245 /* ERROR_CHECK_END */ |
|
2246 |
|
2247 ; |
|
2248 |
|
2249 minutes: |
|
2250 /* fixed_point ('m') */ |
|
2251 fixed_point_m |
|
2252 {$$ = new minutes_c($1, NULL, locloc(@$));} |
|
2253 /*| integer ('m') ['_'] seconds */ |
|
2254 | integer_m seconds |
|
2255 {$$ = new minutes_c($1, $2, locloc(@$));} |
|
2256 | integer_m '_' seconds |
|
2257 {$$ = new minutes_c($1, $3, locloc(@$));} |
|
2258 /* ERROR_CHECK_BEGIN */ |
|
2259 | integer_m '_' error |
|
2260 {$$ = NULL; |
|
2261 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for seconds in duration.");} |
|
2262 else {print_err_msg(locf(@3), locl(@3), "invalid value for seconds in duration."); yyclearin;} |
|
2263 yyerrok; |
|
2264 } |
|
2265 /* ERROR_CHECK_END */ |
|
2266 ; |
|
2267 |
|
2268 seconds: |
|
2269 /* fixed_point ('s') */ |
|
2270 fixed_point_s |
|
2271 {$$ = new seconds_c($1, NULL, locloc(@$));} |
|
2272 /*| integer ('s') ['_'] milliseconds */ |
|
2273 | integer_s milliseconds |
|
2274 {$$ = new seconds_c($1, $2, locloc(@$));} |
|
2275 | integer_s '_' milliseconds |
|
2276 {$$ = new seconds_c($1, $3, locloc(@$));} |
|
2277 /* ERROR_CHECK_BEGIN */ |
|
2278 | integer_s '_' error |
|
2279 {$$ = NULL; |
|
2280 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for milliseconds in duration.");} |
|
2281 else {print_err_msg(locf(@3), locl(@3), "invalid value for milliseconds in duration."); yyclearin;} |
|
2282 yyerrok; |
|
2283 } |
|
2284 /* ERROR_CHECK_END */ |
|
2285 ; |
|
2286 |
|
2287 milliseconds: |
|
2288 /* fixed_point ('ms') */ |
|
2289 fixed_point_ms |
|
2290 {$$ = new milliseconds_c($1, locloc(@$));} |
|
2291 ; |
2192 ; |
2292 |
2193 |
2293 |
2194 |
2294 |
2195 |
2295 /************************************/ |
2196 /************************************/ |
2983 array_initial_elements_list: |
2884 array_initial_elements_list: |
2984 array_initial_elements |
2885 array_initial_elements |
2985 {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} |
2886 {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} |
2986 | array_initial_elements_list ',' array_initial_elements |
2887 | array_initial_elements_list ',' array_initial_elements |
2987 {$$ = $1; $$->add_element($3);} |
2888 {$$ = $1; $$->add_element($3);} |
2988 /* ERROR_CHECK_BEGIN |
2889 /* ERROR_CHECK_BEGIN */ |
|
2890 /* The following error checking rules have been commented out. Why? Was it a typo? |
|
2891 * Lets keep them commented out for now... |
|
2892 */ |
|
2893 /* |
2989 | array_initial_elements_list ',' error |
2894 | array_initial_elements_list ',' error |
2990 {$$ = $1; |
2895 {$$ = $1; |
2991 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");} |
2896 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");} |
2992 else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;} |
2897 else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;} |
2993 yyerrok; |
2898 yyerrok; |
2994 } |
2899 } |
|
2900 */ |
2995 /* ERROR_CHECK_END */ |
2901 /* ERROR_CHECK_END */ |
2996 ; |
2902 ; |
2997 |
2903 |
2998 |
2904 |
2999 array_initial_elements: |
2905 array_initial_elements: |
3143 structure_element_initialization_list: |
3049 structure_element_initialization_list: |
3144 structure_element_initialization |
3050 structure_element_initialization |
3145 {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} |
3051 {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} |
3146 | structure_element_initialization_list ',' structure_element_initialization |
3052 | structure_element_initialization_list ',' structure_element_initialization |
3147 {$$ = $1; $$->add_element($3);} |
3053 {$$ = $1; $$->add_element($3);} |
3148 /* ERROR_CHECK_BEGIN |
3054 /* ERROR_CHECK_BEGIN */ |
|
3055 /* The following error checking rules have been commented out. Why? Was it a typo? |
|
3056 * Lets keep them commented out for now... |
|
3057 */ |
|
3058 /* |
3149 | structure_element_initialization_list structure_element_initialization |
3059 | structure_element_initialization_list structure_element_initialization |
3150 {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;} |
3060 {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;} |
3151 | structure_element_initialization_list ',' error |
3061 | structure_element_initialization_list ',' error |
3152 {$$ = $1; |
3062 {$$ = $1; |
3153 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");} |
3063 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");} |
3154 else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;} |
3064 else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;} |
3155 yyerrok; |
3065 yyerrok; |
3156 } |
3066 } |
|
3067 */ |
3157 /* ERROR_CHECK_END */ |
3068 /* ERROR_CHECK_END */ |
3158 ; |
3069 ; |
3159 |
3070 |
3160 |
3071 |
3161 structure_element_initialization: |
3072 structure_element_initialization: |