248 * declaring the typedef struct yyltype__local here would result in a |
256 * declaring the typedef struct yyltype__local here would result in a |
249 * compilation error when compiling iec.cc, as this struct would be |
257 * compilation error when compiling iec.cc, as this struct would be |
250 * declared twice. |
258 * declared twice. |
251 * We therefore use the #if !defined YYLTYPE ... |
259 * We therefore use the #if !defined YYLTYPE ... |
252 * to make sure only the first declaration is parsed by the C++ compiler. |
260 * to make sure only the first declaration is parsed by the C++ compiler. |
253 * |
|
254 * At first glance it seems that what we really should do is delcare the |
|
255 * YYLTYPE directly as an anonymous struct, thus: |
|
256 * #define YYLTYPE struct{ ...} |
|
257 * however, this also results in compilation errors. |
|
258 * |
|
259 * I (Mario) think this is kind of a hack. If you know how to |
|
260 * do this re-declaration of YYLTYPE properly, please let me know! |
|
261 */ |
261 */ |
262 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED |
262 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED |
263 typedef struct { |
263 typedef struct YYLTYPE { |
264 int first_line; |
264 int first_line; |
265 int first_column; |
265 int first_column; |
266 const char *first_file; |
266 const char *first_file; |
267 long int first_order; |
267 long int first_order; |
268 int last_line; |
268 int last_line; |
269 int last_column; |
269 int last_column; |
270 const char *last_file; |
270 const char *last_file; |
271 long int last_order; |
271 long int last_order; |
272 } yyltype__local; |
272 } YYLTYPE; |
273 #define YYLTYPE yyltype__local |
273 #define YYLTYPE_IS_DECLARED 1 |
|
274 #define YYLTYPE_IS_TRIVIAL 1 |
274 #endif |
275 #endif |
|
276 |
275 } |
277 } |
276 |
278 |
277 |
279 |
278 |
280 |
279 %union { |
281 %union { |
1913 ; |
1905 ; |
1914 |
1906 |
1915 |
1907 |
1916 integer_literal: |
1908 integer_literal: |
1917 integer_type_name '#' signed_integer |
1909 integer_type_name '#' signed_integer |
1918 {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} |
1910 {$$ = new integer_literal_c($1, $3, locloc(@$));} |
1919 | integer_type_name '#' binary_integer |
1911 | integer_type_name '#' binary_integer |
1920 {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} |
1912 {$$ = new integer_literal_c($1, $3, locloc(@$));} |
1921 | integer_type_name '#' octal_integer |
1913 | integer_type_name '#' octal_integer |
1922 {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} |
1914 {$$ = new integer_literal_c($1, $3, locloc(@$));} |
1923 | integer_type_name '#' hex_integer |
1915 | integer_type_name '#' hex_integer |
1924 {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} |
1916 {$$ = new integer_literal_c($1, $3, locloc(@$));} |
1925 /* NOTE: see note in the definition of constant for reason |
1917 /* NOTE: see note in the definition of constant for reason |
1926 * why signed_integer, binary_integer, octal_integer |
1918 * why signed_integer, binary_integer, octal_integer |
1927 * and hex_integer are missing here! |
1919 * and hex_integer are missing here! |
1928 */ |
1920 */ |
1929 /* ERROR_CHECK_BEGIN */ |
1921 /* ERROR_CHECK_BEGIN */ |
1979 |
1971 |
1980 |
1972 |
1981 |
1973 |
1982 bit_string_literal: |
1974 bit_string_literal: |
1983 bit_string_type_name '#' integer /* i.e. unsigned_integer */ |
1975 bit_string_type_name '#' integer /* i.e. unsigned_integer */ |
1984 {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} |
1976 {$$ = new bit_string_literal_c($1, $3, locloc(@$));} |
1985 | bit_string_type_name '#' binary_integer |
1977 | bit_string_type_name '#' binary_integer |
1986 {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} |
1978 {$$ = new bit_string_literal_c($1, $3, locloc(@$));} |
1987 | bit_string_type_name '#' octal_integer |
1979 | bit_string_type_name '#' octal_integer |
1988 {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} |
1980 {$$ = new bit_string_literal_c($1, $3, locloc(@$));} |
1989 | bit_string_type_name '#' hex_integer |
1981 | bit_string_type_name '#' hex_integer |
1990 {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} |
1982 {$$ = new bit_string_literal_c($1, $3, locloc(@$));} |
1991 /* NOTE: see note in the definition of constant for reason |
1983 /* NOTE: see note in the definition of constant for reason |
1992 * why unsigned_integer, binary_integer, octal_integer |
1984 * why unsigned_integer, binary_integer, octal_integer |
1993 * and hex_integer are missing here! |
1985 * and hex_integer are missing here! |
1994 */ |
1986 */ |
1995 /* NOTE: see note under the B 1.2.1 section of token |
1987 /* NOTE: see note under the B 1.2.1 section of token |
2142 /* ERROR_CHECK_BEGIN */ |
2134 /* ERROR_CHECK_BEGIN */ |
2143 | TIME interval |
2135 | TIME interval |
2144 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2136 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2145 | TIME '-' interval |
2137 | TIME '-' interval |
2146 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2138 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} |
2147 | TIME '#' error |
2139 | TIME '#' erroneous_interval_token |
2148 {$$ = NULL; |
2140 {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yynerrs++;} |
2149 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for duration.");} |
2141 | T_SHARP erroneous_interval_token |
2150 else {print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yyclearin;} |
2142 {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yynerrs++;} |
2151 yyerrok; |
2143 | TIME '#' '-' erroneous_interval_token |
2152 } |
2144 {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yynerrs++;} |
2153 | T_SHARP error |
2145 | T_SHARP '-' erroneous_interval_token |
2154 {$$ = NULL; |
2146 {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yynerrs++;} |
2155 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for duration.");} |
2147 /* ERROR_CHECK_END */ |
2156 else {print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yyclearin;} |
2148 ; |
2157 yyerrok; |
2149 |
2158 } |
2150 fixed_point: |
2159 /* ERROR_CHECK_END */ |
2151 integer |
2160 ; |
2152 | fixed_point_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2161 |
2153 |
2162 |
2154 |
2163 interval: |
2155 interval: |
2164 days |
2156 days hours minutes seconds milliseconds end_interval_token |
2165 | hours |
2157 {$$ = new interval_c($1, $2, $3, $4, $5, locloc(@$));}; |
2166 | minutes |
2158 ; |
2167 | seconds |
2159 |
2168 | milliseconds |
2160 |
2169 ; |
2161 days: /* fixed_point ('d') */ |
2170 |
2162 /* empty */ {$$ = NULL;} |
2171 integer_d: integer_d_token {$$ = new integer_c($1, locloc(@$));}; |
2163 | fixed_point_d_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2172 integer_h: integer_h_token {$$ = new integer_c($1, locloc(@$));}; |
2164 | integer_d_token {$$ = new integer_c($1, locloc(@$));}; |
2173 integer_m: integer_m_token {$$ = new integer_c($1, locloc(@$));}; |
2165 ; |
2174 integer_s: integer_s_token {$$ = new integer_c($1, locloc(@$));}; |
2166 |
2175 integer_ms: integer_ms_token {$$ = new integer_c($1, locloc(@$));}; |
2167 hours: /* fixed_point ('h') */ |
2176 |
2168 /* empty */ {$$ = NULL;} |
2177 fixed_point_d: |
2169 | fixed_point_h_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2178 fixed_point_d_token |
2170 | integer_h_token {$$ = new integer_c($1, locloc(@$));}; |
2179 {$$ = new fixed_point_c($1, locloc(@$));} |
2171 ; |
2180 | integer_d |
2172 |
2181 ; |
2173 minutes: /* fixed_point ('m') */ |
2182 |
2174 /* empty */ {$$ = NULL;} |
2183 fixed_point_h: |
2175 | fixed_point_m_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2184 fixed_point_h_token |
2176 | integer_m_token {$$ = new integer_c($1, locloc(@$));}; |
2185 {$$ = new fixed_point_c($1, locloc(@$));} |
2177 ; |
2186 | integer_h |
2178 |
2187 ; |
2179 seconds: /* fixed_point ('s') */ |
2188 |
2180 /* empty */ {$$ = NULL;} |
2189 fixed_point_m: |
2181 | fixed_point_s_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2190 fixed_point_m_token |
2182 | integer_s_token {$$ = new integer_c($1, locloc(@$));}; |
2191 {$$ = new fixed_point_c($1, locloc(@$));} |
2183 ; |
2192 | integer_m |
2184 |
2193 ; |
2185 milliseconds: /* fixed_point ('ms') */ |
2194 |
2186 /* empty */ {$$ = NULL;} |
2195 fixed_point_s: |
2187 | fixed_point_ms_token {$$ = new fixed_point_c($1, locloc(@$));}; |
2196 fixed_point_s_token |
2188 | integer_ms_token {$$ = new integer_c($1, locloc(@$));}; |
2197 {$$ = new fixed_point_c($1, locloc(@$));} |
|
2198 | integer_s |
|
2199 ; |
|
2200 |
|
2201 fixed_point_ms: |
|
2202 fixed_point_ms_token |
|
2203 {$$ = new fixed_point_c($1, locloc(@$));} |
|
2204 | integer_ms |
|
2205 ; |
|
2206 |
|
2207 |
|
2208 fixed_point: |
|
2209 fixed_point_token |
|
2210 {$$ = new fixed_point_c($1, locloc(@$));} |
|
2211 | integer |
|
2212 ; |
|
2213 |
|
2214 |
|
2215 days: |
|
2216 /* fixed_point ('d') */ |
|
2217 fixed_point_d |
|
2218 {$$ = new days_c($1, NULL, locloc(@$));} |
|
2219 /*| integer ('d') ['_'] hours */ |
|
2220 | integer_d hours |
|
2221 {$$ = new days_c($1, $2, locloc(@$));} |
|
2222 | integer_d '_' hours |
|
2223 {$$ = new days_c($1, $3, locloc(@$));} |
|
2224 /* ERROR_CHECK_BEGIN */ |
|
2225 | integer_d '_' error |
|
2226 {$$ = NULL; |
|
2227 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for hours in duration.");} |
|
2228 else {print_err_msg(locf(@3), locl(@3), "invalid value for hours in duration."); yyclearin;} |
|
2229 yyerrok; |
|
2230 } |
|
2231 /* ERROR_CHECK_END */ |
|
2232 ; |
|
2233 |
|
2234 |
|
2235 hours: |
|
2236 /* fixed_point ('h') */ |
|
2237 fixed_point_h |
|
2238 {$$ = new hours_c($1, NULL, locloc(@$));} |
|
2239 /*| integer ('h') ['_'] minutes */ |
|
2240 | integer_h minutes |
|
2241 {$$ = new hours_c($1, $2, locloc(@$));} |
|
2242 | integer_h '_' minutes |
|
2243 {$$ = new hours_c($1, $3, locloc(@$));} |
|
2244 /* ERROR_CHECK_BEGIN */ |
|
2245 | integer_h '_' error |
|
2246 {$$ = NULL; |
|
2247 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for minutes in duration.");} |
|
2248 else {print_err_msg(locf(@3), locl(@3), "invalid value for minutes in duration."); yyclearin;} |
|
2249 yyerrok; |
|
2250 } |
|
2251 /* ERROR_CHECK_END */ |
|
2252 |
|
2253 ; |
|
2254 |
|
2255 minutes: |
|
2256 /* fixed_point ('m') */ |
|
2257 fixed_point_m |
|
2258 {$$ = new minutes_c($1, NULL, locloc(@$));} |
|
2259 /*| integer ('m') ['_'] seconds */ |
|
2260 | integer_m seconds |
|
2261 {$$ = new minutes_c($1, $2, locloc(@$));} |
|
2262 | integer_m '_' seconds |
|
2263 {$$ = new minutes_c($1, $3, locloc(@$));} |
|
2264 /* ERROR_CHECK_BEGIN */ |
|
2265 | integer_m '_' error |
|
2266 {$$ = NULL; |
|
2267 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for seconds in duration.");} |
|
2268 else {print_err_msg(locf(@3), locl(@3), "invalid value for seconds in duration."); yyclearin;} |
|
2269 yyerrok; |
|
2270 } |
|
2271 /* ERROR_CHECK_END */ |
|
2272 ; |
|
2273 |
|
2274 seconds: |
|
2275 /* fixed_point ('s') */ |
|
2276 fixed_point_s |
|
2277 {$$ = new seconds_c($1, NULL, locloc(@$));} |
|
2278 /*| integer ('s') ['_'] milliseconds */ |
|
2279 | integer_s milliseconds |
|
2280 {$$ = new seconds_c($1, $2, locloc(@$));} |
|
2281 | integer_s '_' milliseconds |
|
2282 {$$ = new seconds_c($1, $3, locloc(@$));} |
|
2283 /* ERROR_CHECK_BEGIN */ |
|
2284 | integer_s '_' error |
|
2285 {$$ = NULL; |
|
2286 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for milliseconds in duration.");} |
|
2287 else {print_err_msg(locf(@3), locl(@3), "invalid value for milliseconds in duration."); yyclearin;} |
|
2288 yyerrok; |
|
2289 } |
|
2290 /* ERROR_CHECK_END */ |
|
2291 ; |
|
2292 |
|
2293 milliseconds: |
|
2294 /* fixed_point ('ms') */ |
|
2295 fixed_point_ms |
|
2296 {$$ = new milliseconds_c($1, locloc(@$));} |
|
2297 ; |
2189 ; |
2298 |
2190 |
2299 |
2191 |
2300 |
2192 |
2301 /************************************/ |
2193 /************************************/ |
2989 array_initial_elements_list: |
2881 array_initial_elements_list: |
2990 array_initial_elements |
2882 array_initial_elements |
2991 {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} |
2883 {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} |
2992 | array_initial_elements_list ',' array_initial_elements |
2884 | array_initial_elements_list ',' array_initial_elements |
2993 {$$ = $1; $$->add_element($3);} |
2885 {$$ = $1; $$->add_element($3);} |
2994 /* ERROR_CHECK_BEGIN |
2886 /* ERROR_CHECK_BEGIN */ |
|
2887 /* The following error checking rules have been commented out. Why? Was it a typo? |
|
2888 * Lets keep them commented out for now... |
|
2889 */ |
|
2890 /* |
2995 | array_initial_elements_list ',' error |
2891 | array_initial_elements_list ',' error |
2996 {$$ = $1; |
2892 {$$ = $1; |
2997 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");} |
2893 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");} |
2998 else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;} |
2894 else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;} |
2999 yyerrok; |
2895 yyerrok; |
3000 } |
2896 } |
|
2897 */ |
3001 /* ERROR_CHECK_END */ |
2898 /* ERROR_CHECK_END */ |
3002 ; |
2899 ; |
3003 |
2900 |
3004 |
2901 |
3005 array_initial_elements: |
2902 array_initial_elements: |
3149 structure_element_initialization_list: |
3046 structure_element_initialization_list: |
3150 structure_element_initialization |
3047 structure_element_initialization |
3151 {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} |
3048 {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} |
3152 | structure_element_initialization_list ',' structure_element_initialization |
3049 | structure_element_initialization_list ',' structure_element_initialization |
3153 {$$ = $1; $$->add_element($3);} |
3050 {$$ = $1; $$->add_element($3);} |
3154 /* ERROR_CHECK_BEGIN |
3051 /* ERROR_CHECK_BEGIN */ |
|
3052 /* The following error checking rules have been commented out. Why? Was it a typo? |
|
3053 * Lets keep them commented out for now... |
|
3054 */ |
|
3055 /* |
3155 | structure_element_initialization_list structure_element_initialization |
3056 | structure_element_initialization_list structure_element_initialization |
3156 {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;} |
3057 {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;} |
3157 | structure_element_initialization_list ',' error |
3058 | structure_element_initialization_list ',' error |
3158 {$$ = $1; |
3059 {$$ = $1; |
3159 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");} |
3060 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");} |
3160 else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;} |
3061 else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;} |
3161 yyerrok; |
3062 yyerrok; |
3162 } |
3063 } |
|
3064 */ |
3163 /* ERROR_CHECK_END */ |
3065 /* ERROR_CHECK_END */ |
3164 ; |
3066 ; |
3165 |
3067 |
3166 |
3068 |
3167 structure_element_initialization: |
3069 structure_element_initialization: |
5357 | SD {$$ = new timed_qualifier_c(strdup("SD"), locloc(@$));} |
5263 | SD {$$ = new timed_qualifier_c(strdup("SD"), locloc(@$));} |
5358 | DS {$$ = new timed_qualifier_c(strdup("DS"), locloc(@$));} |
5264 | DS {$$ = new timed_qualifier_c(strdup("DS"), locloc(@$));} |
5359 | SL {$$ = new timed_qualifier_c(strdup("SL"), locloc(@$));} |
5265 | SL {$$ = new timed_qualifier_c(strdup("SL"), locloc(@$));} |
5360 ; |
5266 ; |
5361 |
5267 |
|
5268 /* NOTE: A step_name may be used as a structured vaqriable, in order to access the status bit (e.g. Step1.X) |
|
5269 * or the time it has been active (e.g. Step1.T). |
|
5270 * In order to allow the step name to be used as a variable inside ST expressions (only ST expressions ??) |
|
5271 * when defining transitions, we need to add the step_name to the list of previously declared variables. |
|
5272 * This allows the step name to be used as a variable inside all transition expressions, as the user |
|
5273 * can clearly define the transition _after_ the step itself has been defined/declared, so the |
|
5274 * 'variable' is previously 'declared'. |
|
5275 * |
|
5276 * However, when defining/declaring a step, a variable name can also be used to define a timed |
|
5277 * action association. In this case, we may have a circular reference: |
|
5278 * e.g. |
|
5279 * ... |
|
5280 * STEP step1: |
|
5281 * action1 (D,t#100ms); |
|
5282 * end_step |
|
5283 * |
|
5284 * STEP step2: |
|
5285 * action1 (D,step3.T); <---- forward reference to step3.T !!!!!! |
|
5286 * end_step |
|
5287 * |
|
5288 * STEP step3: |
|
5289 * action1 (D,step2.T); <---- back reference to step2.T |
|
5290 * end_step |
|
5291 * |
|
5292 * |
|
5293 * There is no way the user can always use the step3.T variable only after it has |
|
5294 * been 'declared'. So adding the steps to the list of previously declared variables |
|
5295 * when the steps are declared is not a solution to the above situation. |
|
5296 * |
|
5297 * Fortunately, the standard does not allow ST expressions in the above syntax |
|
5298 * (i.e. when defining the delay of a timed actions), but only either a |
|
5299 * Time literal, or a variable. |
|
5300 * This is why we change the definition of action_time from |
|
5301 * action_time: |
|
5302 * duration |
|
5303 * | variable |
|
5304 * ; |
|
5305 * |
|
5306 * to: |
|
5307 * action_time: |
|
5308 * duration |
|
5309 * | any_symbolic_variable |
|
5310 * ; |
|
5311 * |
|
5312 * NOTE that this same problem does not occur with the 'indicator_name': it does not |
|
5313 * make sense to set/indicate a step1.X variable, as these variables are read-only! |
|
5314 */ |
|
5315 |
5362 action_time: |
5316 action_time: |
5363 duration |
5317 duration |
5364 | variable |
5318 //| variable |
|
5319 | any_symbolic_variable |
5365 ; |
5320 ; |
5366 |
5321 |
5367 indicator_name: variable; |
5322 indicator_name: variable; |
5368 |
5323 |
5369 // transition_name: identifier; |
5324 // transition_name: identifier; |
6291 |
6249 |
6292 instruction_list: |
6250 instruction_list: |
6293 il_instruction |
6251 il_instruction |
6294 {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} |
6252 {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} |
6295 | any_pragma eol_list |
6253 | any_pragma eol_list |
6296 {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} |
6254 {$$ = new instruction_list_c(locloc(@1)); $$->add_element($1);} /* locloc(@1) is not a bug! We ignore trailing EOLs when determining symbol location! */ |
6297 | instruction_list il_instruction |
6255 | instruction_list il_instruction |
6298 {$$ = $1; $$->add_element($2);} |
6256 {$$ = $1; $$->add_element($2);} |
6299 | instruction_list any_pragma |
6257 | instruction_list any_pragma |
6300 {$$ = $1; $$->add_element($2);} |
6258 {$$ = $1; $$->add_element($2);} |
6301 ; |
6259 ; |
6302 |
6260 |
6303 |
6261 |
6304 |
6262 |
6305 il_instruction: |
6263 il_instruction: |
6306 il_incomplete_instruction eol_list |
6264 il_incomplete_instruction eol_list |
6307 {$$ = new il_instruction_c(NULL, $1, locloc(@$));} |
6265 {$$ = new il_instruction_c(NULL, $1, locloc(@1));} /* locloc(@1) is not a bug! We ignore trailing EOLs when determining symbol location! */ |
6308 | label ':' il_incomplete_instruction eol_list |
6266 | label ':' il_incomplete_instruction eol_list |
6309 {$$ = new il_instruction_c($1, $3, locloc(@$));} |
6267 {$$ = new il_instruction_c($1, $3, locf(@1), locl(@3));} /* locf(@1), locl(@3) is not a bug! We ignore trailing EOLs when determining symbol location! */ |
6310 | label ':' eol_list |
6268 | label ':' eol_list |
6311 {$$ = new il_instruction_c($1, NULL, locloc(@$));} |
6269 {$$ = new il_instruction_c($1, NULL, locf(@1), locl(@2));} /* locf(@1), locl(@2) is not a bug! We ignore trailing EOLs when determining symbol location! */ |
6312 /* ERROR_CHECK_BEGIN */ |
6270 /* ERROR_CHECK_BEGIN */ |
6313 | error eol_list |
6271 | error eol_list |
6314 {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid IL instruction."); yyerrok;} |
6272 {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid IL instruction."); yyerrok;} |
6315 | il_incomplete_instruction error |
6273 | il_incomplete_instruction error |
6316 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of IL instruction."); yyerrok;} |
6274 {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of IL instruction."); yyerrok;} |
8060 if (first_filename == NULL) first_filename = unknown_file; |
8021 if (first_filename == NULL) first_filename = unknown_file; |
8061 if ( last_filename == NULL) last_filename = unknown_file; |
8022 if ( last_filename == NULL) last_filename = unknown_file; |
8062 |
8023 |
8063 if (full_token_loc) { |
8024 if (full_token_loc) { |
8064 if (first_filename == last_filename) |
8025 if (first_filename == last_filename) |
8065 fprintf(stderr, "%s:%d-%d..%d-%d: error : %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg); |
8026 fprintf(stderr, "%s:%d-%d..%d-%d: error: %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg); |
8066 else |
8027 else |
8067 fprintf(stderr, "%s:%d-%d..%s:%d-%d: error : %s\n", first_filename, first_line, first_column, last_filename, last_line, last_column, additional_error_msg); |
8028 fprintf(stderr, "%s:%d-%d..%s:%d-%d: error: %s\n", first_filename, first_line, first_column, last_filename, last_line, last_column, additional_error_msg); |
8068 } else { |
8029 } else { |
8069 fprintf(stderr, "%s:%d: error : %s\n", first_filename, first_line, additional_error_msg); |
8030 fprintf(stderr, "%s:%d: error: %s\n", first_filename, first_line, additional_error_msg); |
8070 } |
8031 } |
8071 //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg); |
8032 //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg); |
8072 print_include_stack(); |
8033 print_include_stack(); |
8073 //fprintf(stderr, "%s(%d-%d): %s\n", current_filename, first_line, last_line, current_error_msg); |
8034 //fprintf(stderr, "%s(%d-%d): %s\n", current_filename, first_line, last_line, current_error_msg); |
8074 } |
8035 } |