1680 {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} |
1678 {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} |
1681 /* NOTE: see note in the definition of constant for reason |
1679 /* NOTE: see note in the definition of constant for reason |
1682 * why signed_integer, binary_integer, octal_integer |
1680 * why signed_integer, binary_integer, octal_integer |
1683 * and hex_integer are missing here! |
1681 * and hex_integer are missing here! |
1684 */ |
1682 */ |
|
1683 /* ERROR_CHECK_BEGIN */ |
|
1684 | integer_type_name signed_integer |
|
1685 {$$ = NULL; |
|
1686 yynerrs++; |
|
1687 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal."); |
|
1688 } |
|
1689 | integer_type_name binary_integer |
|
1690 {$$ = NULL; |
|
1691 yynerrs++; |
|
1692 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal."); |
|
1693 } |
|
1694 | integer_type_name octal_integer |
|
1695 {$$ = NULL; |
|
1696 yynerrs++; |
|
1697 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal."); |
|
1698 } |
|
1699 | integer_type_name hex_integer |
|
1700 {$$ = NULL; |
|
1701 yynerrs++; |
|
1702 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between integer type name and value in integer literal."); |
|
1703 } |
|
1704 | integer_type_name error signed_integer |
|
1705 {$$ = NULL; |
|
1706 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal."); |
|
1707 yyerrok; |
|
1708 } |
|
1709 | integer_type_name error binary_integer |
|
1710 {$$ = NULL; |
|
1711 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal."); |
|
1712 yyerrok; |
|
1713 } |
|
1714 | integer_type_name error octal_integer |
|
1715 {$$ = NULL; |
|
1716 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal."); |
|
1717 yyerrok; |
|
1718 } |
|
1719 | integer_type_name error hex_integer |
|
1720 {$$ = NULL; |
|
1721 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between integer type name and value in integer literal."); |
|
1722 yyerrok; |
|
1723 } |
|
1724 | integer_type_name '#' error |
|
1725 {$$ = NULL; |
|
1726 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for integer literal."); |
|
1727 yyerrok; |
|
1728 } |
|
1729 /* ERROR_CHECK_END */ |
1685 ; |
1730 ; |
1686 |
1731 |
1687 signed_integer: |
1732 signed_integer: |
1688 integer |
1733 integer |
1689 | '+' integer {$$ = $2;} |
1734 | '+' integer {$$ = $2;} |
1742 /* NOTE: see note under the B 1.2.1 section of token |
1804 /* NOTE: see note under the B 1.2.1 section of token |
1743 * and grouping type definition for reason why the use of |
1805 * and grouping type definition for reason why the use of |
1744 * bit_string_type_name, although seemingly incorrect, is |
1806 * bit_string_type_name, although seemingly incorrect, is |
1745 * really correct here! |
1807 * really correct here! |
1746 */ |
1808 */ |
|
1809 /* ERROR_CHECK_BEGIN */ |
|
1810 | bit_string_type_name integer |
|
1811 {$$ = NULL; |
|
1812 yynerrs++; |
|
1813 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal."); |
|
1814 } |
|
1815 | bit_string_type_name binary_integer |
|
1816 {$$ = NULL; |
|
1817 yynerrs++; |
|
1818 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal."); |
|
1819 } |
|
1820 | bit_string_type_name octal_integer |
|
1821 {$$ = NULL; |
|
1822 yynerrs++; |
|
1823 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal."); |
|
1824 } |
|
1825 | bit_string_type_name hex_integer |
|
1826 {$$ = NULL; |
|
1827 yynerrs++; |
|
1828 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between bit string type name and value in bit string literal."); |
|
1829 } |
|
1830 | bit_string_type_name error integer |
|
1831 {$$ = NULL; |
|
1832 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal."); |
|
1833 yyerrok; |
|
1834 } |
|
1835 | bit_string_type_name error binary_integer |
|
1836 {$$ = NULL; |
|
1837 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal."); |
|
1838 yyerrok; |
|
1839 } |
|
1840 | bit_string_type_name error octal_integer |
|
1841 {$$ = NULL; |
|
1842 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal."); |
|
1843 yyerrok; |
|
1844 } |
|
1845 | bit_string_type_name error hex_integer |
|
1846 {$$ = NULL; |
|
1847 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between bit string type name and value in bit string literal."); |
|
1848 yyerrok; |
|
1849 } |
|
1850 | bit_string_type_name '#' error |
|
1851 {$$ = NULL; |
|
1852 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for bit string literal."); |
|
1853 yyerrok; |
|
1854 } |
|
1855 /* ERROR_CHECK_END */ |
1747 ; |
1856 ; |
1748 |
1857 |
1749 |
1858 |
1750 boolean_literal: |
1859 boolean_literal: |
1751 TRUE {$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)), |
1860 TRUE {$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)), |
1954 /* B 1.2.3.2 - Time of day and Date */ |
2124 /* B 1.2.3.2 - Time of day and Date */ |
1955 /************************************/ |
2125 /************************************/ |
1956 time_of_day: |
2126 time_of_day: |
1957 TIME_OF_DAY '#' daytime |
2127 TIME_OF_DAY '#' daytime |
1958 {$$ = new time_of_day_c($3, locloc(@$));} |
2128 {$$ = new time_of_day_c($3, locloc(@$));} |
|
2129 /* ERROR_CHECK_BEGIN */ |
|
2130 | TIME_OF_DAY daytime |
|
2131 {$$ = NULL; |
|
2132 yynerrs++; |
|
2133 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'TIME_OF_DAY' and daytime in time of day."); |
|
2134 } |
|
2135 | TIME_OF_DAY error daytime |
|
2136 {$$ = NULL; |
|
2137 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'TIME_OF_DAY' and daytime in time of day."); |
|
2138 yyerrok; |
|
2139 } |
|
2140 | TIME_OF_DAY '#' error |
|
2141 {$$ = NULL; |
|
2142 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for time of day."); |
|
2143 yyerrok; |
|
2144 } |
|
2145 /* ERROR_CHECK_END */ |
1959 ; |
2146 ; |
1960 |
2147 |
1961 |
2148 |
1962 daytime: |
2149 daytime: |
1963 day_hour ':' day_minute ':' day_second |
2150 day_hour ':' day_minute ':' day_second |
1964 {$$ = new daytime_c($1, $3, $5, locloc(@$));} |
2151 {$$ = new daytime_c($1, $3, $5, locloc(@$));} |
|
2152 /* ERROR_CHECK_BEGIN */ |
|
2153 | day_hour day_minute ':' day_second |
|
2154 {$$ = NULL; |
|
2155 yynerrs++; |
|
2156 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between hours and minutes in daytime."); |
|
2157 } |
|
2158 | day_hour error day_minute ':' day_second |
|
2159 {$$ = NULL; |
|
2160 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ':' between hours and minutes in daytime."); |
|
2161 yyerrok; |
|
2162 } |
|
2163 | day_hour ':' ':' day_second |
|
2164 {$$ = NULL; |
|
2165 yynerrs++; |
|
2166 print_err_msg(current_filename, locf(@2), locl(@3), "no minutes defined in daytime."); |
|
2167 } |
|
2168 | day_hour ':' error ':' day_second |
|
2169 {$$ = NULL; |
|
2170 print_err_msg(current_filename, locf(@2), locl(@4), "invalid value for minutes in daytime."); |
|
2171 yyerrok; |
|
2172 } |
|
2173 | day_hour ':' day_minute day_second |
|
2174 {$$ = NULL; |
|
2175 yynerrs++; |
|
2176 print_err_msg(current_filename, locf(@3), locl(@4), "':' missing between minutes and seconds in daytime."); |
|
2177 } |
|
2178 | day_hour ':' day_minute error day_second |
|
2179 {$$ = NULL; |
|
2180 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ':' between minutes and seconds in daytime."); |
|
2181 yyerrok; |
|
2182 } |
|
2183 | day_hour ':' day_minute ':' error |
|
2184 {$$ = NULL; |
|
2185 print_err_msg(current_filename, locf(@4), locl(@4), "invalid value for seconds in daytime."); |
|
2186 yyerrok; |
|
2187 } |
|
2188 /* ERROR_CHECK_END */ |
1965 ; |
2189 ; |
1966 |
2190 |
1967 |
2191 |
1968 day_hour: integer; |
2192 day_hour: integer; |
1969 day_minute: integer; |
2193 day_minute: integer; |
1973 date: |
2197 date: |
1974 DATE '#' date_literal |
2198 DATE '#' date_literal |
1975 {$$ = new date_c($3, locloc(@$));} |
2199 {$$ = new date_c($3, locloc(@$));} |
1976 | D_SHARP date_literal |
2200 | D_SHARP date_literal |
1977 {$$ = new date_c($2, locloc(@$));} |
2201 {$$ = new date_c($2, locloc(@$));} |
|
2202 /* ERROR_CHECK_BEGIN */ |
|
2203 | DATE date_literal |
|
2204 {$$ = NULL; |
|
2205 yynerrs++; |
|
2206 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between 'DATE' and date literal in date."); |
|
2207 } |
|
2208 | DATE error date_literal |
|
2209 {$$ = NULL; |
|
2210 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between 'DATE' and date literal in date."); |
|
2211 yyerrok; |
|
2212 } |
|
2213 | DATE '#' error |
|
2214 {$$ = NULL; |
|
2215 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for date."); |
|
2216 yyerrok; |
|
2217 } |
|
2218 | D_SHARP error |
|
2219 {$$ = NULL; |
|
2220 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for date."); |
|
2221 yyerrok; |
|
2222 } |
|
2223 /* ERROR_CHECK_END */ |
1978 ; |
2224 ; |
1979 |
2225 |
1980 |
2226 |
1981 date_literal: |
2227 date_literal: |
1982 year '-' month '-' day |
2228 year '-' month '-' day |
1983 {$$ = new date_literal_c($1, $3, $5, locloc(@$));} |
2229 {$$ = new date_literal_c($1, $3, $5, locloc(@$));} |
|
2230 /* ERROR_CHECK_BEGIN */ |
|
2231 | year month '-' day |
|
2232 {$$ = NULL; |
|
2233 yynerrs++; |
|
2234 print_err_msg(current_filename, locf(@1), locl(@2), "'-' missing between year and month in date literal."); |
|
2235 } |
|
2236 | year error month '-' day |
|
2237 {$$ = NULL; |
|
2238 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '-' between year and month in date literal."); |
|
2239 yyerrok; |
|
2240 } |
|
2241 | year '-' '-' day |
|
2242 {$$ = NULL; |
|
2243 yynerrs++; |
|
2244 print_err_msg(current_filename, locf(@2), locl(@3), "no month defined in date literal."); |
|
2245 } |
|
2246 | year '-' error '-' day |
|
2247 {$$ = NULL; |
|
2248 print_err_msg(current_filename, locf(@2), locl(@4), "invalid value for month in date literal."); |
|
2249 yyerrok; |
|
2250 } |
|
2251 | year '-' month day |
|
2252 {$$ = NULL; |
|
2253 yynerrs++; |
|
2254 print_err_msg(current_filename, locf(@3), locl(@4), "':' missing between month and day in date literal."); |
|
2255 } |
|
2256 | year ':' month error day |
|
2257 {$$ = NULL; |
|
2258 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ':' between month and day in date literal."); |
|
2259 yyerrok; |
|
2260 } |
|
2261 | year ':' month ':' error |
|
2262 {$$ = NULL; |
|
2263 print_err_msg(current_filename, locf(@4), locl(@4), "invalid value for day in date literal."); |
|
2264 yyerrok; |
|
2265 } |
|
2266 /* ERROR_CHECK_END */ |
1984 ; |
2267 ; |
1985 |
2268 |
1986 |
2269 |
1987 year: integer; |
2270 year: integer; |
1988 month: integer; |
2271 month: integer; |
2153 */ |
2473 */ |
2154 |
2474 |
2155 data_type_declaration: |
2475 data_type_declaration: |
2156 TYPE type_declaration_list END_TYPE |
2476 TYPE type_declaration_list END_TYPE |
2157 {$$ = new data_type_declaration_c($2, locloc(@$));} |
2477 {$$ = new data_type_declaration_c($2, locloc(@$));} |
|
2478 /* ERROR_CHECK_BEGIN */ |
|
2479 | TYPE END_TYPE |
|
2480 {$$ = NULL; |
|
2481 yynerrs++; |
|
2482 print_err_msg(current_filename, locf(@1), locl(@2), "no data type declared in data type(s) declaration."); |
|
2483 } |
|
2484 | TYPE error type_declaration_list END_TYPE |
|
2485 {$$ = NULL; |
|
2486 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'TYPE' in data type(s) declaration."); |
|
2487 yyerrok; |
|
2488 } |
|
2489 | TYPE error END_TYPE |
|
2490 {$$ = NULL; |
|
2491 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in data type(s) declaration."); |
|
2492 yyerrok; |
|
2493 } |
|
2494 /* ERROR_CHECK_END */ |
2158 ; |
2495 ; |
2159 |
2496 |
2160 /* helper symbol for data_type_declaration */ |
2497 /* helper symbol for data_type_declaration */ |
2161 type_declaration_list: |
2498 type_declaration_list: |
2162 type_declaration ';' |
2499 type_declaration ';' |
2163 {$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);} |
2500 {$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);} |
2164 | type_declaration_list type_declaration ';' |
2501 | type_declaration_list type_declaration ';' |
2165 {$$ = $1; $$->add_element($2);} |
2502 {$$ = $1; $$->add_element($2);} |
|
2503 /* ERROR_CHECK_BEGIN */ |
|
2504 | type_declaration error |
|
2505 {$$ = NULL; |
|
2506 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of data type declaration."); |
|
2507 yyerrok; |
|
2508 } |
|
2509 | type_declaration_list type_declaration error |
|
2510 {$$ = NULL; |
|
2511 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of data type declaration."); |
|
2512 yyerrok; |
|
2513 } |
|
2514 | type_declaration_list ';' |
|
2515 {$$ = NULL; |
|
2516 yynerrs++; |
|
2517 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after data type declaration."); |
|
2518 } |
|
2519 /* ERROR_CHECK_END */ |
2166 ; |
2520 ; |
2167 |
2521 |
2168 type_declaration: |
2522 type_declaration: |
2169 single_element_type_declaration |
2523 single_element_type_declaration |
2170 | array_type_declaration |
2524 | array_type_declaration |
2228 /* subrange_type_name ':' subrange_spec_init */ |
2616 /* subrange_type_name ':' subrange_spec_init */ |
2229 identifier ':' subrange_spec_init |
2617 identifier ':' subrange_spec_init |
2230 {$$ = new subrange_type_declaration_c($1, $3, locloc(@$)); |
2618 {$$ = new subrange_type_declaration_c($1, $3, locloc(@$)); |
2231 library_element_symtable.insert($1, prev_declared_subrange_type_name_token); |
2619 library_element_symtable.insert($1, prev_declared_subrange_type_name_token); |
2232 } |
2620 } |
|
2621 /* ERROR_CHECK_BEGIN */ |
|
2622 | identifier subrange_spec_init |
|
2623 {$$ = NULL; |
|
2624 yynerrs++; |
|
2625 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in subrange type declaration."); |
|
2626 } |
|
2627 /* ERROR_CHECK_END */ |
2233 ; |
2628 ; |
2234 |
2629 |
2235 subrange_spec_init: |
2630 subrange_spec_init: |
2236 subrange_specification |
2631 subrange_specification |
2237 {$$ = new subrange_spec_init_c($1, NULL, locloc(@$));} |
2632 {$$ = new subrange_spec_init_c($1, NULL, locloc(@$));} |
2238 | subrange_specification ASSIGN signed_integer |
2633 | subrange_specification ASSIGN signed_integer |
2239 {$$ = new subrange_spec_init_c($1, $3, locloc(@$));} |
2634 {$$ = new subrange_spec_init_c($1, $3, locloc(@$));} |
|
2635 /* ERROR_CHECK_BEGIN */ |
|
2636 | subrange_specification signed_integer |
|
2637 {$$ = NULL; |
|
2638 yynerrs++; |
|
2639 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in subrange specification with initialization."); |
|
2640 } |
|
2641 /* ERROR_CHECK_END */ |
2240 ; |
2642 ; |
2241 |
2643 |
2242 subrange_specification: |
2644 subrange_specification: |
2243 integer_type_name '(' subrange')' |
2645 integer_type_name '(' subrange ')' |
2244 {$$ = new subrange_specification_c($1, $3, locloc(@$));} |
2646 {$$ = new subrange_specification_c($1, $3, locloc(@$));} |
2245 | prev_declared_subrange_type_name |
2647 | prev_declared_subrange_type_name |
2246 {$$ = new subrange_specification_c($1, NULL, locloc(@$));} |
2648 {$$ = new subrange_specification_c($1, NULL, locloc(@$));} |
|
2649 /* ERROR_CHECK_BEGIN */ |
|
2650 | integer_type_name '(' ')' |
|
2651 {$$ = NULL; |
|
2652 yynerrs++; |
|
2653 print_err_msg(current_filename, locf(@2), locl(@3), "no subrange defined in subrange specification."); |
|
2654 } |
|
2655 | integer_type_name '(' error ')' |
|
2656 {$$ = NULL; |
|
2657 print_err_msg(current_filename, locf(@2), locl(@4), "invalid subrange defined in subrange specification."); |
|
2658 yyerrok; |
|
2659 } |
|
2660 | integer_type_name '(' subrange error |
|
2661 {$$ = NULL; |
|
2662 print_err_msg(current_filename, locf(@3), locl(@3), "')' missing after subrange defined in subrange specification."); |
|
2663 yyerrok; |
|
2664 } |
|
2665 /* ERROR_CHECK_END */ |
2247 ; |
2666 ; |
2248 |
2667 |
2249 |
2668 |
2250 subrange: |
2669 subrange: |
2251 signed_integer DOTDOT signed_integer |
2670 signed_integer DOTDOT signed_integer |
2252 {$$ = new subrange_c($1, $3, locloc(@$));} |
2671 {$$ = new subrange_c($1, $3, locloc(@$));} |
|
2672 /* ERROR_CHECK_BEGIN */ |
|
2673 | signed_integer signed_integer |
|
2674 {$$ = NULL; |
|
2675 yynerrs++; |
|
2676 print_err_msg(current_filename, locf(@1), locl(@2), "'..' missing between bounds in subrange definition."); |
|
2677 } |
|
2678 | signed_integer error signed_integer |
|
2679 {$$ = NULL; |
|
2680 yynerrs++; |
|
2681 print_err_msg(current_filename, locf(@1), locl(@2), "expecting '..' between bounds in subrange definition."); |
|
2682 } |
|
2683 | signed_integer DOTDOT error |
|
2684 {$$ = NULL; |
|
2685 yynerrs++; |
|
2686 print_err_msg(current_filename, locf(@1), locl(@2), "invalid value for upper bound in subrange definition."); |
|
2687 } |
|
2688 /* ERROR_CHECK_END */ |
2253 ; |
2689 ; |
2254 |
2690 |
2255 enumerated_type_declaration: |
2691 enumerated_type_declaration: |
2256 /* enumerated_type_name ':' enumerated_spec_init */ |
2692 /* enumerated_type_name ':' enumerated_spec_init */ |
2257 identifier ':' enumerated_spec_init |
2693 identifier ':' enumerated_spec_init |
2258 {$$ = new enumerated_type_declaration_c($1, $3, locloc(@$)); |
2694 {$$ = new enumerated_type_declaration_c($1, $3, locloc(@$)); |
2259 library_element_symtable.insert($1, prev_declared_enumerated_type_name_token); |
2695 library_element_symtable.insert($1, prev_declared_enumerated_type_name_token); |
2260 } |
2696 } |
|
2697 /* ERROR_CHECK_BEGIN */ |
|
2698 | identifier enumerated_spec_init |
|
2699 {$$ = NULL; |
|
2700 yynerrs++; |
|
2701 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in enumerated type declaration."); |
|
2702 } |
|
2703 /* ERROR_CHECK_END */ |
2261 ; |
2704 ; |
2262 |
2705 |
2263 |
2706 |
2264 enumerated_spec_init: |
2707 enumerated_spec_init: |
2265 enumerated_specification |
2708 enumerated_specification |
2266 {$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));} |
2709 {$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));} |
2267 | enumerated_specification ASSIGN enumerated_value |
2710 | enumerated_specification ASSIGN enumerated_value |
2268 {$$ = new enumerated_spec_init_c($1, $3, locloc(@$));} |
2711 {$$ = new enumerated_spec_init_c($1, $3, locloc(@$));} |
|
2712 /* ERROR_CHECK_BEGIN */ |
|
2713 | enumerated_specification enumerated_value |
|
2714 {$$ = NULL; |
|
2715 yynerrs++; |
|
2716 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in enumerated specification with initialization."); |
|
2717 } |
|
2718 /* ERROR_CHECK_END */ |
2269 ; |
2719 ; |
2270 |
2720 |
2271 enumerated_specification: |
2721 enumerated_specification: |
2272 '(' enumerated_value_list ')' |
2722 '(' enumerated_value_list ')' |
2273 {$$ = $2;} |
2723 {$$ = $2;} |
2274 | prev_declared_enumerated_type_name |
2724 | prev_declared_enumerated_type_name |
|
2725 /* ERROR_CHECK_BEGIN */ |
|
2726 | '(' ')' |
|
2727 {$$ = NULL; |
|
2728 yynerrs++; |
|
2729 print_err_msg(current_filename, locf(@1), locl(@2), "no enumerated value list defined in enumerated specification."); |
|
2730 } |
|
2731 | '(' error ')' |
|
2732 {$$ = NULL; |
|
2733 print_err_msg(current_filename, locf(@1), locl(@3), "invalid enumerated value list defined in enumerated specification."); |
|
2734 yyerrok; |
|
2735 } |
|
2736 | '(' enumerated_value_list error |
|
2737 {$$ = NULL; |
|
2738 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of enumerated specification."); |
|
2739 yyerrok; |
|
2740 } |
|
2741 /* ERROR_CHECK_END */ |
2275 ; |
2742 ; |
2276 |
2743 |
2277 /* helper symbol for enumerated_specification */ |
2744 /* helper symbol for enumerated_specification */ |
2278 enumerated_value_list: |
2745 enumerated_value_list: |
2279 enumerated_value |
2746 enumerated_value |
2280 {$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);} |
2747 {$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);} |
2281 | enumerated_value_list ',' enumerated_value |
2748 | enumerated_value_list ',' enumerated_value |
2282 {$$ = $1; $$->add_element($3);} |
2749 {$$ = $1; $$->add_element($3);} |
|
2750 /* ERROR_CHECK_BEGIN */ |
|
2751 | enumerated_value_list enumerated_value |
|
2752 {$$ = NULL; |
|
2753 yynerrs++; |
|
2754 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in enumerated value list."); |
|
2755 } |
|
2756 | enumerated_value_list ',' error |
|
2757 {$$ = NULL; |
|
2758 print_err_msg(current_filename, locf(@1), locl(@2), "invalid value in enumerated value list."); |
|
2759 yyerrok; |
|
2760 } |
|
2761 /* ERROR_CHECK_END */ |
2283 ; |
2762 ; |
2284 |
2763 |
2285 |
2764 |
2286 enumerated_value: |
2765 enumerated_value: |
2287 identifier |
2766 identifier |
2288 {$$ = new enumerated_value_c(NULL, $1, locloc(@$));} |
2767 {$$ = new enumerated_value_c(NULL, $1, locloc(@$));} |
2289 | prev_declared_enumerated_type_name '#' any_identifier |
2768 | prev_declared_enumerated_type_name '#' any_identifier |
2290 {$$ = new enumerated_value_c($1, $3, locloc(@$));} |
2769 {$$ = new enumerated_value_c($1, $3, locloc(@$));} |
|
2770 /* ERROR_CHECK_BEGIN */ |
|
2771 | prev_declared_enumerated_type_name any_identifier |
|
2772 {$$ = NULL; |
|
2773 yynerrs++; |
|
2774 print_err_msg(current_filename, locf(@1), locl(@2), "'#' missing between enumerated type name and value in enumerated literal."); |
|
2775 } |
|
2776 | prev_declared_enumerated_type_name error any_identifier |
|
2777 {$$ = NULL; |
|
2778 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '#' between enumerated type name and value in enumerated literal."); |
|
2779 yyerrok; |
|
2780 } |
|
2781 | prev_declared_enumerated_type_name '#' error |
|
2782 {$$ = NULL; |
|
2783 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for enumerated literal."); |
|
2784 yyerrok; |
|
2785 } |
|
2786 | identifier '#' any_identifier |
|
2787 {$$ = NULL; |
|
2788 yynerrs++; |
|
2789 print_err_msg(current_filename, locf(@1), locl(@1), "unknown type name for typed literal."); |
|
2790 } |
|
2791 /* ERROR_CHECK_END */ |
2291 ; |
2792 ; |
2292 |
2793 |
2293 |
2794 |
2294 /* |
2795 /* |
2295 enumerated_value_without_identifier: |
2796 enumerated_value_without_identifier: |
2303 /* array_type_name ':' array_spec_init */ |
2804 /* array_type_name ':' array_spec_init */ |
2304 identifier ':' array_spec_init |
2805 identifier ':' array_spec_init |
2305 {$$ = new array_type_declaration_c($1, $3, locloc(@$)); |
2806 {$$ = new array_type_declaration_c($1, $3, locloc(@$)); |
2306 library_element_symtable.insert($1, prev_declared_array_type_name_token); |
2807 library_element_symtable.insert($1, prev_declared_array_type_name_token); |
2307 } |
2808 } |
|
2809 /* ERROR_CHECK_BEGIN */ |
|
2810 | identifier array_spec_init |
|
2811 {$$ = NULL; |
|
2812 yynerrs++; |
|
2813 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing between data type name and specification in array type declaration."); |
|
2814 } |
|
2815 /* ERROR_CHECK_END */ |
2308 ; |
2816 ; |
2309 |
2817 |
2310 array_spec_init: |
2818 array_spec_init: |
2311 array_specification |
2819 array_specification |
2312 {$$ = new array_spec_init_c($1, NULL, locloc(@$));} |
2820 {$$ = new array_spec_init_c($1, NULL, locloc(@$));} |
2313 | array_specification ASSIGN array_initialization |
2821 | array_specification ASSIGN array_initialization |
2314 {$$ = new array_spec_init_c($1, $3, locloc(@$));} |
2822 {$$ = new array_spec_init_c($1, $3, locloc(@$));} |
|
2823 /* ERROR_CHECK_BEGIN */ |
|
2824 | array_specification array_initialization |
|
2825 {$$ = NULL; |
|
2826 yynerrs++; |
|
2827 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in array specification with initialization."); |
|
2828 } |
|
2829 /* ERROR_CHECK_END */ |
2315 ; |
2830 ; |
2316 |
2831 |
2317 |
2832 |
2318 array_specification: |
2833 array_specification: |
2319 prev_declared_array_type_name |
2834 prev_declared_array_type_name |
2320 | ARRAY '[' array_subrange_list ']' OF non_generic_type_name |
2835 | ARRAY '[' array_subrange_list ']' OF non_generic_type_name |
2321 {$$ = new array_specification_c($3, $6, locloc(@$));} |
2836 {$$ = new array_specification_c($3, $6, locloc(@$));} |
|
2837 /* ERROR_CHECK_BEGIN */ |
|
2838 | ARRAY array_subrange_list ']' OF non_generic_type_name |
|
2839 {$$ = NULL; |
|
2840 yynerrs++; |
|
2841 print_err_msg(current_filename, locf(@1), locl(@2), "'[' missing before subrange list in array specification."); |
|
2842 } |
|
2843 | ARRAY error array_subrange_list ']' OF non_generic_type_name |
|
2844 {$$ = NULL; |
|
2845 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '[' after 'ARRAY' in array specification."); |
|
2846 yyerrok; |
|
2847 } |
|
2848 | ARRAY '[' ']' OF non_generic_type_name |
|
2849 {$$ = NULL; |
|
2850 yynerrs++; |
|
2851 print_err_msg(current_filename, locf(@2), locl(@3), "no subrange list defined in array specification."); |
|
2852 } |
|
2853 | ARRAY '[' error ']' OF non_generic_type_name |
|
2854 {$$ = NULL; |
|
2855 print_err_msg(current_filename, locf(@2), locl(@4), "invalid subrange list defined in array specification."); |
|
2856 yyerrok; |
|
2857 } |
|
2858 | ARRAY OF non_generic_type_name |
|
2859 {$$ = NULL; |
|
2860 yynerrs++; |
|
2861 print_err_msg(current_filename, locf(@1), locl(@2), "no subrange list defined in array specification."); |
|
2862 } |
|
2863 | ARRAY error OF non_generic_type_name |
|
2864 {$$ = NULL; |
|
2865 print_err_msg(current_filename, locf(@1), locl(@3), "invalid subrange list defined in array specification."); |
|
2866 yyerrok; |
|
2867 } |
|
2868 | ARRAY '[' array_subrange_list OF non_generic_type_name |
|
2869 {$$ = NULL; |
|
2870 yynerrs++; |
|
2871 print_err_msg(current_filename, locf(@3), locl(@4), "']' missing after subrange list in array specification."); |
|
2872 } |
|
2873 | ARRAY '[' array_subrange_list error OF non_generic_type_name |
|
2874 {$$ = NULL; |
|
2875 yynerrs++; |
|
2876 print_err_msg(current_filename, locf(@3), locl(@5), "expecting '[' after subrange list in array specification."); |
|
2877 } |
|
2878 | ARRAY '[' array_subrange_list ']' non_generic_type_name |
|
2879 {$$ = NULL; |
|
2880 yynerrs++; |
|
2881 print_err_msg(current_filename, locf(@4), locl(@5), "'OF' missing between subrange list and item type name in array specification."); |
|
2882 } |
|
2883 | ARRAY '[' array_subrange_list ']' error non_generic_type_name |
|
2884 {$$ = NULL; |
|
2885 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'OF' between subrange list and item type name in array specification."); |
|
2886 yyerrok; |
|
2887 } |
|
2888 | ARRAY '[' array_subrange_list ']' OF error |
|
2889 {$$ = NULL; |
|
2890 print_err_msg(current_filename, locf(@1), locl(@3), "no itme data type defined in array specification."); |
|
2891 yyerrok; |
|
2892 } |
|
2893 /* ERROR_CHECK_END */ |
2322 ; |
2894 ; |
2323 |
2895 |
2324 /* helper symbol for array_specification */ |
2896 /* helper symbol for array_specification */ |
2325 array_subrange_list: |
2897 array_subrange_list: |
2326 subrange |
2898 subrange |
2327 {$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);} |
2899 {$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);} |
2328 | array_subrange_list ',' subrange |
2900 | array_subrange_list ',' subrange |
2329 {$$ = $1; $$->add_element($3);} |
2901 {$$ = $1; $$->add_element($3);} |
|
2902 /* ERROR_CHECK_BEGIN */ |
|
2903 | array_subrange_list subrange |
|
2904 {$$ = NULL; |
|
2905 yynerrs++; |
|
2906 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in subrange list."); |
|
2907 } |
|
2908 | array_subrange_list ',' error |
|
2909 {$$ = NULL; |
|
2910 print_err_msg(current_filename, locf(@2), locl(@2), "invalid subrange in subrange list."); |
|
2911 yyerrok; |
|
2912 } |
|
2913 /* ERROR_CHECK_END */ |
2330 ; |
2914 ; |
2331 |
2915 |
2332 |
2916 |
2333 array_initialization: |
2917 array_initialization: |
2334 '[' array_initial_elements_list ']' |
2918 '[' array_initial_elements_list ']' |
2335 {$$ = $2;} |
2919 {$$ = $2;} |
|
2920 /* ERROR_CHECK_BEGIN */ |
|
2921 | '[' ']' |
|
2922 {$$ = NULL; |
|
2923 yynerrs++; |
|
2924 print_err_msg(current_filename, locf(@1), locl(@2), "no initial values list defined in array initialization."); |
|
2925 } |
|
2926 | '[' error ']' |
|
2927 {$$ = NULL; |
|
2928 print_err_msg(current_filename, locf(@1), locl(@2), "invalid initial values list defined in array initialization."); |
|
2929 yyerrok; |
|
2930 } |
|
2931 | '[' array_initial_elements_list error |
|
2932 {$$ = NULL; |
|
2933 print_err_msg(current_filename, locf(@1), locl(@2), "']' missing at the end of array initialization."); |
|
2934 yyerrok; |
|
2935 } |
|
2936 /* ERROR_CHECK_END */ |
2336 ; |
2937 ; |
2337 |
2938 |
2338 |
2939 |
2339 /* helper symbol for array_initialization */ |
2940 /* helper symbol for array_initialization */ |
2340 array_initial_elements_list: |
2941 array_initial_elements_list: |
2341 array_initial_elements |
2942 array_initial_elements |
2342 {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} |
2943 {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} |
2343 | array_initial_elements_list ',' array_initial_elements |
2944 | array_initial_elements_list ',' array_initial_elements |
2344 {$$ = $1; $$->add_element($3);} |
2945 {$$ = $1; $$->add_element($3);} |
|
2946 /* ERROR_CHECK_BEGIN |
|
2947 | array_initial_elements_list ',' error |
|
2948 {$$ = NULL; |
|
2949 print_err_msg(current_filename, locf(@2), locl(@2), "invalid array initial value in array initial values list."); |
|
2950 yyerrok; |
|
2951 } |
|
2952 /* ERROR_CHECK_END */ |
2345 ; |
2953 ; |
2346 |
2954 |
2347 |
2955 |
2348 array_initial_elements: |
2956 array_initial_elements: |
2349 array_initial_element |
2957 array_initial_element |
2350 | integer '(' ')' |
2958 | integer '(' ')' |
2351 | integer '(' array_initial_element ')' |
2959 | integer '(' array_initial_element ')' |
2352 {$$ = new array_initial_elements_c($1, $3, locloc(@$));} |
2960 {$$ = new array_initial_elements_c($1, $3, locloc(@$));} |
|
2961 /* ERROR_CHECK_BEGIN |
|
2962 | integer '(' error ')' |
|
2963 {$$ = NULL; |
|
2964 print_err_msg(current_filename, locf(@2), locl(@4), "invalid array initial value in array initial values list."); |
|
2965 yyerrok; |
|
2966 } |
|
2967 | integer '(' array_initial_element error |
|
2968 {$$ = NULL; |
|
2969 print_err_msg(current_filename, locf(@2), locl(@4), "')' missing at the end of array initial value in array initial values list."); |
|
2970 yyerrok; |
|
2971 } |
|
2972 /* ERROR_CHECK_END */ |
2353 ; |
2973 ; |
2354 |
2974 |
2355 |
2975 |
2356 array_initial_element: |
2976 array_initial_element: |
2357 constant |
2977 constant |
2380 initialized_structure: |
3007 initialized_structure: |
2381 prev_declared_structure_type_name |
3008 prev_declared_structure_type_name |
2382 {$$ = new initialized_structure_c($1, NULL, locloc(@$));} |
3009 {$$ = new initialized_structure_c($1, NULL, locloc(@$));} |
2383 | prev_declared_structure_type_name ASSIGN structure_initialization |
3010 | prev_declared_structure_type_name ASSIGN structure_initialization |
2384 {$$ = new initialized_structure_c($1, $3, locloc(@$));} |
3011 {$$ = new initialized_structure_c($1, $3, locloc(@$));} |
|
3012 /* ERROR_CHECK_BEGIN */ |
|
3013 | prev_declared_structure_type_name structure_initialization |
|
3014 {$$ = NULL; |
|
3015 yynerrs++; |
|
3016 print_err_msg(current_filename, locf(@1), locl(@2), "':=' missing in structure specification with initialization."); |
|
3017 } |
|
3018 | identifier ASSIGN structure_initialization |
|
3019 {$$ = NULL; |
|
3020 yynerrs++; |
|
3021 print_err_msg(current_filename, locf(@1), locl(@2), "unknown type name for structure specification with initialization."); |
|
3022 } |
|
3023 /* ERROR_CHECK_END */ |
2385 ; |
3024 ; |
2386 |
3025 |
2387 |
3026 |
2388 structure_declaration: |
3027 structure_declaration: |
2389 STRUCT structure_element_declaration_list END_STRUCT |
3028 STRUCT structure_element_declaration_list END_STRUCT |
2390 {$$ = $2;} |
3029 {$$ = $2;} |
|
3030 /* ERROR_CHECK_BEGIN */ |
|
3031 | STRUCT END_STRUCT |
|
3032 {$$ = NULL; |
|
3033 yynerrs++; |
|
3034 print_err_msg(current_filename, locf(@1), locl(@2), "no structure element declared in structure type declaration."); |
|
3035 } |
|
3036 | STRUCT error structure_element_declaration_list END_STRUCT |
|
3037 {$$ = NULL; |
|
3038 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'STRUCT' in structure type declaration."); |
|
3039 yyerrok; |
|
3040 } |
|
3041 | STRUCT error END_STRUCT |
|
3042 {$$ = NULL; |
|
3043 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in structure type declaration."); |
|
3044 yyerrok; |
|
3045 } |
|
3046 /* ERROR_CHECK_END */ |
2391 ; |
3047 ; |
2392 |
3048 |
2393 /* helper symbol for structure_declaration */ |
3049 /* helper symbol for structure_declaration */ |
2394 structure_element_declaration_list: |
3050 structure_element_declaration_list: |
2395 structure_element_declaration ';' |
3051 structure_element_declaration ';' |
2396 {$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);} |
3052 {$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);} |
2397 | structure_element_declaration_list structure_element_declaration ';' |
3053 | structure_element_declaration_list structure_element_declaration ';' |
2398 {$$ = $1; $$->add_element($2);} |
3054 {$$ = $1; $$->add_element($2);} |
|
3055 /* ERROR_CHECK_BEGIN */ |
|
3056 | structure_element_declaration error |
|
3057 {$$ = NULL; |
|
3058 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of structure element declaration."); |
|
3059 yyerrok; |
|
3060 } |
|
3061 | structure_element_declaration_list structure_element_declaration error |
|
3062 {$$ = NULL; |
|
3063 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of structure element declaration."); |
|
3064 yyerrok; |
|
3065 } |
|
3066 | structure_element_declaration_list ';' |
|
3067 {$$ = NULL; |
|
3068 yynerrs++; |
|
3069 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after structure element declaration."); |
|
3070 } |
|
3071 /* ERROR_CHECK_END */ |
2399 ; |
3072 ; |
2400 |
3073 |
2401 |
3074 |
2402 structure_element_declaration: |
3075 structure_element_declaration: |
2403 structure_element_name ':' simple_spec_init |
3076 structure_element_name ':' simple_spec_init |
2408 {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} |
3081 {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} |
2409 | structure_element_name ':' array_spec_init |
3082 | structure_element_name ':' array_spec_init |
2410 {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} |
3083 {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} |
2411 | structure_element_name ':' initialized_structure |
3084 | structure_element_name ':' initialized_structure |
2412 {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} |
3085 {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} |
|
3086 /* ERROR_CHECK_BEGIN */ |
|
3087 | structure_element_name simple_spec_init |
|
3088 {$$ = NULL; |
|
3089 yynerrs++; |
|
3090 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and simple specification."); |
|
3091 } |
|
3092 | structure_element_name subrange_spec_init |
|
3093 {$$ = NULL; |
|
3094 yynerrs++; |
|
3095 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and subrange specification."); |
|
3096 } |
|
3097 | structure_element_name enumerated_spec_init |
|
3098 {$$ = NULL; |
|
3099 yynerrs++; |
|
3100 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and enumerated specification."); |
|
3101 } |
|
3102 | structure_element_name array_spec_init |
|
3103 {$$ = NULL; |
|
3104 yynerrs++; |
|
3105 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and array specification."); |
|
3106 } |
|
3107 | structure_element_name initialized_structure |
|
3108 {$$ = NULL; |
|
3109 yynerrs++; |
|
3110 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between structure element name and structure specification."); |
|
3111 } |
|
3112 | structure_element_name ':' identifier |
|
3113 {$$ = NULL; |
|
3114 yynerrs++; |
|
3115 print_err_msg(current_filename, locf(@2), locl(@2), "unknown variable type defined in structure element declaration."); |
|
3116 } |
|
3117 | structure_element_name ':' error |
|
3118 {$$ = NULL; |
|
3119 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in structure element declaration."); |
|
3120 yyerrok; |
|
3121 } |
|
3122 /* ERROR_CHECK_END */ |
2413 ; |
3123 ; |
2414 |
3124 |
2415 |
3125 |
2416 structure_element_name: any_identifier; |
3126 structure_element_name: any_identifier; |
2417 |
3127 |
2418 |
3128 |
2419 structure_initialization: |
3129 structure_initialization: |
2420 '(' structure_element_initialization_list ')' |
3130 '(' structure_element_initialization_list ')' |
2421 {$$ = $2;} |
3131 {$$ = $2;} |
|
3132 /* ERROR_CHECK_BEGIN */ |
|
3133 | '(' error ')' |
|
3134 {$$ = NULL; |
|
3135 print_err_msg(current_filename, locf(@1), locl(@3), "invalid structure element initialization list in structure initialization."); |
|
3136 yyerrok; |
|
3137 } |
|
3138 | '(' structure_element_initialization_list error |
|
3139 {$$ = NULL; |
|
3140 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ')' at the end of structure element initialization list in structure initialization."); |
|
3141 yyerrok; |
|
3142 } |
|
3143 /* ERROR_CHECK_END */ |
2422 ; |
3144 ; |
2423 |
3145 |
2424 /* helper symbol for structure_initialization */ |
3146 /* helper symbol for structure_initialization */ |
2425 structure_element_initialization_list: |
3147 structure_element_initialization_list: |
2426 structure_element_initialization |
3148 structure_element_initialization |
2427 {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} |
3149 {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} |
2428 | structure_element_initialization_list ',' structure_element_initialization |
3150 | structure_element_initialization_list ',' structure_element_initialization |
2429 {$$ = $1; $$->add_element($3);} |
3151 {$$ = $1; $$->add_element($3);} |
|
3152 /* ERROR_CHECK_BEGIN |
|
3153 | structure_element_initialization_list structure_element_initialization |
|
3154 {$$ = NULL; |
|
3155 yynerrs++; |
|
3156 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing in structure element initialization list in structure initialization."); |
|
3157 } |
|
3158 | structure_element_initialization_list ',' error |
|
3159 {$$ = NULL; |
|
3160 print_err_msg(current_filename, locf(@2), locl(@2), "invalid structure element initialization in structure initialization."); |
|
3161 yyerrok; |
|
3162 } |
|
3163 /* ERROR_CHECK_END */ |
2430 ; |
3164 ; |
2431 |
3165 |
2432 |
3166 |
2433 structure_element_initialization: |
3167 structure_element_initialization: |
2434 structure_element_name ASSIGN constant |
3168 structure_element_name ASSIGN constant |
2642 | VAR_INPUT RETAIN input_declaration_list END_VAR |
3398 | VAR_INPUT RETAIN input_declaration_list END_VAR |
2643 {$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
3399 {$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
2644 | VAR_INPUT NON_RETAIN input_declaration_list END_VAR |
3400 | VAR_INPUT NON_RETAIN input_declaration_list END_VAR |
2645 {$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
3401 {$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
2646 /* ERROR_CHECK_BEGIN */ |
3402 /* ERROR_CHECK_BEGIN */ |
|
3403 | VAR_INPUT END_VAR |
|
3404 {$$ = NULL; |
|
3405 yynerrs++; |
|
3406 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in input variable(s) declaration."); |
|
3407 } |
|
3408 | VAR_INPUT RETAIN END_VAR |
|
3409 {$$ = NULL; |
|
3410 yynerrs++; |
|
3411 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive input variable(s) declaration."); |
|
3412 } |
|
3413 | VAR_INPUT NON_RETAIN END_VAR |
|
3414 {$$ = NULL; |
|
3415 yynerrs++; |
|
3416 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in non-retentive input variable(s) declaration."); |
|
3417 } |
|
3418 | VAR_INPUT error input_declaration_list END_VAR |
|
3419 {$$ = NULL; |
|
3420 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_INPUT' in input variable(s) declaration."); |
|
3421 yyerrok; |
|
3422 } |
|
3423 | VAR_INPUT RETAIN error input_declaration_list END_VAR |
|
3424 {$$ = NULL; |
|
3425 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive input variable(s) declaration."); |
|
3426 yyerrok; |
|
3427 } |
|
3428 | VAR_INPUT NON_RETAIN error input_declaration_list END_VAR |
|
3429 {$$ = NULL; |
|
3430 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive input variable(s) declaration."); |
|
3431 yyerrok; |
|
3432 } |
2647 | VAR_INPUT error END_VAR |
3433 | VAR_INPUT error END_VAR |
2648 {$$ = NULL; |
3434 {$$ = NULL; |
2649 print_err_msg(current_filename, locf(@1), locl(@3), "error in input variable(s) declaration."); |
3435 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in input variable(s) declaration."); |
2650 /* yychar */ |
3436 yyerrok; |
|
3437 } |
|
3438 | VAR_INPUT RETAIN error END_VAR |
|
3439 {$$ = NULL; |
|
3440 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in retentive input variable(s) declaration."); |
|
3441 yyerrok; |
|
3442 } |
|
3443 | VAR_INPUT NON_RETAIN error END_VAR |
|
3444 {$$ = NULL; |
|
3445 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in non-retentive input variable(s) declaration."); |
2651 yyerrok; |
3446 yyerrok; |
2652 } |
3447 } |
2653 /* ERROR_CHECK_END */ |
3448 /* ERROR_CHECK_END */ |
2654 ; |
3449 ; |
2655 |
3450 |
2704 } |
3570 } |
2705 | var1_list ',' variable_name |
3571 | var1_list ',' variable_name |
2706 {$$ = $1; $$->add_element($3); |
3572 {$$ = $1; $$->add_element($3); |
2707 variable_name_symtable.insert($3, prev_declared_variable_name_token); |
3573 variable_name_symtable.insert($3, prev_declared_variable_name_token); |
2708 } |
3574 } |
|
3575 /* ERROR_CHECK_BEGIN */ |
|
3576 | var1_list variable_name |
|
3577 {$$ = NULL; |
|
3578 yynerrs++; |
|
3579 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing in variable list."); |
|
3580 } |
|
3581 | var1_list ',' error |
|
3582 {$$ = NULL; |
|
3583 yynerrs++; |
|
3584 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ',' in variable declaration."); |
|
3585 } |
|
3586 /* ERROR_CHECK_END */ |
2709 ; |
3587 ; |
2710 |
3588 |
2711 |
3589 |
2712 |
3590 |
2713 array_var_init_decl: |
3591 array_var_init_decl: |
2714 var1_list ':' array_spec_init |
3592 var1_list ':' array_spec_init |
2715 {$$ = new array_var_init_decl_c($1, $3, locloc(@$));} |
3593 {$$ = new array_var_init_decl_c($1, $3, locloc(@$));} |
|
3594 /* ERROR_CHECK_BEGIN */ |
|
3595 | var1_list array_spec_init |
|
3596 {$$ = NULL; |
|
3597 yynerrs++; |
|
3598 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and array specification."); |
|
3599 } |
|
3600 /* ERROR_CHECK_END */ |
2716 ; |
3601 ; |
2717 |
3602 |
2718 |
3603 |
2719 structured_var_init_decl: |
3604 structured_var_init_decl: |
2720 var1_list ':' initialized_structure |
3605 var1_list ':' initialized_structure |
2721 {$$ = new structured_var_init_decl_c($1, $3, locloc(@$));} |
3606 {$$ = new structured_var_init_decl_c($1, $3, locloc(@$));} |
|
3607 /* ERROR_CHECK_BEGIN */ |
|
3608 | var1_list initialized_structure |
|
3609 {$$ = NULL; |
|
3610 yynerrs++; |
|
3611 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and structured specification."); |
|
3612 } |
|
3613 /* ERROR_CHECK_END */ |
2722 ; |
3614 ; |
2723 |
3615 |
2724 |
3616 |
2725 /* NOTE: see notes above fb_name_list and var1_list |
3617 /* NOTE: see notes above fb_name_list and var1_list |
2726 * for reason why ':' was removed from this rule! |
3618 * for reason why ':' was removed from this rule! |
2795 | VAR_OUTPUT RETAIN var_init_decl_list END_VAR |
3704 | VAR_OUTPUT RETAIN var_init_decl_list END_VAR |
2796 {$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
3705 {$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
2797 | VAR_OUTPUT NON_RETAIN var_init_decl_list END_VAR |
3706 | VAR_OUTPUT NON_RETAIN var_init_decl_list END_VAR |
2798 {$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
3707 {$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
2799 /* ERROR_CHECK_BEGIN */ |
3708 /* ERROR_CHECK_BEGIN */ |
|
3709 | VAR_OUTPUT END_VAR |
|
3710 {$$ = NULL; |
|
3711 yynerrs++; |
|
3712 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in output variable(s) declaration."); |
|
3713 } |
|
3714 | VAR_OUTPUT RETAIN END_VAR |
|
3715 {$$ = NULL; |
|
3716 yynerrs++; |
|
3717 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive output variable(s) declaration."); |
|
3718 } |
|
3719 | VAR_OUTPUT NON_RETAIN END_VAR |
|
3720 {$$ = NULL; |
|
3721 yynerrs++; |
|
3722 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in non-retentive output variable(s) declaration."); |
|
3723 } |
|
3724 | VAR_OUTPUT error var_init_decl_list END_VAR |
|
3725 {$$ = NULL; |
|
3726 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_OUPUT' in output variable(s) declaration."); |
|
3727 yyerrok; |
|
3728 } |
|
3729 | VAR_OUTPUT RETAIN error var_init_decl_list END_VAR |
|
3730 {$$ = NULL; |
|
3731 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive output variable(s) declaration."); |
|
3732 yyerrok; |
|
3733 } |
|
3734 | VAR_OUTPUT NON_RETAIN error var_init_decl_list END_VAR |
|
3735 {$$ = NULL; |
|
3736 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive output variable(s) declaration."); |
|
3737 yyerrok; |
|
3738 } |
2800 | VAR_OUTPUT error END_VAR |
3739 | VAR_OUTPUT error END_VAR |
2801 {$$ = NULL; |
3740 {$$ = NULL; |
2802 print_err_msg(current_filename, locf(@1), locl(@3), "error in output variable(s) declaration."); |
3741 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in output variable(s) declaration."); |
2803 /* yychar */ |
3742 yyerrok; |
|
3743 } |
|
3744 | VAR_OUTPUT RETAIN error END_VAR |
|
3745 {$$ = NULL; |
|
3746 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in retentive output variable(s) declaration."); |
|
3747 yyerrok; |
|
3748 } |
|
3749 | VAR_OUTPUT NON_RETAIN error END_VAR |
|
3750 {$$ = NULL; |
|
3751 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in non-retentive output variable(s) declaration."); |
2804 yyerrok; |
3752 yyerrok; |
2805 } |
3753 } |
2806 /* ERROR_CHECK_END */ |
3754 /* ERROR_CHECK_END */ |
2807 ; |
3755 ; |
2808 |
3756 |
2850 {$$ = new var1_init_decl_c($1, $3, locloc(@$));} |
3819 {$$ = new var1_init_decl_c($1, $3, locloc(@$));} |
2851 | var1_list ':' subrange_specification |
3820 | var1_list ':' subrange_specification |
2852 {$$ = new var1_init_decl_c($1, $3, locloc(@$));} |
3821 {$$ = new var1_init_decl_c($1, $3, locloc(@$));} |
2853 | var1_list ':' enumerated_specification |
3822 | var1_list ':' enumerated_specification |
2854 {$$ = new var1_init_decl_c($1, $3, locloc(@$));} |
3823 {$$ = new var1_init_decl_c($1, $3, locloc(@$));} |
|
3824 /* ERROR_CHECK_BEGIN */ |
|
3825 | var1_list simple_specification |
|
3826 {$$ = NULL; |
|
3827 yynerrs++; |
|
3828 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and simple specification."); |
|
3829 } |
|
3830 | var1_list subrange_specification |
|
3831 {$$ = NULL; |
|
3832 yynerrs++; |
|
3833 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and subrange specification."); |
|
3834 } |
|
3835 | var1_list enumerated_specification |
|
3836 {$$ = NULL; |
|
3837 yynerrs++; |
|
3838 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and enumerated specification."); |
|
3839 } |
|
3840 /* ERROR_CHECK_END */ |
2855 ; |
3841 ; |
2856 |
3842 |
2857 |
3843 |
2858 |
3844 |
2859 array_var_declaration: |
3845 array_var_declaration: |
2860 var1_list ':' array_specification |
3846 var1_list ':' array_specification |
2861 {$$ = new array_var_declaration_c($1, $3, locloc(@$));} |
3847 {$$ = new array_var_declaration_c($1, $3, locloc(@$));} |
|
3848 /* ERROR_CHECK_BEGIN */ |
|
3849 | var1_list array_specification |
|
3850 {$$ = NULL; |
|
3851 yynerrs++; |
|
3852 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and array specification."); |
|
3853 } |
|
3854 /* ERROR_CHECK_END */ |
2862 ; |
3855 ; |
2863 |
3856 |
2864 structured_var_declaration: |
3857 structured_var_declaration: |
2865 var1_list ':' prev_declared_structure_type_name |
3858 var1_list ':' prev_declared_structure_type_name |
2866 {$$ = new structured_var_declaration_c($1, $3, locloc(@$));} |
3859 {$$ = new structured_var_declaration_c($1, $3, locloc(@$));} |
|
3860 /* ERROR_CHECK_BEGIN */ |
|
3861 | var1_list prev_declared_structure_type_name |
|
3862 {$$ = NULL; |
|
3863 yynerrs++; |
|
3864 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and structured specification."); |
|
3865 } |
|
3866 | var1_list ':' identifier |
|
3867 {$$ = NULL; |
|
3868 yynerrs++; |
|
3869 print_err_msg(current_filename, locf(@2), locl(@2), "unknown type name in structured variable declaration."); |
|
3870 } |
|
3871 /* ERROR_CHECK_END */ |
2867 ; |
3872 ; |
2868 |
3873 |
2869 |
3874 |
2870 var_declarations: |
3875 var_declarations: |
2871 VAR var_init_decl_list END_VAR |
3876 VAR var_init_decl_list END_VAR |
2872 {$$ = new var_declarations_c(NULL, $2, locloc(@$));} |
3877 {$$ = new var_declarations_c(NULL, $2, locloc(@$));} |
2873 | VAR CONSTANT var_init_decl_list END_VAR |
3878 | VAR CONSTANT var_init_decl_list END_VAR |
2874 {$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
3879 {$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
|
3880 /* ERROR_CHECK_BEGIN */ |
|
3881 | VAR END_VAR |
|
3882 {$$ = NULL; |
|
3883 yynerrs++; |
|
3884 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in variable(s) declaration."); |
|
3885 } |
|
3886 | VAR CONSTANT END_VAR |
|
3887 {$$ = NULL; |
|
3888 yynerrs++; |
|
3889 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in constant variable(s) declaration."); |
|
3890 } |
|
3891 | VAR error var_init_decl_list END_VAR |
|
3892 {$$ = NULL; |
|
3893 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in variable(s) declaration."); |
|
3894 yyerrok; |
|
3895 } |
|
3896 | VAR CONSTANT error var_init_decl_list END_VAR |
|
3897 {$$ = NULL; |
|
3898 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant variable(s) declaration."); |
|
3899 yyerrok; |
|
3900 } |
|
3901 | VAR error END_VAR |
|
3902 {$$ = NULL; |
|
3903 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in variable(s) declaration."); |
|
3904 yyerrok; |
|
3905 } |
|
3906 | VAR CONSTANT error END_VAR |
|
3907 {$$ = NULL; |
|
3908 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in constant variable(s) declaration."); |
|
3909 yyerrok; |
|
3910 } |
|
3911 /* ERROR_CHECK_END */ |
2875 ; |
3912 ; |
2876 |
3913 |
2877 |
3914 |
2878 retentive_var_declarations: |
3915 retentive_var_declarations: |
2879 VAR RETAIN var_init_decl_list END_VAR |
3916 VAR RETAIN var_init_decl_list END_VAR |
2880 {$$ = new retentive_var_declarations_c($3, locloc(@$));} |
3917 {$$ = new retentive_var_declarations_c($3, locloc(@$));} |
2881 /* ERROR_CHECK_BEGIN */ |
3918 /* ERROR_CHECK_BEGIN */ |
|
3919 | VAR RETAIN END_VAR |
|
3920 {$$ = NULL; |
|
3921 yynerrs++; |
|
3922 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive variable(s) declaration."); |
|
3923 } |
|
3924 | VAR RETAIN error var_init_decl_list END_VAR |
|
3925 {$$ = NULL; |
|
3926 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive variable(s) declaration."); |
|
3927 yyerrok; |
|
3928 } |
2882 | VAR RETAIN error END_VAR |
3929 | VAR RETAIN error END_VAR |
2883 {$$ = NULL; |
3930 {$$ = NULL; |
2884 print_err_msg(current_filename, locf(@1), locl(@3), "error in variable(s) declaration."); |
3931 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in retentive variable(s) declaration."); |
2885 /* yychar */ |
|
2886 yyerrok; |
3932 yyerrok; |
2887 } |
3933 } |
2888 /* ERROR_CHECK_END */ |
3934 /* ERROR_CHECK_END */ |
2889 ; |
3935 ; |
2890 |
3936 |
2891 |
3937 |
2892 located_var_declarations: |
3938 located_var_declarations: |
2893 VAR located_var_decl_list END_VAR |
3939 VAR located_var_decl_list END_VAR |
2894 {$$ = new located_var_declarations_c(NULL, $2, locloc(@$));} |
3940 {$$ = new located_var_declarations_c(NULL, $2, locloc(@$));} |
2895 | VAR CONSTANT located_var_decl_list END_VAR |
3941 | VAR CONSTANT located_var_decl_list END_VAR |
2896 {$$ = new located_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
3942 {$$ = new located_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
2897 | VAR RETAIN located_var_decl_list END_VAR |
3943 | VAR RETAIN located_var_decl_list END_VAR |
2898 {$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
3944 {$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
2899 | VAR NON_RETAIN located_var_decl_list END_VAR |
3945 | VAR NON_RETAIN located_var_decl_list END_VAR |
2900 {$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
3946 {$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
|
3947 /* ERROR_CHECK_BEGIN */ |
|
3948 | VAR NON_RETAIN END_VAR |
|
3949 {$$ = NULL; |
|
3950 yynerrs++; |
|
3951 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in non-retentive located variable(s) declaration."); |
|
3952 } |
|
3953 | VAR error located_var_decl_list END_VAR |
|
3954 {$$ = NULL; |
|
3955 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in located variable(s) declaration."); |
|
3956 yyerrok; |
|
3957 } |
|
3958 | VAR CONSTANT error located_var_decl_list END_VAR |
|
3959 {$$ = NULL; |
|
3960 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant located variable(s) declaration."); |
|
3961 yyerrok; |
|
3962 } |
|
3963 | VAR RETAIN error located_var_decl_list END_VAR |
|
3964 {$$ = NULL; |
|
3965 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); |
|
3966 yyerrok; |
|
3967 } |
|
3968 | VAR NON_RETAIN error located_var_decl_list END_VAR |
|
3969 {$$ = NULL; |
|
3970 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); |
|
3971 yyerrok; |
|
3972 } |
|
3973 | VAR NON_RETAIN error END_VAR |
|
3974 {$$ = NULL; |
|
3975 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in non retentive variable(s) declaration."); |
|
3976 yyerrok; |
|
3977 } |
|
3978 /* ERROR_CHECK_END */ |
2901 ; |
3979 ; |
2902 |
3980 |
2903 |
3981 |
2904 /* helper symbol for located_var_declarations */ |
3982 /* helper symbol for located_var_declarations */ |
2905 located_var_decl_list: |
3983 located_var_decl_list: |
2906 located_var_decl ';' |
3984 located_var_decl ';' |
2907 {$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);} |
3985 {$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);} |
2908 | located_var_decl_list located_var_decl ';' |
3986 | located_var_decl_list located_var_decl ';' |
2909 {$$ = $1; $$->add_element($2);} |
3987 {$$ = $1; $$->add_element($2);} |
|
3988 /* ERROR_CHECK_BEGIN */ |
|
3989 | located_var_decl error |
|
3990 {$$ = NULL; |
|
3991 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of located variable declaration."); |
|
3992 yyerrok; |
|
3993 } |
|
3994 | located_var_decl_list located_var_decl error |
|
3995 {$$ = NULL; |
|
3996 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of located variable declaration."); |
|
3997 yyerrok; |
|
3998 } |
|
3999 | located_var_decl_list ';' |
|
4000 {$$ = NULL; |
|
4001 yynerrs++; |
|
4002 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after located variable declaration."); |
|
4003 } |
|
4004 /* ERROR_CHECK_END */ |
2910 ; |
4005 ; |
2911 |
4006 |
2912 |
4007 |
2913 located_var_decl: |
4008 located_var_decl: |
2914 variable_name location ':' located_var_spec_init |
4009 variable_name location ':' located_var_spec_init |
2915 {$$ = new located_var_decl_c($1, $2, $4, locloc(@$)); |
4010 {$$ = new located_var_decl_c($1, $2, $4, locloc(@$)); |
2916 variable_name_symtable.insert($1, prev_declared_variable_name_token); |
4011 variable_name_symtable.insert($1, prev_declared_variable_name_token); |
2917 } |
4012 } |
2918 | location ':' located_var_spec_init |
4013 | location ':' located_var_spec_init |
2919 {$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));} |
4014 {$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));} |
|
4015 /* ERROR_CHECK_BEGIN */ |
|
4016 | variable_name location located_var_spec_init |
|
4017 {$$ = NULL; |
|
4018 yynerrs++; |
|
4019 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between located variable location and specification."); |
|
4020 } |
|
4021 | location located_var_spec_init |
|
4022 {$$ = NULL; |
|
4023 yynerrs++; |
|
4024 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between located variable location and specification."); |
|
4025 } |
|
4026 | variable_name location ':' error |
|
4027 {$$ = NULL; |
|
4028 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in located variable declaration."); |
|
4029 yyerrok; |
|
4030 } |
|
4031 | location ':' error |
|
4032 {$$ = NULL; |
|
4033 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in located variable declaration."); |
|
4034 yyerrok; |
|
4035 } |
|
4036 /* ERROR_CHECK_END */ |
2920 ; |
4037 ; |
2921 |
4038 |
2922 |
4039 |
2923 |
4040 |
2924 |
4041 |
2926 VAR_EXTERNAL external_declaration_list END_VAR |
4043 VAR_EXTERNAL external_declaration_list END_VAR |
2927 {$$ = new external_var_declarations_c(NULL, $2, locloc(@$));} |
4044 {$$ = new external_var_declarations_c(NULL, $2, locloc(@$));} |
2928 | VAR_EXTERNAL CONSTANT external_declaration_list END_VAR |
4045 | VAR_EXTERNAL CONSTANT external_declaration_list END_VAR |
2929 {$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
4046 {$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
2930 /* ERROR_CHECK_BEGIN */ |
4047 /* ERROR_CHECK_BEGIN */ |
|
4048 | VAR_EXTERNAL END_VAR |
|
4049 {$$ = NULL; |
|
4050 yynerrs++; |
|
4051 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in external variable(s) declaration."); |
|
4052 } |
|
4053 | VAR_EXTERNAL CONSTANT END_VAR |
|
4054 {$$ = NULL; |
|
4055 yynerrs++; |
|
4056 print_err_msg(current_filename, locf(@1), locl(@3), "no variable declared in constant external variable(s) declaration."); |
|
4057 } |
|
4058 | VAR_EXTERNAL error external_declaration_list END_VAR |
|
4059 {$$ = NULL; |
|
4060 print_err_msg(current_filename, locf(@1), locl(@4), "unexpected token after 'VAR_EXTERNAL' in external variable(s) declaration."); |
|
4061 yyerrok; |
|
4062 } |
|
4063 | VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR |
|
4064 {$$ = NULL; |
|
4065 print_err_msg(current_filename, locf(@2), locl(@5), "unexpected token after 'CONSTANT' in constant external variable(s) declaration."); |
|
4066 yyerrok; |
|
4067 } |
2931 | VAR_EXTERNAL error END_VAR |
4068 | VAR_EXTERNAL error END_VAR |
2932 {$$ = NULL; |
4069 {$$ = NULL; |
2933 print_err_msg(current_filename, locf(@1), locl(@3), "error in external variable(s) declaration."); |
4070 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in external variable(s) declaration."); |
2934 /* yychar */ |
4071 yyerrok; |
|
4072 } |
|
4073 | VAR_EXTERNAL CONSTANT error END_VAR |
|
4074 {$$ = NULL; |
|
4075 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in constant external variable(s) declaration."); |
2935 yyerrok; |
4076 yyerrok; |
2936 } |
4077 } |
2937 /* ERROR_CHECK_END */ |
4078 /* ERROR_CHECK_END */ |
2938 ; |
4079 ; |
2939 |
4080 |
2940 /* helper symbol for external_var_declarations */ |
4081 /* helper symbol for external_var_declarations */ |
2941 external_declaration_list: |
4082 external_declaration_list: |
2942 external_declaration ';' |
4083 external_declaration ';' |
2943 {$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);} |
4084 {$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);} |
2944 | external_declaration_list external_declaration';' |
4085 | external_declaration_list external_declaration ';' |
2945 {$$ = $1; $$->add_element($2);} |
4086 {$$ = $1; $$->add_element($2);} |
|
4087 /* ERROR_CHECK_BEGIN */ |
|
4088 | external_declaration error |
|
4089 {$$ = NULL; |
|
4090 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of external variable declaration."); |
|
4091 yyerrok; |
|
4092 } |
|
4093 | external_declaration_list external_declaration error |
|
4094 {$$ = NULL; |
|
4095 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of external variable declaration."); |
|
4096 yyerrok; |
|
4097 } |
|
4098 | external_declaration_list ';' |
|
4099 {$$ = NULL; |
|
4100 yynerrs++; |
|
4101 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after external variable declaration."); |
|
4102 } |
|
4103 /* ERROR_CHECK_END */ |
2946 ; |
4104 ; |
2947 |
4105 |
2948 |
4106 |
2949 external_declaration: |
4107 external_declaration: |
2950 global_var_name ':' simple_specification |
4108 global_var_name ':' simple_specification |
2983 | VAR_GLOBAL CONSTANT global_var_decl_list END_VAR |
4183 | VAR_GLOBAL CONSTANT global_var_decl_list END_VAR |
2984 {$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
4184 {$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
2985 | VAR_GLOBAL RETAIN global_var_decl_list END_VAR |
4185 | VAR_GLOBAL RETAIN global_var_decl_list END_VAR |
2986 {$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
4186 {$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
2987 /* ERROR_CHECK_BEGIN */ |
4187 /* ERROR_CHECK_BEGIN */ |
|
4188 | VAR_GLOBAL END_VAR |
|
4189 {$$ = NULL; |
|
4190 yynerrs++; |
|
4191 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in global variable(s) declaration."); |
|
4192 } |
|
4193 | VAR_GLOBAL CONSTANT END_VAR |
|
4194 {$$ = NULL; |
|
4195 yynerrs++; |
|
4196 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in constant global variable(s) declaration."); |
|
4197 } |
|
4198 | VAR_GLOBAL RETAIN END_VAR |
|
4199 {$$ = NULL; |
|
4200 yynerrs++; |
|
4201 print_err_msg(current_filename, locf(@2), locl(@3), "no variable declared in retentive global variable(s) declaration."); |
|
4202 } |
|
4203 | VAR_GLOBAL error global_var_decl_list END_VAR |
|
4204 {$$ = NULL; |
|
4205 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_GLOBAL' in global variable(s) declaration."); |
|
4206 yyerrok; |
|
4207 } |
|
4208 | VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR |
|
4209 {$$ = NULL; |
|
4210 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant global variable(s) declaration."); |
|
4211 yyerrok; |
|
4212 } |
|
4213 | VAR_GLOBAL RETAIN error global_var_decl_list END_VAR |
|
4214 {$$ = NULL; |
|
4215 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive global variable(s) declaration."); |
|
4216 yyerrok; |
|
4217 } |
2988 | VAR_GLOBAL error END_VAR |
4218 | VAR_GLOBAL error END_VAR |
2989 {$$ = NULL; |
4219 {$$ = NULL; |
2990 print_err_msg(current_filename, locf(@1), locl(@3), "error in global variable(s) declaration."); |
4220 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in global variable(s) declaration."); |
2991 /* yychar */ |
4221 yyerrok; |
|
4222 } |
|
4223 | VAR_GLOBAL CONSTANT error END_VAR |
|
4224 {$$ = NULL; |
|
4225 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in constant global variable(s) declaration."); |
|
4226 yyerrok; |
|
4227 } |
|
4228 | VAR_GLOBAL RETAIN error END_VAR |
|
4229 {$$ = NULL; |
|
4230 print_err_msg(current_filename, locf(@2), locl(@4), "unknown error in constant global variable(s) declaration."); |
2992 yyerrok; |
4231 yyerrok; |
2993 } |
4232 } |
2994 /* ERROR_CHECK_END */ |
4233 /* ERROR_CHECK_END */ |
2995 ; |
4234 ; |
2996 |
4235 |
2999 global_var_decl_list: |
4238 global_var_decl_list: |
3000 global_var_decl ';' |
4239 global_var_decl ';' |
3001 {$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);} |
4240 {$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);} |
3002 | global_var_decl_list global_var_decl ';' |
4241 | global_var_decl_list global_var_decl ';' |
3003 {$$ = $1; $$->add_element($2);} |
4242 {$$ = $1; $$->add_element($2);} |
|
4243 /* ERROR_CHECK_BEGIN */ |
|
4244 | global_var_decl error |
|
4245 {$$ = NULL; |
|
4246 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of global variable declaration."); |
|
4247 yyerrok; |
|
4248 } |
|
4249 | global_var_decl_list global_var_decl error |
|
4250 {$$ = NULL; |
|
4251 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of global variable declaration."); |
|
4252 yyerrok; |
|
4253 } |
|
4254 | global_var_decl_list ';' |
|
4255 {$$ = NULL; |
|
4256 yynerrs++; |
|
4257 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after global variable declaration."); |
|
4258 } |
|
4259 /* ERROR_CHECK_END */ |
3004 ; |
4260 ; |
3005 |
4261 |
3006 |
4262 |
3007 global_var_decl: |
4263 global_var_decl: |
|
4264 /* NOTE : This possibility defined in standard has no sense and generate a conflict (disabled) |
3008 global_var_spec ':' |
4265 global_var_spec ':' |
3009 {$$ = new global_var_decl_c($1, NULL, locloc(@$));} |
4266 {$$ = new global_var_decl_c($1, NULL, locloc(@$));} |
3010 | global_var_spec ':' located_var_spec_init |
4267 */ |
|
4268 global_var_spec ':' located_var_spec_init |
3011 {$$ = new global_var_decl_c($1, $3, locloc(@$));} |
4269 {$$ = new global_var_decl_c($1, $3, locloc(@$));} |
3012 | global_var_spec ':' function_block_type_name |
4270 | global_var_spec ':' function_block_type_name |
3013 {$$ = new global_var_decl_c($1, $3, locloc(@$));} |
4271 {$$ = new global_var_decl_c($1, $3, locloc(@$));} |
|
4272 /* ERROR_CHECK_BEGIN */ |
|
4273 | global_var_list located_var_spec_init |
|
4274 {$$ = NULL; |
|
4275 yynerrs++; |
|
4276 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between global variable list and type specification."); |
|
4277 } |
|
4278 | global_var_name location located_var_spec_init |
|
4279 {$$ = NULL; |
|
4280 yynerrs++; |
|
4281 print_err_msg(current_filename, locf(@3), locl(@3), "':' missing between global variable specification and type specification."); |
|
4282 } |
|
4283 | global_var_spec function_block_type_name |
|
4284 {$$ = NULL; |
|
4285 yynerrs++; |
|
4286 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between global variable specification and function block type specification."); |
|
4287 } |
|
4288 | global_var_spec ':' identifier |
|
4289 {$$ = NULL; |
|
4290 yynerrs++; |
|
4291 print_err_msg(current_filename, locf(@3), locl(@3), "unknown variable type defined in global variable declaration."); |
|
4292 } |
|
4293 | global_var_spec ':' error |
|
4294 {$$ = NULL; |
|
4295 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in global variable declaration."); |
|
4296 yyerrok; |
|
4297 } |
|
4298 /* ERROR_CHECK_END */ |
3014 ; |
4299 ; |
3015 |
4300 |
3016 |
4301 |
3017 global_var_spec: |
4302 global_var_spec: |
3018 global_var_list {$$ = $1;} |
4303 global_var_list {$$ = $1;} |
3109 | STRING ASSIGN single_byte_character_string |
4419 | STRING ASSIGN single_byte_character_string |
3110 {$$ = new single_byte_string_spec_c(NULL, $3, locloc(@$));} |
4420 {$$ = new single_byte_string_spec_c(NULL, $3, locloc(@$));} |
3111 */ |
4421 */ |
3112 | STRING '[' integer ']' ASSIGN single_byte_character_string |
4422 | STRING '[' integer ']' ASSIGN single_byte_character_string |
3113 {$$ = new single_byte_string_spec_c($3, $6, locloc(@$));} |
4423 {$$ = new single_byte_string_spec_c($3, $6, locloc(@$));} |
|
4424 /* ERROR_CHECK_BEGIN */ |
|
4425 | STRING '[' error ']' |
|
4426 {$$ = NULL; |
|
4427 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited string type specification."); |
|
4428 yyerrok; |
|
4429 } |
|
4430 | STRING '[' error ']' ASSIGN single_byte_character_string |
|
4431 {$$ = NULL; |
|
4432 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited string type specification."); |
|
4433 yyerrok; |
|
4434 } |
|
4435 | STRING '[' ']' |
|
4436 {$$ = NULL; |
|
4437 yynerrs++; |
|
4438 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited string type specification."); |
|
4439 } |
|
4440 | STRING '[' ']' ASSIGN single_byte_character_string |
|
4441 {$$ = NULL; |
|
4442 yynerrs++; |
|
4443 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited string type specification."); |
|
4444 } |
|
4445 | STRING '[' integer error |
|
4446 {$$ = NULL; |
|
4447 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ']' after length definition for limited string type specification."); |
|
4448 yyerrok; |
|
4449 } |
|
4450 | STRING '[' integer error ASSIGN single_byte_character_string |
|
4451 {$$ = NULL; |
|
4452 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ']' after length definition for limited string type specification."); |
|
4453 yyerrok; |
|
4454 } |
|
4455 | STRING '[' integer ']' single_byte_character_string |
|
4456 {$$ = NULL; |
|
4457 yynerrs++; |
|
4458 print_err_msg(current_filename, locf(@4), locl(@5), "':=' missing before limited string type initialization."); |
|
4459 } |
|
4460 | STRING '[' integer ']' ASSIGN error |
|
4461 {$$ = NULL; |
|
4462 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for limited string type initialization."); |
|
4463 yyerrok; |
|
4464 } |
|
4465 /* ERROR_CHECK_END */ |
3114 ; |
4466 ; |
3115 |
4467 |
3116 |
4468 |
3117 double_byte_string_var_declaration: |
4469 double_byte_string_var_declaration: |
3118 var1_list ':' double_byte_string_spec |
4470 var1_list ':' double_byte_string_spec |
3119 {$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));} |
4471 {$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));} |
|
4472 /* ERROR_CHECK_BEGIN */ |
|
4473 | var1_list double_byte_string_spec |
|
4474 {$$ = NULL; |
|
4475 yynerrs++; |
|
4476 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between variable list and double byte string type specification."); |
|
4477 } |
|
4478 /* ERROR_CHECK_END */ |
3120 ; |
4479 ; |
3121 |
4480 |
3122 double_byte_string_spec: |
4481 double_byte_string_spec: |
3123 /* WSTRING |
4482 /* WSTRING |
3124 {$$ = new double_byte_string_spec_c(NULL, NULL, locloc(@$));} |
4483 {$$ = new double_byte_string_spec_c(NULL, NULL, locloc(@$));} |
3129 | WSTRING ASSIGN double_byte_character_string |
4488 | WSTRING ASSIGN double_byte_character_string |
3130 {$$ = new double_byte_string_spec_c(NULL, $3, locloc(@$));} |
4489 {$$ = new double_byte_string_spec_c(NULL, $3, locloc(@$));} |
3131 */ |
4490 */ |
3132 | WSTRING '[' integer ']' ASSIGN double_byte_character_string |
4491 | WSTRING '[' integer ']' ASSIGN double_byte_character_string |
3133 {$$ = new double_byte_string_spec_c($3, $6, locloc(@$));} |
4492 {$$ = new double_byte_string_spec_c($3, $6, locloc(@$));} |
|
4493 /* ERROR_CHECK_BEGIN */ |
|
4494 | WSTRING '[' error ']' |
|
4495 {$$ = NULL; |
|
4496 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited double byte string type specification."); |
|
4497 yyerrok; |
|
4498 } |
|
4499 | WSTRING '[' error ']' ASSIGN single_byte_character_string |
|
4500 {$$ = NULL; |
|
4501 print_err_msg(current_filename, locf(@2), locl(@4), "invalid length value for limited double byte string type specification."); |
|
4502 yyerrok; |
|
4503 } |
|
4504 | WSTRING '[' ']' |
|
4505 {$$ = NULL; |
|
4506 yynerrs++; |
|
4507 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited double byte string type specification."); |
|
4508 } |
|
4509 | WSTRING '[' ']' ASSIGN single_byte_character_string |
|
4510 {$$ = NULL; |
|
4511 yynerrs++; |
|
4512 print_err_msg(current_filename, locf(@2), locl(@3), "missing length value for limited double byte string type specification."); |
|
4513 } |
|
4514 | WSTRING '[' integer error |
|
4515 {$$ = NULL; |
|
4516 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ']' after length definition for limited double byte string type specification."); |
|
4517 yyerrok; |
|
4518 } |
|
4519 | WSTRING '[' integer error ASSIGN single_byte_character_string |
|
4520 {$$ = NULL; |
|
4521 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ']' after length definition for limited double byte string type specification."); |
|
4522 yyerrok; |
|
4523 } |
|
4524 | WSTRING '[' integer ']' single_byte_character_string |
|
4525 {$$ = NULL; |
|
4526 yynerrs++; |
|
4527 print_err_msg(current_filename, locf(@4), locl(@5), "':=' missing before limited double byte string type initialization."); |
|
4528 } |
|
4529 | WSTRING '[' integer ']' ASSIGN error |
|
4530 {$$ = NULL; |
|
4531 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for limited double byte string type initialization."); |
|
4532 yyerrok; |
|
4533 } |
|
4534 /* ERROR_CHECK_END */ |
3134 ; |
4535 ; |
3135 |
4536 |
3136 |
4537 |
3137 |
4538 |
3138 incompl_located_var_declarations: |
4539 incompl_located_var_declarations: |
3140 {$$ = new incompl_located_var_declarations_c(NULL, $2, locloc(@$));} |
4541 {$$ = new incompl_located_var_declarations_c(NULL, $2, locloc(@$));} |
3141 | VAR RETAIN incompl_located_var_decl_list END_VAR |
4542 | VAR RETAIN incompl_located_var_decl_list END_VAR |
3142 {$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
4543 {$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} |
3143 | VAR NON_RETAIN incompl_located_var_decl_list END_VAR |
4544 | VAR NON_RETAIN incompl_located_var_decl_list END_VAR |
3144 {$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
4545 {$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} |
|
4546 /* ERROR_CHECK_BEGIN */ |
|
4547 | VAR error incompl_located_var_decl_list END_VAR |
|
4548 {$$ = NULL; |
|
4549 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in incomplete located variable(s) declaration."); |
|
4550 yyerrok; |
|
4551 } |
|
4552 | VAR RETAIN error incompl_located_var_decl_list END_VAR |
|
4553 {$$ = NULL; |
|
4554 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); |
|
4555 yyerrok; |
|
4556 } |
|
4557 | VAR NON_RETAIN error incompl_located_var_decl_list END_VAR |
|
4558 {$$ = NULL; |
|
4559 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); |
|
4560 yyerrok; |
|
4561 } |
|
4562 /* ERROR_CHECK_END */ |
3145 ; |
4563 ; |
3146 |
4564 |
3147 /* helper symbol for incompl_located_var_declarations */ |
4565 /* helper symbol for incompl_located_var_declarations */ |
3148 incompl_located_var_decl_list: |
4566 incompl_located_var_decl_list: |
3149 incompl_located_var_decl ';' |
4567 incompl_located_var_decl ';' |
3150 {$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);} |
4568 {$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);} |
3151 | incompl_located_var_decl_list incompl_located_var_decl ';' |
4569 | incompl_located_var_decl_list incompl_located_var_decl ';' |
3152 {$$ = $1; $$->add_element($2);} |
4570 {$$ = $1; $$->add_element($2);} |
|
4571 /* ERROR_CHECK_BEGIN */ |
|
4572 | incompl_located_var_decl error |
|
4573 {$$ = NULL; |
|
4574 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of incomplete located variable declaration."); |
|
4575 yyerrok; |
|
4576 } |
|
4577 | incompl_located_var_decl_list incompl_located_var_decl error |
|
4578 {$$ = NULL; |
|
4579 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of incomplete located variable declaration."); |
|
4580 yyerrok; |
|
4581 } |
|
4582 | incompl_located_var_decl_list ';' |
|
4583 {$$ = NULL; |
|
4584 yynerrs++; |
|
4585 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after incomplete located variable declaration."); |
|
4586 } |
|
4587 /* ERROR_CHECK_END */ |
3153 ; |
4588 ; |
3154 |
4589 |
3155 |
4590 |
3156 incompl_located_var_decl: |
4591 incompl_located_var_decl: |
3157 variable_name incompl_location ':' var_spec |
4592 variable_name incompl_location ':' var_spec |
3158 {$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));} |
4593 {$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));} |
|
4594 /* ERROR_CHECK_BEGIN */ |
|
4595 | variable_name incompl_location ':' error |
|
4596 {$$ = NULL; |
|
4597 print_err_msg(current_filename, locf(@2), locl(@2), "no specification defined in incomplete located variable declaration."); |
|
4598 yyerrok; |
|
4599 } |
|
4600 | variable_name incompl_location var_spec |
|
4601 {$$ = NULL; |
|
4602 yynerrs++; |
|
4603 print_err_msg(current_filename, locf(@2), locl(@2), "':' missing between incomplete located variable and type specification."); |
|
4604 } |
|
4605 /* ERROR_CHECK_END */ |
3159 ; |
4606 ; |
3160 |
4607 |
3161 |
4608 |
3162 incompl_location: |
4609 incompl_location: |
3163 AT incompl_location_token |
4610 AT incompl_location_token |
3421 } else { |
4875 } else { |
3422 library_element_symtable.insert($1, prev_declared_derived_function_name_token); |
4876 library_element_symtable.insert($1, prev_declared_derived_function_name_token); |
3423 } |
4877 } |
3424 } |
4878 } |
3425 /* ERROR_CHECK_BEGIN */ |
4879 /* ERROR_CHECK_BEGIN */ |
3426 | FUNCTION error END_FUNCTION |
4880 | function_name_declaration elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION |
3427 {$$ = NULL; |
4881 {$$ = NULL; |
3428 print_err_msg(current_filename, locf(@1), locl(@3), "error in function declaration."); |
4882 yynerrs++; |
3429 /* yychar */ |
4883 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing after function name in function declaration."); |
|
4884 } |
|
4885 | function_name_declaration derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION |
|
4886 {$$ = NULL; |
|
4887 yynerrs++; |
|
4888 print_err_msg(current_filename, locf(@1), locl(@2), "':' missing after function name in function declaration."); |
|
4889 } |
|
4890 | function_name_declaration error derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION |
|
4891 {$$ = NULL; |
|
4892 print_err_msg(current_filename, locf(@1), locl(@3), "expecting ':' after function name in function declaration."); |
|
4893 yyerrok; |
|
4894 } |
|
4895 | function_name_declaration ':' io_OR_function_var_declarations_list function_body END_FUNCTION |
|
4896 {$$ = NULL; |
|
4897 yynerrs++; |
|
4898 print_err_msg(current_filename, locf(@2), locl(@3), "no return type defined in function declaration."); |
|
4899 } |
|
4900 | function_name_declaration ':' error io_OR_function_var_declarations_list function_body END_FUNCTION |
|
4901 {$$ = NULL; |
|
4902 print_err_msg(current_filename, locf(@2), locl(@4), "invalid return type defined in function declaration."); |
|
4903 yyerrok; |
|
4904 } |
|
4905 | function_name_declaration ':' identifier io_OR_function_var_declarations_list function_body END_FUNCTION |
|
4906 {$$ = NULL; |
|
4907 yynerrs++; |
|
4908 print_err_msg(current_filename, locf(@2), locl(@4), "unknown return type defined in function declaration."); |
|
4909 } |
|
4910 | function_name_declaration ':' elementary_type_name function_body END_FUNCTION |
|
4911 {$$ = NULL; |
|
4912 yynerrs++; |
|
4913 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared in function declaration."); |
|
4914 } |
|
4915 | function_name_declaration ':' derived_type_name function_body END_FUNCTION |
|
4916 {$$ = NULL; |
|
4917 yynerrs++; |
|
4918 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared in function declaration."); |
|
4919 } |
|
4920 | function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list END_FUNCTION |
|
4921 {$$ = NULL; |
|
4922 yynerrs++; |
|
4923 print_err_msg(current_filename, locf(@4), locl(@5), "no body defined in function declaration."); |
|
4924 } |
|
4925 | function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list END_FUNCTION |
|
4926 {$$ = NULL; |
|
4927 yynerrs++; |
|
4928 print_err_msg(current_filename, locf(@4), locl(@5), "no body defined in function declaration."); |
|
4929 } |
|
4930 | function_name_declaration ':' elementary_type_name END_FUNCTION |
|
4931 {$$ = NULL; |
|
4932 yynerrs++; |
|
4933 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared and body defined in function declaration."); |
|
4934 } |
|
4935 | function_name_declaration ':' derived_type_name END_FUNCTION |
|
4936 {$$ = NULL; |
|
4937 yynerrs++; |
|
4938 print_err_msg(current_filename, locf(@3), locl(@4), "no variable(s) declared and body defined in function declaration."); |
|
4939 } |
|
4940 | function_name_declaration error END_FUNCTION |
|
4941 {$$ = NULL; |
|
4942 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in function declaration."); |
3430 yyerrok; |
4943 yyerrok; |
3431 } |
4944 } |
3432 /* ERROR_CHECK_END */ |
4945 /* ERROR_CHECK_END */ |
3433 ; |
4946 ; |
3434 |
4947 |
3501 function_var_decls: |
5030 function_var_decls: |
3502 VAR CONSTANT var2_init_decl_list END_VAR |
5031 VAR CONSTANT var2_init_decl_list END_VAR |
3503 {$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
5032 {$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} |
3504 | VAR var2_init_decl_list END_VAR |
5033 | VAR var2_init_decl_list END_VAR |
3505 {$$ = new function_var_decls_c(NULL, $2, locloc(@$));} |
5034 {$$ = new function_var_decls_c(NULL, $2, locloc(@$));} |
|
5035 /* ERROR_CHECK_BEGIN */ |
|
5036 | VAR error var_init_decl_list END_VAR |
|
5037 {$$ = NULL; |
|
5038 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR' in function variable(s) declaration."); |
|
5039 yyerrok; |
|
5040 } |
|
5041 | VAR CONSTANT error var_init_decl_list END_VAR |
|
5042 {$$ = NULL; |
|
5043 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'CONSTANT' in constant function variable(s) declaration."); |
|
5044 yyerrok; |
|
5045 } |
|
5046 /* ERROR_CHECK_END */ |
3506 ; |
5047 ; |
3507 |
5048 |
3508 /* intermediate helper symbol for function_var_decls */ |
5049 /* intermediate helper symbol for function_var_decls */ |
3509 var2_init_decl_list: |
5050 var2_init_decl_list: |
3510 var2_init_decl ';' |
5051 var2_init_decl ';' |
3511 {$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);} |
5052 {$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);} |
3512 | var2_init_decl_list var2_init_decl ';' |
5053 | var2_init_decl_list var2_init_decl ';' |
3513 {$$ = $1; $$->add_element($2);} |
5054 {$$ = $1; $$->add_element($2);} |
|
5055 /* ERROR_CHECK_BEGIN */ |
|
5056 | var2_init_decl error |
|
5057 {$$ = NULL; |
|
5058 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of function variable(s) declaration."); |
|
5059 yyerrok; |
|
5060 } |
|
5061 | var2_init_decl_list var2_init_decl error |
|
5062 {$$ = NULL; |
|
5063 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of function variable(s) declaration."); |
|
5064 yyerrok; |
|
5065 } |
|
5066 | var2_init_decl_list ';' |
|
5067 {$$ = NULL; |
|
5068 yynerrs++; |
|
5069 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after function variable(s) declaration."); |
|
5070 } |
|
5071 /* ERROR_CHECK_END */ |
3514 ; |
5072 ; |
3515 |
5073 |
3516 |
5074 |
3517 function_body: |
5075 function_body: |
3518 statement_list {$$ = $1;} /* if we leave it for the default action we get a type clash! */ |
5076 statement_list {$$ = $1;} /* if we leave it for the default action we get a type clash! */ |
3605 | non_retentive_var_decls |
5196 | non_retentive_var_decls |
3606 | external_var_declarations |
5197 | external_var_declarations |
3607 | var_declarations |
5198 | var_declarations |
3608 | retentive_var_declarations |
5199 | retentive_var_declarations |
3609 | incompl_located_var_declarations |
5200 | incompl_located_var_declarations |
3610 /* TODO: the following error rule is not working! Must be fixed. */ |
|
3611 /* ERROR_CHECK_BEGIN */ |
|
3612 | VAR error END_VAR |
|
3613 {$$ = NULL; |
|
3614 print_err_msg(current_filename, locf(@1), locl(@3), "error in variable(s) declaration."); |
|
3615 /* yychar */ |
|
3616 yyerrok; |
|
3617 } |
|
3618 /* ERROR_CHECK_END */ |
|
3619 ; |
5201 ; |
3620 |
5202 |
3621 |
5203 |
3622 temp_var_decls: |
5204 temp_var_decls: |
3623 VAR_TEMP temp_var_decls_list END_VAR |
5205 VAR_TEMP temp_var_decls_list END_VAR |
3624 {$$ = new temp_var_decls_c($2, locloc(@$));} |
5206 {$$ = new temp_var_decls_c($2, locloc(@$));} |
|
5207 /* ERROR_CHECK_BEGIN */ |
|
5208 | VAR_TEMP END_VAR |
|
5209 {$$ = NULL; |
|
5210 yynerrs++; |
|
5211 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in temporary variable(s) declaration."); |
|
5212 } |
|
5213 | VAR_TEMP error temp_var_decls_list END_VAR |
|
5214 {$$ = NULL; |
|
5215 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_TEMP' in function variable(s) declaration."); |
|
5216 yyerrok; |
|
5217 } |
|
5218 /* ERROR_CHECK_END */ |
3625 ; |
5219 ; |
3626 |
5220 |
3627 |
5221 |
3628 /* intermediate helper symbol for temp_var_decls */ |
5222 /* intermediate helper symbol for temp_var_decls */ |
3629 temp_var_decls_list: |
5223 temp_var_decls_list: |
3630 temp_var_decl ';' |
5224 temp_var_decl ';' |
3631 {$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);} |
5225 {$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);} |
3632 | temp_var_decls_list temp_var_decl ';' |
5226 | temp_var_decls_list temp_var_decl ';' |
3633 {$$ = $1; $$->add_element($2);} |
5227 {$$ = $1; $$->add_element($2);} |
|
5228 /* ERROR_CHECK_BEGIN */ |
|
5229 | temp_var_decl error |
|
5230 {$$ = NULL; |
|
5231 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at end of temporary variable declaration."); |
|
5232 yyerrok; |
|
5233 } |
|
5234 | temp_var_decls_list temp_var_decl error |
|
5235 {$$ = NULL; |
|
5236 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of temporary variable declaration."); |
|
5237 yyerrok; |
|
5238 } |
|
5239 | temp_var_decls_list ';' |
|
5240 {$$ = NULL; |
|
5241 yynerrs++; |
|
5242 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after temporary variable declaration."); |
|
5243 } |
|
5244 /* ERROR_CHECK_END */ |
3634 ; |
5245 ; |
3635 |
5246 |
3636 |
5247 |
3637 non_retentive_var_decls: |
5248 non_retentive_var_decls: |
3638 VAR NON_RETAIN var_init_decl_list END_VAR |
5249 VAR NON_RETAIN var_init_decl_list END_VAR |
3639 {$$ = new non_retentive_var_decls_c($3, locloc(@$));} |
5250 {$$ = new non_retentive_var_decls_c($3, locloc(@$));} |
|
5251 /* ERROR_CHECK_BEGIN */ |
|
5252 | VAR NON_RETAIN error var_init_decl_list END_VAR |
|
5253 {$$ = NULL; |
|
5254 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive temporary variable(s) declaration."); |
|
5255 yyerrok; |
|
5256 } |
|
5257 /* ERROR_CHECK_END */ |
3640 ; |
5258 ; |
3641 |
5259 |
3642 |
5260 |
3643 |
5261 |
3644 function_block_body: |
5262 function_block_body: |
3745 {$$ = $1; $$->add_element($2);} |
5398 {$$ = $1; $$->add_element($2);} |
3746 | sfc_network transition |
5399 | sfc_network transition |
3747 {$$ = $1; $$->add_element($2);} |
5400 {$$ = $1; $$->add_element($2);} |
3748 | sfc_network action |
5401 | sfc_network action |
3749 {$$ = $1; $$->add_element($2);} |
5402 {$$ = $1; $$->add_element($2);} |
|
5403 /* ERROR_CHECK_BEGIN */ |
|
5404 | sfc_network error |
|
5405 {$$ = NULL; |
|
5406 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected token after SFC network in sequencial function chart."); |
|
5407 yyerrok; |
|
5408 } |
|
5409 /* ERROR_CHECK_END */ |
3750 ; |
5410 ; |
3751 |
5411 |
3752 initial_step: |
5412 initial_step: |
3753 INITIAL_STEP step_name ':' action_association_list END_STEP |
5413 INITIAL_STEP step_name ':' action_association_list END_STEP |
3754 // INITIAL_STEP identifier ':' action_association_list END_STEP |
5414 // INITIAL_STEP identifier ':' action_association_list END_STEP |
3755 {$$ = new initial_step_c($2, $4, locloc(@$));} |
5415 {$$ = new initial_step_c($2, $4, locloc(@$));} |
|
5416 /* ERROR_CHECK_BEGIN */ |
|
5417 | INITIAL_STEP ':' action_association_list END_STEP |
|
5418 {$$ = NULL; |
|
5419 yynerrs++; |
|
5420 print_err_msg(current_filename, locf(@1), locl(@2), "no step name defined in initial step declaration."); |
|
5421 } |
|
5422 | INITIAL_STEP error ':' action_association_list END_STEP |
|
5423 {$$ = NULL; |
|
5424 print_err_msg(current_filename, locf(@1), locl(@3), "invalid step name defined in initial step declaration."); |
|
5425 yyerrok; |
|
5426 } |
|
5427 | INITIAL_STEP step_name action_association_list END_STEP |
|
5428 {$$ = NULL; |
|
5429 yynerrs++; |
|
5430 print_err_msg(current_filename, locf(@2), locl(@3), "':' missing after step name in initial step declaration."); |
|
5431 } |
|
5432 | INITIAL_STEP step_name error action_association_list END_STEP |
|
5433 {$$ = NULL; |
|
5434 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':' after step name in initial step declaration."); |
|
5435 yyerrok; |
|
5436 } |
|
5437 | INITIAL_STEP step_name ':' error END_STEP |
|
5438 {$$ = NULL; |
|
5439 print_err_msg(current_filename, locf(@2), locl(@4), "invalid action association list in initial step declaration."); |
|
5440 yyerrok; |
|
5441 } |
|
5442 | INITIAL_STEP error END_STEP |
|
5443 {$$ = NULL; |
|
5444 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in initial step declaration."); |
|
5445 yyerrok; |
|
5446 } |
|
5447 /* ERROR_CHECK_END */ |
3756 ; |
5448 ; |
3757 |
5449 |
3758 step: |
5450 step: |
3759 STEP step_name ':' action_association_list END_STEP |
5451 STEP step_name ':' action_association_list END_STEP |
3760 // STEP identifier ':' action_association_list END_STEP |
5452 // STEP identifier ':' action_association_list END_STEP |
3761 {$$ = new step_c($2, $4, locloc(@$));} |
5453 {$$ = new step_c($2, $4, locloc(@$));} |
|
5454 /* ERROR_CHECK_BEGIN */ |
|
5455 | STEP ':' action_association_list END_STEP |
|
5456 {$$ = NULL; |
|
5457 yynerrs++; |
|
5458 print_err_msg(current_filename, locf(@1), locl(@2), "no step name defined in step declaration."); |
|
5459 } |
|
5460 | STEP error ':' action_association_list END_STEP |
|
5461 {$$ = NULL; |
|
5462 print_err_msg(current_filename, locf(@1), locl(@3), "invalid step name defined in step declaration."); |
|
5463 yyerrok; |
|
5464 } |
|
5465 | STEP step_name action_association_list END_STEP |
|
5466 {$$ = NULL; |
|
5467 yynerrs++; |
|
5468 print_err_msg(current_filename, locf(@2), locl(@3), "':' missing after step name in step declaration."); |
|
5469 } |
|
5470 | STEP step_name error action_association_list END_STEP |
|
5471 {$$ = NULL; |
|
5472 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':' after step name in step declaration."); |
|
5473 yyerrok; |
|
5474 } |
|
5475 | STEP step_name ':' error END_STEP |
|
5476 {$$ = NULL; |
|
5477 print_err_msg(current_filename, locf(@2), locl(@4), "invalid action association list in step declaration."); |
|
5478 yyerrok; |
|
5479 } |
|
5480 | STEP error END_STEP |
|
5481 {$$ = NULL; |
|
5482 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in step declaration."); |
|
5483 yyerrok; |
|
5484 } |
|
5485 /* ERROR_CHECK_END */ |
3762 ; |
5486 ; |
3763 |
5487 |
3764 /* helper symbol for: |
5488 /* helper symbol for: |
3765 * - initial_step |
5489 * - initial_step |
3766 * - step |
5490 * - step |
3768 action_association_list: |
5492 action_association_list: |
3769 /* empty */ |
5493 /* empty */ |
3770 {$$ = new action_association_list_c(locloc(@$));} |
5494 {$$ = new action_association_list_c(locloc(@$));} |
3771 | action_association_list action_association ';' |
5495 | action_association_list action_association ';' |
3772 {$$ = $1; $$->add_element($2);} |
5496 {$$ = $1; $$->add_element($2);} |
|
5497 /* ERROR_CHECK_BEGIN */ |
|
5498 | action_association_list action_association error |
|
5499 {$$ = NULL; |
|
5500 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at end of action association declaration."); |
|
5501 yyerrok; |
|
5502 } |
|
5503 | action_association_list ';' |
|
5504 {$$ = NULL; |
|
5505 yynerrs++; |
|
5506 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after action association declaration."); |
|
5507 } |
|
5508 /* ERROR_CHECK_END */ |
3773 ; |
5509 ; |
3774 |
5510 |
3775 |
5511 |
3776 // step_name: identifier; |
5512 // step_name: identifier; |
3777 step_name: any_identifier; |
5513 step_name: any_identifier; |
3778 |
5514 |
3779 action_association: |
5515 action_association: |
3780 action_name '(' {cmd_goto_sfc_qualifier_state()} action_qualifier {cmd_pop_state()} indicator_name_list ')' |
5516 action_name '(' {cmd_goto_sfc_qualifier_state()} action_qualifier {cmd_pop_state()} indicator_name_list ')' |
3781 {$$ = new action_association_c($1, $4, $6, locloc(@$));} |
5517 {$$ = new action_association_c($1, $4, $6, locloc(@$));} |
|
5518 /* ERROR_CHECK_BEGIN */ |
|
5519 /*| action_name '(' error indicator_name_list ')' |
|
5520 {$$ = NULL; |
|
5521 print_err_msg(current_filename, locf(@2), locl(@4), "invalid qualifier defined in action association."); |
|
5522 yyerrok; |
|
5523 }*/ |
|
5524 /* ERROR_CHECK_END */ |
3782 ; |
5525 ; |
3783 |
5526 |
3784 /* helper symbol for action_association */ |
5527 /* helper symbol for action_association */ |
3785 indicator_name_list: |
5528 indicator_name_list: |
3786 /* empty */ |
5529 /* empty */ |
3787 {$$ = new indicator_name_list_c(locloc(@$));} |
5530 {$$ = new indicator_name_list_c(locloc(@$));} |
3788 | indicator_name_list ',' indicator_name |
5531 | indicator_name_list ',' indicator_name |
3789 {$$ = $1; $$->add_element($3);} |
5532 {$$ = $1; $$->add_element($3);} |
|
5533 /* ERROR_CHECK_BEGIN */ |
|
5534 | indicator_name_list indicator_name |
|
5535 {$$ = NULL; |
|
5536 yynerrs++; |
|
5537 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing at end of action association declaration."); |
|
5538 } |
|
5539 | indicator_name_list ',' error |
|
5540 {$$ = NULL; |
|
5541 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after ',' in indicator list."); |
|
5542 yyerrok; |
|
5543 } |
|
5544 /* ERROR_CHECK_END */ |
3790 ; |
5545 ; |
3791 |
5546 |
3792 // action_name: identifier; |
5547 // action_name: identifier; |
3793 action_name: any_identifier; |
5548 action_name: any_identifier; |
3794 |
5549 |
3830 steps: |
5597 steps: |
3831 step_name |
5598 step_name |
3832 {$$ = new steps_c($1, NULL, locloc(@$));} |
5599 {$$ = new steps_c($1, NULL, locloc(@$));} |
3833 | '(' step_name_list ')' |
5600 | '(' step_name_list ')' |
3834 {$$ = new steps_c(NULL, $2, locloc(@$));} |
5601 {$$ = new steps_c(NULL, $2, locloc(@$));} |
|
5602 /* ERROR_CHECK_BEGIN */ |
|
5603 | '(' step_name_list error |
|
5604 {$$ = NULL; |
|
5605 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ')' at the end of step list in transition declaration."); |
|
5606 yyerrok; |
|
5607 } |
|
5608 | '(' error ')' |
|
5609 {$$ = NULL; |
|
5610 print_err_msg(current_filename, locf(@1), locl(@3), "invalid step list in transition declaration."); |
|
5611 yyerrok; |
|
5612 } |
|
5613 /* ERROR_CHECK_END */ |
3835 ; |
5614 ; |
3836 |
5615 |
3837 step_name_list: |
5616 step_name_list: |
3838 step_name ',' step_name |
5617 step_name ',' step_name |
3839 {$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);} |
5618 {$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);} |
3840 | step_name_list ',' step_name |
5619 | step_name_list ',' step_name |
3841 {$$ = $1; $$->add_element($3);} |
5620 {$$ = $1; $$->add_element($3);} |
|
5621 /* ERROR_CHECK_BEGIN */ |
|
5622 | step_name_list step_name |
|
5623 {$$ = NULL; |
|
5624 yynerrs++; |
|
5625 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in step list."); |
|
5626 } |
|
5627 | step_name_list ',' error |
|
5628 {$$ = NULL; |
|
5629 print_err_msg(current_filename, locf(@2), locl(@2), "invalid step name in step list."); |
|
5630 yyerrok; |
|
5631 } |
|
5632 /* ERROR_CHECK_END */ |
3842 ; |
5633 ; |
3843 |
5634 |
3844 |
5635 |
3845 /* NOTE: flex will automatically pop() out of body_state to previous state. |
5636 /* NOTE: flex will automatically pop() out of body_state to previous state. |
3846 * We do not need to give a command from bison to return to previous flex state, |
5637 * We do not need to give a command from bison to return to previous flex state, |
3847 * after forcing flex to go to body_state. |
5638 * after forcing flex to go to body_state. |
3848 */ |
5639 */ |
3849 transition: |
5640 transition: |
3850 TRANSITION |
5641 TRANSITION transition_priority |
3851 FROM steps TO steps |
5642 FROM steps TO steps |
3852 {cmd_goto_body_state();} transition_condition |
5643 {cmd_goto_body_state();} transition_condition |
3853 END_TRANSITION |
5644 END_TRANSITION |
3854 {$$ = new transition_c(NULL, NULL, $3, $5, $7, locloc(@$));} |
5645 {$$ = new transition_c(NULL, $2, $4, $6, $8, locloc(@$));} |
3855 //| TRANSITION identifier FROM steps TO steps ... |
5646 //| TRANSITION identifier FROM steps TO steps ... |
3856 | TRANSITION transition_name |
5647 | TRANSITION transition_name transition_priority |
3857 FROM steps TO steps |
5648 FROM steps TO steps |
3858 {cmd_goto_body_state();} transition_condition |
5649 {cmd_goto_body_state();} transition_condition |
3859 END_TRANSITION |
5650 END_TRANSITION |
3860 {$$ = new transition_c($2, NULL, $4, $6, $8, locloc(@$));} |
5651 {$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));} |
3861 | TRANSITION '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')' |
5652 /* ERROR_CHECK_BEGIN */ |
3862 FROM steps TO steps |
5653 | TRANSITION error transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
3863 {cmd_goto_body_state();} transition_condition |
5654 {$$ = NULL; |
3864 END_TRANSITION |
5655 print_err_msg(current_filename, locf(@1), locl(@3), "invalid transition name defined in transition declaration."); |
3865 {$$ = new transition_c(NULL, $7, $10, $12, $14, locloc(@$));} |
5656 yyerrok; |
3866 //| TRANSITION identifier '(' PRIORITY ASSIGN integer ')' FROM steps TO steps ... |
5657 } |
3867 | TRANSITION transition_name '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')' |
5658 | TRANSITION transition_name error FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
3868 FROM steps TO steps |
5659 {$$ = NULL; |
3869 {cmd_goto_body_state();} transition_condition |
5660 print_err_msg(current_filename, locf(@1), locl(@3), "invalid transition priority defined in transition declaration."); |
3870 END_TRANSITION |
5661 yyerrok; |
3871 {$$ = new transition_c($2, $8, $11, $13, $15, locloc(@$));} |
5662 } |
3872 ; |
5663 | TRANSITION transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
3873 |
5664 {$$ = NULL; |
|
5665 yynerrs++; |
|
5666 print_err_msg(current_filename, locf(@3), locl(@4), "no origin step(s) defined in transition declaration."); |
|
5667 } |
|
5668 | TRANSITION transition_name transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5669 {$$ = NULL; |
|
5670 yynerrs++; |
|
5671 print_err_msg(current_filename, locf(@4), locl(@5), "no origin step(s) defined in transition declaration."); |
|
5672 } |
|
5673 | TRANSITION transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5674 {$$ = NULL; |
|
5675 print_err_msg(current_filename, locf(@3), locl(@5), "invalid origin step(s) defined in transition declaration."); |
|
5676 yyerrok; |
|
5677 } |
|
5678 | TRANSITION transition_name transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5679 {$$ = NULL; |
|
5680 print_err_msg(current_filename, locf(@4), locl(@6), "invalid origin step(s) defined in transition declaration."); |
|
5681 yyerrok; |
|
5682 } |
|
5683 | TRANSITION transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5684 {$$ = NULL; |
|
5685 yynerrs++; |
|
5686 print_err_msg(current_filename, locf(@4), locl(@5), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); |
|
5687 } |
|
5688 | TRANSITION transition_name transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5689 {$$ = NULL; |
|
5690 yynerrs++; |
|
5691 print_err_msg(current_filename, locf(@5), locl(@6), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); |
|
5692 } |
|
5693 | TRANSITION transition_priority FROM steps error steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5694 {$$ = NULL; |
|
5695 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'TO' between origin step(s) and destination step(s) in transition declaration."); |
|
5696 yyerrok; |
|
5697 } |
|
5698 | TRANSITION transition_name transition_priority FROM steps error steps {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5699 {$$ = NULL; |
|
5700 print_err_msg(current_filename, locf(@5), locl(@7), "expecting 'TO' between origin step(s) and destination step(s) in transition declaration."); |
|
5701 yyerrok; |
|
5702 } |
|
5703 | TRANSITION transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5704 {$$ = NULL; |
|
5705 yynerrs++; |
|
5706 print_err_msg(current_filename, locf(@5), locl(@7), "no destination step(s) defined in transition declaration."); |
|
5707 } |
|
5708 | TRANSITION transition_name transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5709 {$$ = NULL; |
|
5710 yynerrs++; |
|
5711 print_err_msg(current_filename, locf(@6), locl(@8), "no destination step(s) defined in transition declaration."); |
|
5712 } |
|
5713 | TRANSITION transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5714 {$$ = NULL; |
|
5715 print_err_msg(current_filename, locf(@5), locl(@8), "invalid destination step(s) defined in transition declaration."); |
|
5716 yyerrok; |
|
5717 } |
|
5718 | TRANSITION transition_name transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5719 {$$ = NULL; |
|
5720 print_err_msg(current_filename, locf(@6), locl(@9), "invalid destination step(s) defined in transition declaration."); |
|
5721 yyerrok; |
|
5722 } |
|
5723 | TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5724 {$$ = NULL; |
|
5725 yynerrs++; |
|
5726 print_err_msg(current_filename, locf(@2), locl(@4), "no origin and destination step(s) defined in transition declaration."); |
|
5727 } |
|
5728 | TRANSITION transition_name transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION |
|
5729 {$$ = NULL; |
|
5730 yynerrs++; |
|
5731 print_err_msg(current_filename, locf(@3), locl(@5), "no origin and destination step(s) defined in transition declaration."); |
|
5732 } |
|
5733 | TRANSITION error END_TRANSITION |
|
5734 {$$ = NULL; |
|
5735 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in transition declaration."); |
|
5736 yyerrok; |
|
5737 } |
|
5738 /* ERROR_CHECK_END */ |
|
5739 ; |
|
5740 |
|
5741 transition_priority: |
|
5742 /* empty */ |
|
5743 {$$ = NULL;} |
|
5744 | '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')' |
|
5745 {$$ = $6;} |
|
5746 ; |
3874 |
5747 |
3875 |
5748 |
3876 transition_condition: |
5749 transition_condition: |
3877 ':' eol_list simple_instr_list |
5750 ':' eol_list simple_instr_list |
3878 {$$ = new transition_condition_c($3, NULL, locloc(@$));} |
5751 {$$ = new transition_condition_c($3, NULL, locloc(@$));} |
3879 | ASSIGN expression ';' |
5752 | ASSIGN expression ';' |
3880 {$$ = new transition_condition_c(NULL, $2, locloc(@$));} |
5753 {$$ = new transition_condition_c(NULL, $2, locloc(@$));} |
|
5754 /* ERROR_CHECK_BEGIN */ |
|
5755 | eol_list simple_instr_list |
|
5756 {$$ = NULL; |
|
5757 yynerrs++; |
|
5758 print_err_msg(current_filename, locf(@1), locl(@1), "':' missing before IL condition in transition declaration."); |
|
5759 } |
|
5760 | ':' eol_list error |
|
5761 {$$ = NULL; |
|
5762 print_err_msg(current_filename, locf(@2), locl(@2), "no instructions defined in IL condition of transition declaration."); |
|
5763 yyerrok; |
|
5764 } |
|
5765 | ASSIGN ';' |
|
5766 {$$ = NULL; |
|
5767 print_err_msg(current_filename, locf(@2), locl(@2), "no expression defined in ST condition of transition declaration."); |
|
5768 yyerrok; |
|
5769 } |
|
5770 | ASSIGN error ';' |
|
5771 {$$ = NULL; |
|
5772 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression defined in ST condition of transition declaration."); |
|
5773 yyerrok; |
|
5774 } |
|
5775 | ASSIGN expression error |
|
5776 {$$ = NULL; |
|
5777 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ';' after expression defined in ST condition of transition declaration."); |
|
5778 yyerrok; |
|
5779 } |
|
5780 /* ERROR_CHECK_END */ |
3881 ; |
5781 ; |
3882 |
5782 |
3883 |
5783 |
3884 |
5784 |
3885 action: |
5785 action: |
3886 // ACTION identifier ':' ... |
5786 // ACTION identifier ':' ... |
3887 ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION |
5787 ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION |
3888 {$$ = new action_c($2, $5, locloc(@$));} |
5788 {$$ = new action_c($2, $5, locloc(@$));} |
|
5789 /* ERROR_CHECK_BEGIN */ |
|
5790 | ACTION ':' {cmd_goto_body_state();} function_block_body END_ACTION |
|
5791 {$$ = NULL; |
|
5792 yynerrs++; |
|
5793 print_err_msg(current_filename, locf(@1), locl(@2), "no action name defined in action declaration."); |
|
5794 } |
|
5795 | ACTION error ':' {cmd_goto_body_state();} function_block_body END_ACTION |
|
5796 {$$ = NULL; |
|
5797 print_err_msg(current_filename, locf(@1), locl(@3), "invalid action name defined in action declaration."); |
|
5798 yyerrok; |
|
5799 } |
|
5800 | ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION |
|
5801 {$$ = NULL; |
|
5802 yynerrs++; |
|
5803 print_err_msg(current_filename, locf(@2), locl(@4), "':' missing after action name in action declaration."); |
|
5804 } |
|
5805 | ACTION action_name ':' END_ACTION |
|
5806 {$$ = NULL; |
|
5807 print_err_msg(current_filename, locf(@3), locl(@4), "no body defined in action declaration."); |
|
5808 yyerrok; |
|
5809 } |
|
5810 | ACTION error END_ACTION |
|
5811 {$$ = NULL; |
|
5812 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in action declaration."); |
|
5813 yyerrok; |
|
5814 } |
|
5815 /* ERROR_CHECK_END */ |
3889 ; |
5816 ; |
3890 |
5817 |
3891 |
5818 |
3892 /********************************/ |
5819 /********************************/ |
3893 /* B 1.7 Configuration elements */ |
5820 /* B 1.7 Configuration elements */ |
3974 {$$ = new configuration_declaration_c($2, $3, $4, $5, $6, locloc(@$)); |
5901 {$$ = new configuration_declaration_c($2, $3, $4, $5, $6, locloc(@$)); |
3975 library_element_symtable.insert($2, prev_declared_configuration_name_token); |
5902 library_element_symtable.insert($2, prev_declared_configuration_name_token); |
3976 variable_name_symtable.pop(); |
5903 variable_name_symtable.pop(); |
3977 } |
5904 } |
3978 /* ERROR_CHECK_BEGIN */ |
5905 /* ERROR_CHECK_BEGIN */ |
|
5906 | CONFIGURATION |
|
5907 optional_global_var_declarations |
|
5908 single_resource_declaration |
|
5909 {variable_name_symtable.pop();} |
|
5910 optional_access_declarations |
|
5911 optional_instance_specific_initializations |
|
5912 END_CONFIGURATION |
|
5913 {$$ = NULL; |
|
5914 yynerrs++; |
|
5915 print_err_msg(current_filename, locf(@1), locl(@2), "no configuration name defined in configuration declaration."); |
|
5916 } |
|
5917 | CONFIGURATION |
|
5918 optional_global_var_declarations |
|
5919 resource_declaration_list |
|
5920 optional_access_declarations |
|
5921 optional_instance_specific_initializations |
|
5922 END_CONFIGURATION |
|
5923 {$$ = NULL; |
|
5924 yynerrs++; |
|
5925 print_err_msg(current_filename, locf(@1), locl(@2), "no configuration name defined in configuration declaration."); |
|
5926 } |
|
5927 | CONFIGURATION error |
|
5928 optional_global_var_declarations |
|
5929 single_resource_declaration |
|
5930 {variable_name_symtable.pop();} |
|
5931 optional_access_declarations |
|
5932 optional_instance_specific_initializations |
|
5933 END_CONFIGURATION |
|
5934 {$$ = NULL; |
|
5935 print_err_msg(current_filename, locf(@1), locl(@3), "invalid configuration name defined in configuration declaration."); |
|
5936 yyerrok; |
|
5937 } |
|
5938 | CONFIGURATION error |
|
5939 optional_global_var_declarations |
|
5940 resource_declaration_list |
|
5941 optional_access_declarations |
|
5942 optional_instance_specific_initializations |
|
5943 END_CONFIGURATION |
|
5944 {$$ = NULL; |
|
5945 print_err_msg(current_filename, locf(@1), locl(@3), "invalid configuration name defined in configuration declaration."); |
|
5946 yyerrok; |
|
5947 } |
|
5948 | CONFIGURATION configuration_name |
|
5949 optional_global_var_declarations |
|
5950 optional_access_declarations |
|
5951 optional_instance_specific_initializations |
|
5952 END_CONFIGURATION |
|
5953 {$$ = NULL; |
|
5954 print_err_msg(current_filename, locf(@1), locl(@2), "no resource(s) defined in configuration declaration."); |
|
5955 yyerrok; |
|
5956 } |
|
5957 | CONFIGURATION configuration_name |
|
5958 optional_global_var_declarations |
|
5959 error |
|
5960 optional_access_declarations |
|
5961 optional_instance_specific_initializations |
|
5962 END_CONFIGURATION |
|
5963 {$$ = NULL; |
|
5964 print_err_msg(current_filename, locf(@1), locl(@2), "invalid resource(s) defined in configuration declaration."); |
|
5965 yyerrok; |
|
5966 } |
3979 | CONFIGURATION error END_CONFIGURATION |
5967 | CONFIGURATION error END_CONFIGURATION |
3980 {$$ = NULL; |
5968 {$$ = NULL; |
3981 print_err_msg(current_filename, locf(@1), locl(@3), "error in configuration declaration."); |
5969 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in configuration declaration."); |
3982 /* yychar */ |
|
3983 yyerrok; |
5970 yyerrok; |
3984 } |
5971 } |
3985 /* ERROR_CHECK_END */ |
5972 /* ERROR_CHECK_END */ |
3986 ; |
5973 ; |
3987 |
5974 |
4041 task_configuration_list: |
6050 task_configuration_list: |
4042 // empty |
6051 // empty |
4043 {$$ = new task_configuration_list_c(locloc(@$));} |
6052 {$$ = new task_configuration_list_c(locloc(@$));} |
4044 | task_configuration_list task_configuration ';' |
6053 | task_configuration_list task_configuration ';' |
4045 {$$ = $1; $$->add_element($2);} |
6054 {$$ = $1; $$->add_element($2);} |
|
6055 /* ERROR_CHECK_BEGIN */ |
|
6056 | task_configuration_list task_configuration error |
|
6057 {$$ = NULL; |
|
6058 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of task configuration in resource declaration."); |
|
6059 yyerrok; |
|
6060 } |
|
6061 | task_configuration_list ';' |
|
6062 {$$ = NULL; |
|
6063 yynerrs++; |
|
6064 print_err_msg(current_filename, locf(@1), locl(@1), "unexpected ';' after task configuration in resource declaration."); |
|
6065 } |
|
6066 /* ERROR_CHECK_END */ |
4046 ; |
6067 ; |
4047 |
6068 |
4048 |
6069 |
4049 // helper symbol for single_resource_declaration // |
6070 // helper symbol for single_resource_declaration // |
4050 program_configuration_list: |
6071 program_configuration_list: |
4051 program_configuration ';' |
6072 program_configuration ';' |
4052 {$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);} |
6073 {$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);} |
4053 | program_configuration_list program_configuration ';' |
6074 | program_configuration_list program_configuration ';' |
4054 {$$ = $1; $$->add_element($2);} |
6075 {$$ = $1; $$->add_element($2);} |
|
6076 /* ERROR_CHECK_BEGIN */ |
|
6077 | program_configuration error |
|
6078 {$$ = NULL; |
|
6079 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of program configuration in resource declaration."); |
|
6080 yyerrok; |
|
6081 } |
|
6082 | program_configuration_list program_configuration error |
|
6083 {$$ = NULL; |
|
6084 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of program configuration in resource declaration."); |
|
6085 yyerrok; |
|
6086 } |
|
6087 | program_configuration_list ';' |
|
6088 {$$ = NULL; |
|
6089 yynerrs++; |
|
6090 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after program configuration in resource declaration."); |
|
6091 } |
|
6092 /* ERROR_CHECK_END */ |
4055 ; |
6093 ; |
4056 |
6094 |
4057 |
6095 |
4058 resource_name: identifier; |
6096 resource_name: identifier; |
4059 |
6097 |
4060 /* |
6098 /* |
4061 access_declarations: |
6099 access_declarations: |
4062 VAR_ACCESS access_declaration_list END_VAR |
6100 VAR_ACCESS access_declaration_list END_VAR |
4063 {$$ = NULL;} |
6101 {$$ = NULL;} |
|
6102 // ERROR_CHECK_BEGIN // |
|
6103 | VAR_ACCESS END_VAR |
|
6104 {$$ = NULL; |
|
6105 yynerrs++; |
|
6106 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in access variable(s) declaration."); |
|
6107 } |
|
6108 | VAR_ACCESS error access_declaration_list END_VAR |
|
6109 {$$ = NULL; |
|
6110 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_ACCESS' in access variable(s) declaration."); |
|
6111 yyerrok; |
|
6112 } |
|
6113 | VAR_ACCESS error END_VAR |
|
6114 {$$ = NULL; |
|
6115 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in access variable(s) declaration."); |
|
6116 yyerrok; |
|
6117 } |
|
6118 // ERROR_CHECK_END // |
4064 ; |
6119 ; |
4065 |
6120 |
4066 // helper symbol for access_declarations // |
6121 // helper symbol for access_declarations // |
4067 access_declaration_list: |
6122 access_declaration_list: |
4068 access_declaration ';' |
6123 access_declaration ';' |
4069 | access_declaration_list access_declaration ';' |
6124 | access_declaration_list access_declaration ';' |
|
6125 // ERROR_CHECK_BEGIN // |
|
6126 | access_declaration error |
|
6127 {$$ = NULL; |
|
6128 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of access variable declaration."); |
|
6129 yyerrok; |
|
6130 } |
|
6131 | access_declaration_list access_declaration error |
|
6132 {$$ = NULL; |
|
6133 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of access variable declaration."); |
|
6134 yyerrok; |
|
6135 } |
|
6136 | access_declaration_list ';' |
|
6137 {$$ = NULL; |
|
6138 yynerrs++; |
|
6139 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after access variable declaration."); |
|
6140 } |
|
6141 // ERROR_CHECK_END // |
4070 ; |
6142 ; |
4071 |
6143 |
4072 |
6144 |
4073 access_declaration: |
6145 access_declaration: |
4074 access_name ':' access_path ':' non_generic_type_name |
6146 access_name ':' access_path ':' non_generic_type_name |
4181 // [SINGLE ASSIGN data_source ','] |
6270 // [SINGLE ASSIGN data_source ','] |
4182 /* empty */ |
6271 /* empty */ |
4183 {$$ = NULL;} |
6272 {$$ = NULL;} |
4184 | SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
6273 | SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
4185 {$$ = $4;} |
6274 {$$ = $4;} |
|
6275 /* ERROR_CHECK_BEGIN */ |
|
6276 | SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
|
6277 {$$ = NULL; |
|
6278 yynerrs++; |
|
6279 print_err_msg(current_filename, locf(@1), locl(@3), "':=' missing after 'SINGLE' in task initialization."); |
|
6280 } |
|
6281 | SINGLE error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
|
6282 {$$ = NULL; |
|
6283 print_err_msg(current_filename, locf(@1), locl(@4), "expecteing ':=' after 'SINGLE' in task initialization."); |
|
6284 yyerrok; |
|
6285 } |
|
6286 | SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();} |
|
6287 {$$ = NULL; |
|
6288 yynerrs++; |
|
6289 print_err_msg(current_filename, locf(@2), locl(@4), "no data source defined in 'SINGLE' statement of task initialization."); |
|
6290 } |
|
6291 | SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();} |
|
6292 {$$ = NULL; |
|
6293 print_err_msg(current_filename, locf(@2), locl(@5), "invalid data source defined in 'SINGLE' statement of task initialization."); |
|
6294 yyerrok; |
|
6295 } |
|
6296 /* ERROR_CHECK_END */ |
4186 ; |
6297 ; |
4187 |
6298 |
4188 |
6299 |
4189 task_initialization_interval: |
6300 task_initialization_interval: |
4190 // [INTERVAL ASSIGN data_source ','] |
6301 // [INTERVAL ASSIGN data_source ','] |
4191 /* empty */ |
6302 /* empty */ |
4192 {$$ = NULL;} |
6303 {$$ = NULL;} |
4193 | INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
6304 | INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
4194 {$$ = $4;} |
6305 {$$ = $4;} |
|
6306 /* ERROR_CHECK_BEGIN */ |
|
6307 | INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
|
6308 {$$ = NULL; |
|
6309 yynerrs++; |
|
6310 print_err_msg(current_filename, locf(@1), locl(@3), "':=' missing after 'INTERVAL' in task initialization."); |
|
6311 } |
|
6312 | INTERVAL error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} |
|
6313 {$$ = NULL; |
|
6314 print_err_msg(current_filename, locf(@1), locl(@4), "expecting ':=' after 'INTERVAL' in task initialization."); |
|
6315 yyerrok; |
|
6316 } |
|
6317 | INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();} |
|
6318 {$$ = NULL; |
|
6319 yynerrs++; |
|
6320 print_err_msg(current_filename, locf(@2), locl(@4), "no data source defined in 'INTERVAL' statement of task initialization."); |
|
6321 } |
|
6322 | INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();} |
|
6323 {$$ = NULL; |
|
6324 print_err_msg(current_filename, locf(@2), locl(@5), "invalid data source defined in 'INTERVAL' statement of task initialization."); |
|
6325 yyerrok; |
|
6326 } |
|
6327 /* ERROR_CHECK_END */ |
4195 ; |
6328 ; |
4196 |
6329 |
4197 |
6330 |
4198 |
6331 |
4199 task_initialization_priority: |
6332 task_initialization_priority: |
4200 // PRIORITY ASSIGN integer |
6333 // PRIORITY ASSIGN integer |
4201 PRIORITY ASSIGN {cmd_pop_state();} integer |
6334 PRIORITY ASSIGN {cmd_pop_state();} integer |
4202 {$$ = $4;} |
6335 {$$ = $4;} |
|
6336 /* ERROR_CHECK_BEGIN */ |
|
6337 | PRIORITY {cmd_pop_state();} integer |
|
6338 {$$ = NULL; |
|
6339 yynerrs++; |
|
6340 print_err_msg(current_filename, locf(@1), locl(@3), "':=' missing after 'PRIORITY' in task initialization."); |
|
6341 } |
|
6342 | PRIORITY error {cmd_pop_state();} integer |
|
6343 {$$ = NULL; |
|
6344 print_err_msg(current_filename, locf(@1), locl(@4), "expecting ':=' after 'PRIORITY' in task initialization."); |
|
6345 yyerrok; |
|
6346 } |
|
6347 | PRIORITY ASSIGN {cmd_pop_state();} error |
|
6348 {$$ = NULL; |
|
6349 yynerrs++; |
|
6350 print_err_msg(current_filename, locf(@2), locl(@2), "no priority number defined in 'PRIORITY' statement of task initialization."); |
|
6351 } |
|
6352 /* ERROR_CHECK_END */ |
4203 ; |
6353 ; |
4204 |
6354 |
4205 |
6355 |
4206 |
6356 |
4207 data_source: |
6357 data_source: |
4223 } |
6373 } |
4224 | PROGRAM NON_RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
6374 | PROGRAM NON_RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
4225 {$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$)); |
6375 {$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$)); |
4226 variable_name_symtable.insert($3, prev_declared_program_name_token); |
6376 variable_name_symtable.insert($3, prev_declared_program_name_token); |
4227 } |
6377 } |
|
6378 /* ERROR_CHECK_BEGIN */ |
|
6379 | PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements |
|
6380 {$$ = NULL; |
|
6381 yynerrs++; |
|
6382 print_err_msg(current_filename, locf(@1), locl(@3), "unknown program type name after ':' in program configuration."); |
|
6383 } |
|
6384 | PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements |
|
6385 {$$ = NULL; |
|
6386 yynerrs++; |
|
6387 print_err_msg(current_filename, locf(@2), locl(@4), "unknown program type name after ':' in program configuration."); |
|
6388 } |
|
6389 | PROGRAM NON_RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements |
|
6390 {$$ = NULL; |
|
6391 yynerrs++; |
|
6392 print_err_msg(current_filename, locf(@2), locl(@4), "unknown program type name after ':' in program configuration."); |
|
6393 } |
|
6394 | PROGRAM error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6395 {$$ = NULL; |
|
6396 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'PROGRAM' in program configuration."); |
|
6397 yyerrok; |
|
6398 } |
|
6399 | PROGRAM RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6400 {$$ = NULL; |
|
6401 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'RETAIN' in retentive program configuration."); |
|
6402 yyerrok; |
|
6403 } |
|
6404 | PROGRAM NON_RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6405 {$$ = NULL; |
|
6406 print_err_msg(current_filename, locf(@2), locl(@4), "unexpected token after 'NON_RETAIN' in non-retentive program configuration."); |
|
6407 yyerrok; |
|
6408 } |
|
6409 | PROGRAM optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6410 {$$ = NULL; |
|
6411 yynerrs++; |
|
6412 print_err_msg(current_filename, locf(@1), locl(@2), "no program name defined in program configuration."); |
|
6413 } |
|
6414 | PROGRAM RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6415 {$$ = NULL; |
|
6416 yynerrs++; |
|
6417 print_err_msg(current_filename, locf(@2), locl(@3), "no program name defined in retentive program configuration."); |
|
6418 } |
|
6419 | PROGRAM NON_RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6420 {$$ = NULL; |
|
6421 yynerrs++; |
|
6422 print_err_msg(current_filename, locf(@2), locl(@3), "no program name defined in non-retentive program configuration."); |
|
6423 } |
|
6424 | PROGRAM error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6425 {$$ = NULL; |
|
6426 print_err_msg(current_filename, locf(@1), locl(@3), "no program name defined in program configuration."); |
|
6427 yyerrok; |
|
6428 } |
|
6429 | PROGRAM RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6430 {$$ = NULL; |
|
6431 print_err_msg(current_filename, locf(@2), locl(@4), "no program name defined in retentive program configuration."); |
|
6432 yyerrok; |
|
6433 } |
|
6434 | PROGRAM NON_RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements |
|
6435 {$$ = NULL; |
|
6436 print_err_msg(current_filename, locf(@2), locl(@4), "no program name defined in non-retentive program configuration."); |
|
6437 yyerrok; |
|
6438 } |
|
6439 | PROGRAM program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements |
|
6440 {$$ = NULL; |
|
6441 yynerrs++; |
|
6442 print_err_msg(current_filename, locf(@3), locl(@4), "':' missing after program name or optional task name in program configuration."); |
|
6443 } |
|
6444 | PROGRAM RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements |
|
6445 {$$ = NULL; |
|
6446 yynerrs++; |
|
6447 print_err_msg(current_filename, locf(@4), locl(@5), "':' missing after program name or optional task name in program configuration."); |
|
6448 } |
|
6449 | PROGRAM NON_RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements |
|
6450 {$$ = NULL; |
|
6451 yynerrs++; |
|
6452 print_err_msg(current_filename, locf(@4), locl(@5), "':' missing after program name or optional task name in program configuration."); |
|
6453 } |
|
6454 | PROGRAM program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements |
|
6455 {$$ = NULL; |
|
6456 print_err_msg(current_filename, locf(@3), locl(@5), "expecting ':' after program name or optional task name in program configuration."); |
|
6457 yyerrok; |
|
6458 } |
|
6459 | PROGRAM RETAIN program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements |
|
6460 {$$ = NULL; |
|
6461 print_err_msg(current_filename, locf(@4), locl(@6), "expecting ':' after program name or optional task name in program configuration."); |
|
6462 yyerrok; |
|
6463 } |
|
6464 | PROGRAM NON_RETAIN program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements |
|
6465 {$$ = NULL; |
|
6466 print_err_msg(current_filename, locf(@4), locl(@6), "expecting ':' after program name or optional task name in program configuration."); |
|
6467 yyerrok; |
|
6468 } |
|
6469 | PROGRAM program_name optional_task_name ':' optional_prog_conf_elements |
|
6470 {$$ = NULL; |
|
6471 yynerrs++; |
|
6472 print_err_msg(current_filename, locf(@4), locl(@5), "no program type defined in program configuration."); |
|
6473 } |
|
6474 | PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements |
|
6475 {$$ = NULL; |
|
6476 yynerrs++; |
|
6477 print_err_msg(current_filename, locf(@5), locl(@6), "no program type defined in program configuration."); |
|
6478 } |
|
6479 | PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements |
|
6480 {$$ = NULL; |
|
6481 yynerrs++; |
|
6482 print_err_msg(current_filename, locf(@5), locl(@6), "no program type defined in program configuration."); |
|
6483 } |
|
6484 /* ERROR_CHECK_END */ |
4228 ; |
6485 ; |
4229 |
6486 |
4230 // helper symbol for program_configuration // |
6487 // helper symbol for program_configuration // |
4231 optional_task_name: |
6488 optional_task_name: |
4232 // empty // |
6489 // empty // |
4233 {$$ = NULL;} |
6490 {$$ = NULL;} |
4234 | WITH task_name |
6491 | WITH task_name |
4235 {$$ = $2;} |
6492 {$$ = $2;} |
|
6493 /* ERROR_CHECK_BEGIN */ |
|
6494 | WITH error |
|
6495 {$$ = NULL; |
|
6496 print_err_msg(current_filename, locf(@1), locl(@1), "invalid tack name in optional task name of program configuration."); |
|
6497 yyerrok; |
|
6498 } |
|
6499 /* ERROR_CHECK_END */ |
4236 ; |
6500 ; |
4237 |
6501 |
4238 // helper symbol for program_configuration // |
6502 // helper symbol for program_configuration // |
4239 optional_prog_conf_elements: |
6503 optional_prog_conf_elements: |
4240 // empty // |
6504 // empty // |
4241 {$$ = NULL;} |
6505 {$$ = NULL;} |
4242 | '(' prog_conf_elements ')' |
6506 | '(' prog_conf_elements ')' |
4243 {$$ = $2;} |
6507 {$$ = $2;} |
|
6508 /* ERROR_CHECK_BEGIN */ |
|
6509 | '(' error ')' |
|
6510 {$$ = NULL; |
|
6511 print_err_msg(current_filename, locf(@1), locl(@3), "invalid program configuration elements in program configuration."); |
|
6512 yyerrok; |
|
6513 } |
|
6514 | '(' prog_conf_elements error |
|
6515 {$$ = NULL; |
|
6516 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of program configuration elements in program configuration."); |
|
6517 yyerrok; |
|
6518 } |
|
6519 /* ERROR_CHECK_END */ |
4244 ; |
6520 ; |
4245 |
6521 |
4246 |
6522 |
4247 prog_conf_elements: |
6523 prog_conf_elements: |
4248 prog_conf_element |
6524 prog_conf_element |
4249 {$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);} |
6525 {$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);} |
4250 | prog_conf_elements ',' prog_conf_element |
6526 | prog_conf_elements ',' prog_conf_element |
4251 {$$ = $1; $$->add_element($3);} |
6527 {$$ = $1; $$->add_element($3);} |
|
6528 /* ERROR_CHECK_BEGIN */ |
|
6529 | prog_conf_elements prog_conf_element |
|
6530 {$$ = NULL; |
|
6531 yynerrs++; |
|
6532 print_err_msg(current_filename, locf(@1), locl(@2), "',' missing in program configuration elements list."); |
|
6533 } |
|
6534 | prog_conf_elements ',' error |
|
6535 {$$ = NULL; |
|
6536 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for program configuration element in program configuration list."); |
|
6537 yyerrok; |
|
6538 } |
|
6539 /* ERROR_CHECK_END */ |
4252 ; |
6540 ; |
4253 |
6541 |
4254 |
6542 |
4255 prog_conf_element: |
6543 prog_conf_element: |
4256 fb_task |
6544 fb_task |
4319 ; |
6646 ; |
4320 |
6647 |
4321 instance_specific_initializations: |
6648 instance_specific_initializations: |
4322 VAR_CONFIG instance_specific_init_list END_VAR |
6649 VAR_CONFIG instance_specific_init_list END_VAR |
4323 {$$ = new instance_specific_initializations_c($2, locloc(@$));} |
6650 {$$ = new instance_specific_initializations_c($2, locloc(@$));} |
|
6651 /* ERROR_CHECK_BEGIN */ |
|
6652 | VAR_CONFIG END_VAR |
|
6653 {$$ = NULL; |
|
6654 yynerrs++; |
|
6655 print_err_msg(current_filename, locf(@1), locl(@2), "no variable declared in configuration variable(s) initialization."); |
|
6656 } |
|
6657 | VAR_CONFIG error instance_specific_init_list END_VAR |
|
6658 {$$ = NULL; |
|
6659 print_err_msg(current_filename, locf(@1), locl(@3), "unexpected token after 'VAR_CONFIG' in configuration variable(s) initialization."); |
|
6660 yyerrok; |
|
6661 } |
|
6662 | VAR_CONFIG error END_VAR |
|
6663 {$$ = NULL; |
|
6664 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in configuration variable(s) initialization."); |
|
6665 yyerrok; |
|
6666 } |
|
6667 /* ERROR_CHECK_END */ |
4324 ; |
6668 ; |
4325 |
6669 |
4326 // helper symbol for instance_specific_initializations // |
6670 // helper symbol for instance_specific_initializations // |
4327 instance_specific_init_list: |
6671 instance_specific_init_list: |
4328 instance_specific_init ';' |
6672 instance_specific_init ';' |
4329 {$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);} |
6673 {$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);} |
4330 | instance_specific_init_list instance_specific_init ';' |
6674 | instance_specific_init_list instance_specific_init ';' |
4331 {$$ = $1; $$->add_element($2);} |
6675 {$$ = $1; $$->add_element($2);} |
|
6676 /* ERROR_CHECK_BEGIN */ |
|
6677 | instance_specific_init error |
|
6678 {$$ = NULL; |
|
6679 print_err_msg(current_filename, locf(@1), locl(@1), "';' missing at the end of configuration variable initialization."); |
|
6680 yyerrok; |
|
6681 } |
|
6682 | instance_specific_init_list instance_specific_init error |
|
6683 {$$ = NULL; |
|
6684 print_err_msg(current_filename, locf(@2), locl(@2), "';' missing at the end of configuration variable initialization."); |
|
6685 yyerrok; |
|
6686 } |
|
6687 | instance_specific_init_list ';' |
|
6688 {$$ = NULL; |
|
6689 yynerrs++; |
|
6690 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after configuration variable initialization."); |
|
6691 } |
|
6692 /* ERROR_CHECK_END */ |
4332 ; |
6693 ; |
4333 |
6694 |
4334 |
6695 |
4335 instance_specific_init: |
6696 instance_specific_init: |
4336 // |
6697 // |
4518 {$$ = new il_expression_c($1, $3, NULL, locloc(@$));} |
6921 {$$ = new il_expression_c($1, $3, NULL, locloc(@$));} |
4519 | il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')' |
6922 | il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')' |
4520 {$$ = new il_expression_c($1, $3, $5, locloc(@$));} |
6923 {$$ = new il_expression_c($1, $3, $5, locloc(@$));} |
4521 | il_expr_operator_clash_eol_list simple_instr_list ')' |
6924 | il_expr_operator_clash_eol_list simple_instr_list ')' |
4522 {$$ = new il_expression_c($1, NULL, $2, locloc(@$));} |
6925 {$$ = new il_expression_c($1, NULL, $2, locloc(@$));} |
|
6926 /* ERROR_CHECK_BEGIN */ |
|
6927 | il_expr_operator_noclash '(' eol_list error |
|
6928 {$$ = NULL; |
|
6929 print_err_msg(current_filename, locf(@3), locl(@3), "')' missing at the end of IL expression."); |
|
6930 yyerrok; |
|
6931 } |
|
6932 | il_expr_operator_noclash '(' il_operand eol_list error |
|
6933 {$$ = NULL; |
|
6934 print_err_msg(current_filename, locf(@4), locl(@4), "')' missing at the end of IL expression."); |
|
6935 yyerrok; |
|
6936 } |
|
6937 | il_expr_operator_noclash '(' eol_list simple_instr_list error |
|
6938 {$$ = NULL; |
|
6939 print_err_msg(current_filename, locf(@4), locl(@4), "')' missing at the end of IL expression."); |
|
6940 yyerrok; |
|
6941 } |
|
6942 | il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error |
|
6943 {$$ = NULL; |
|
6944 print_err_msg(current_filename, locf(@5), locl(@5), "')' missing at the end of IL expression."); |
|
6945 yyerrok; |
|
6946 } |
|
6947 | il_expr_operator_clash '(' il_operand eol_list error |
|
6948 {$$ = NULL; |
|
6949 print_err_msg(current_filename, locf(@4), locl(@4), "')' missing at the end of IL expression."); |
|
6950 yyerrok; |
|
6951 } |
|
6952 | il_expr_operator_clash '(' il_operand eol_list simple_instr_list error |
|
6953 {$$ = NULL; |
|
6954 print_err_msg(current_filename, locf(@5), locl(@5), "')' missing at the end of IL expression."); |
|
6955 yyerrok; |
|
6956 } |
|
6957 | il_expr_operator_clash_eol_list simple_instr_list error |
|
6958 {$$ = NULL; |
|
6959 print_err_msg(current_filename, locf(@2), locl(@2), "')' missing at the end of IL expression."); |
|
6960 yyerrok; |
|
6961 } |
|
6962 /* ERROR_CHECK_END */ |
4523 ; |
6963 ; |
4524 |
6964 |
4525 |
6965 |
4526 il_jump_operation: |
6966 il_jump_operation: |
4527 il_jump_operator label |
6967 il_jump_operator label |
4528 {$$ = new il_jump_operation_c($1, $2, locloc(@$));} |
6968 {$$ = new il_jump_operation_c($1, $2, locloc(@$));} |
|
6969 /* ERROR_CHECK_BEGIN */ |
|
6970 | il_jump_operator error |
|
6971 {$$ = NULL; |
|
6972 print_err_msg(current_filename, locf(@1), locl(@1), "invalid label defined in IL jump operation."); |
|
6973 yyerrok; |
|
6974 } |
|
6975 /* ERROR_CHECK_END */ |
4529 ; |
6976 ; |
4530 |
6977 |
4531 |
6978 |
4532 il_fb_call: |
6979 il_fb_call: |
4533 // il_call_operator fb_name ['(' (EOL {EOL} [il_param_list]) | [il_operand_list] ')'] |
6980 // il_call_operator fb_name ['(' (EOL {EOL} [il_param_list]) | [il_operand_list] ')'] |
4539 {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} |
6986 {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} |
4540 | il_call_operator prev_declared_fb_name '(' il_operand_list ')' |
6987 | il_call_operator prev_declared_fb_name '(' il_operand_list ')' |
4541 {$$ = new il_fb_call_c($1, $2, $4, NULL, locloc(@$));} |
6988 {$$ = new il_fb_call_c($1, $2, $4, NULL, locloc(@$));} |
4542 | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')' |
6989 | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')' |
4543 {$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));} |
6990 {$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));} |
|
6991 /* ERROR_CHECK_BEGIN */ |
|
6992 | il_call_operator error |
|
6993 {$$ = NULL; |
|
6994 print_err_msg(current_filename, locf(@1), locl(@1), "invalid function block name defined in IL function block call."); |
|
6995 yyerrok; |
|
6996 } |
|
6997 | il_call_operator '(' ')' |
|
6998 {$$ = NULL; |
|
6999 yynerrs++; |
|
7000 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call."); |
|
7001 } |
|
7002 | il_call_operator '(' eol_list ')' |
|
7003 {$$ = NULL; |
|
7004 yynerrs++; |
|
7005 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call."); |
|
7006 } |
|
7007 | il_call_operator '(' il_operand_list ')' |
|
7008 {$$ = NULL; |
|
7009 yynerrs++; |
|
7010 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call."); |
|
7011 } |
|
7012 | il_call_operator '(' eol_list il_param_list ')' |
|
7013 {$$ = NULL; |
|
7014 yynerrs++; |
|
7015 print_err_msg(current_filename, locf(@1), locl(@2), "no function block name defined in IL function block call."); |
|
7016 } |
|
7017 | il_call_operator error '(' ')' |
|
7018 {$$ = NULL; |
|
7019 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call."); |
|
7020 yyerrok; |
|
7021 } |
|
7022 | il_call_operator error '(' eol_list ')' |
|
7023 {$$ = NULL; |
|
7024 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call."); |
|
7025 yyerrok; |
|
7026 } |
|
7027 | il_call_operator error '(' il_operand_list ')' |
|
7028 {$$ = NULL; |
|
7029 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call."); |
|
7030 yyerrok; |
|
7031 } |
|
7032 | il_call_operator error '(' eol_list il_param_list ')' |
|
7033 {$$ = NULL; |
|
7034 print_err_msg(current_filename, locf(@1), locl(@3), "invalid function block name defined in IL function block call."); |
|
7035 yyerrok; |
|
7036 } |
|
7037 | il_call_operator prev_declared_fb_name ')' |
|
7038 {$$ = NULL; |
|
7039 yynerrs++; |
|
7040 print_err_msg(current_filename, locf(@2), locl(@3), "'(' missing after function block name defined in IL function block call."); |
|
7041 } |
|
7042 | il_call_operator prev_declared_fb_name il_operand_list ')' |
|
7043 {$$ = NULL; |
|
7044 yynerrs++; |
|
7045 print_err_msg(current_filename, locf(@2), locl(@3), "'(' missing after function block name defined in IL function block call."); |
|
7046 } |
|
7047 | il_call_operator prev_declared_fb_name '(' error |
|
7048 {$$ = NULL; |
|
7049 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of IL function block call."); |
|
7050 yyerrok; |
|
7051 } |
|
7052 | il_call_operator prev_declared_fb_name '(' eol_list error |
|
7053 {$$ = NULL; |
|
7054 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of IL function block call."); |
|
7055 yyerrok; |
|
7056 } |
|
7057 | il_call_operator prev_declared_fb_name '(' il_operand_list error |
|
7058 {$$ = NULL; |
|
7059 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of IL function block call."); |
|
7060 yyerrok; |
|
7061 } |
|
7062 /* ERROR_CHECK_END */ |
4544 ; |
7063 ; |
4545 |
7064 |
4546 |
7065 |
4547 /* NOTE: Please read note above the definition of function_name_without_clashes */ |
7066 /* NOTE: Please read note above the definition of function_name_without_clashes */ |
4548 il_formal_funct_call: |
7067 il_formal_funct_call: |
4671 il_param_list: |
7243 il_param_list: |
4672 il_param_instruction_list il_param_last_instruction |
7244 il_param_instruction_list il_param_last_instruction |
4673 {$$ = $1; $$->add_element($2);} |
7245 {$$ = $1; $$->add_element($2);} |
4674 | il_param_last_instruction |
7246 | il_param_last_instruction |
4675 {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} |
7247 {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} |
|
7248 /* ERROR_CHECK_BEGIN */ |
|
7249 | il_param_instruction_list error |
|
7250 {$$ = NULL; |
|
7251 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter assignment in parameter assignment list."); |
|
7252 yyerrok; |
|
7253 } |
|
7254 | il_param_last_instruction il_param_last_instruction |
|
7255 {$$ = NULL; |
|
7256 yynerrs++; |
|
7257 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing at the end of parameter assignment in parameter assignment list."); |
|
7258 } |
|
7259 | il_param_instruction_list il_param_last_instruction il_param_last_instruction |
|
7260 {$$ = NULL; |
|
7261 yynerrs++; |
|
7262 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing at the end of parameter assignment in parameter assignment list."); |
|
7263 } |
|
7264 /* ERROR_CHECK_END */ |
4676 ; |
7265 ; |
4677 |
7266 |
4678 |
7267 |
4679 /* Helper symbol for il_param_list */ |
7268 /* Helper symbol for il_param_list */ |
4680 il_param_instruction_list: |
7269 il_param_instruction_list: |
4681 il_param_instruction |
7270 il_param_instruction |
4682 {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} |
7271 {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} |
4683 | il_param_instruction_list il_param_instruction |
7272 | il_param_instruction_list il_param_instruction |
4684 {$$ = $1; $$->add_element($2);} |
7273 {$$ = $1; $$->add_element($2);} |
|
7274 /* ERROR_CHECK_BEGIN */ |
|
7275 | il_param_last_instruction il_param_instruction |
|
7276 {$$ = NULL; |
|
7277 yynerrs++; |
|
7278 print_err_msg(current_filename, locf(@1), locl(@1), "',' missing at the end of parameter assignment in parameter assignment list."); |
|
7279 } |
|
7280 | il_param_instruction_list il_param_last_instruction il_param_instruction |
|
7281 {$$ = NULL; |
|
7282 yynerrs++; |
|
7283 print_err_msg(current_filename, locf(@2), locl(@2), "',' missing at the end of parameter assignment in parameter assignment list."); |
|
7284 } |
|
7285 /* ERROR_CHECK_END */ |
4685 ; |
7286 ; |
4686 |
7287 |
4687 |
7288 |
4688 il_param_instruction: |
7289 il_param_instruction: |
4689 il_param_assignment ',' eol_list |
7290 il_param_assignment ',' eol_list |
4690 | il_param_out_assignment ',' eol_list |
7291 | il_param_out_assignment ',' eol_list |
|
7292 /* ERROR_CHECK_BEGIN */ |
|
7293 | il_param_assignment ',' error |
|
7294 {$$ = NULL; |
|
7295 print_err_msg(current_filename, locf(@2), locl(@2), "EOL missing at the end of parameter assignment in parameter assignment list."); |
|
7296 yyerrok; |
|
7297 } |
|
7298 | il_param_out_assignment ',' error |
|
7299 {$$ = NULL; |
|
7300 print_err_msg(current_filename, locf(@2), locl(@2), "EOL missing at the end of parameter out assignment in parameter assignment list."); |
|
7301 yyerrok; |
|
7302 } |
|
7303 /* ERROR_CHECK_END */ |
4691 ; |
7304 ; |
4692 |
7305 |
4693 |
7306 |
4694 il_param_last_instruction: |
7307 il_param_last_instruction: |
4695 il_param_assignment eol_list |
7308 il_param_assignment eol_list |
4696 | il_param_out_assignment eol_list |
7309 | il_param_out_assignment eol_list |
|
7310 /* ERROR_CHECK_BEGIN */ |
|
7311 | il_param_assignment error |
|
7312 {$$ = NULL; |
|
7313 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing at the end of last parameter assignment in parameter assignment list."); |
|
7314 yyerrok; |
|
7315 } |
|
7316 | il_param_out_assignment error |
|
7317 {$$ = NULL; |
|
7318 print_err_msg(current_filename, locf(@1), locl(@1), "EOL missing at the end of last parameter out assignment in parameter assignment list."); |
|
7319 yyerrok; |
|
7320 } |
|
7321 /* ERROR_CHECK_END */ |
|
7322 |
4697 ; |
7323 ; |
4698 |
7324 |
4699 |
7325 |
4700 il_param_assignment: |
7326 il_param_assignment: |
4701 il_assign_operator il_operand |
7327 il_assign_operator il_operand |
4702 {$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));} |
7328 {$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));} |
4703 | il_assign_operator '(' eol_list simple_instr_list ')' |
7329 | il_assign_operator '(' eol_list simple_instr_list ')' |
4704 {$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));} |
7330 {$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));} |
|
7331 /* ERROR_CHECK_BEGIN */ |
|
7332 | error il_operand |
|
7333 {$$ = NULL; |
|
7334 print_err_msg(current_filename, locf(@2), locl(@2), "invalid operator in parameter assignment."); |
|
7335 yyerrok; |
|
7336 } |
|
7337 | error '(' eol_list simple_instr_list ')' |
|
7338 {$$ = NULL; |
|
7339 print_err_msg(current_filename, locf(@2), locl(@2), "invalid operator in parameter assignment."); |
|
7340 yyerrok; |
|
7341 } |
|
7342 | il_assign_operator error |
|
7343 {$$ = NULL; |
|
7344 print_err_msg(current_filename, locf(@1), locl(@1), "invalid operand defined in parameter assignment."); |
|
7345 yyerrok; |
|
7346 } |
|
7347 | il_assign_operator '(' ')' |
|
7348 {$$ = NULL; |
|
7349 print_err_msg(current_filename, locf(@1), locl(@1), "no instruction list defined in parameter assignment."); |
|
7350 yyerrok; |
|
7351 } |
|
7352 | il_assign_operator '(' error ')' |
|
7353 {$$ = NULL; |
|
7354 print_err_msg(current_filename, locf(@1), locl(@1), "invalid instruction list defined in parameter assignment."); |
|
7355 yyerrok; |
|
7356 } |
|
7357 | il_assign_operator '(' eol_list simple_instr_list error |
|
7358 {$$ = NULL; |
|
7359 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing at the end of instruction list defined in parameter assignment."); |
|
7360 yyerrok; |
|
7361 } |
|
7362 /* ERROR_CHECK_END */ |
4705 ; |
7363 ; |
4706 |
7364 |
4707 |
7365 |
4708 il_param_out_assignment: |
7366 il_param_out_assignment: |
4709 il_assign_out_operator variable |
7367 il_assign_out_operator variable |
4710 {$$ = new il_param_out_assignment_c($1, $2, locloc(@$));} |
7368 {$$ = new il_param_out_assignment_c($1, $2, locloc(@$));} |
|
7369 /* ERROR_CHECK_BEGIN */ |
|
7370 | il_assign_out_operator error |
|
7371 {$$ = NULL; |
|
7372 print_err_msg(current_filename, locf(@1), locl(@1), "invalid variable defined in parameter out assignment."); |
|
7373 yyerrok; |
|
7374 } |
|
7375 /* ERROR_CHECK_END */ |
4711 ; |
7376 ; |
4712 |
7377 |
4713 |
7378 |
4714 |
7379 |
4715 /*******************/ |
7380 /*******************/ |
4957 {$$ = new mul_expression_c($1, $3, locloc(@$));} |
7723 {$$ = new mul_expression_c($1, $3, locloc(@$));} |
4958 | term '/' power_expression |
7724 | term '/' power_expression |
4959 {$$ = new div_expression_c($1, $3, locloc(@$));} |
7725 {$$ = new div_expression_c($1, $3, locloc(@$));} |
4960 | term MOD power_expression |
7726 | term MOD power_expression |
4961 {$$ = new mod_expression_c($1, $3, locloc(@$));} |
7727 {$$ = new mod_expression_c($1, $3, locloc(@$));} |
|
7728 /* ERROR_CHECK_BEGIN */ |
|
7729 | term '*' error |
|
7730 {$$ = NULL; |
|
7731 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '*' in ST expression."); |
|
7732 yyerrok; |
|
7733 } |
|
7734 | term '/' error |
|
7735 {$$ = NULL; |
|
7736 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '/' in ST expression."); |
|
7737 yyerrok; |
|
7738 } |
|
7739 | term MOD error |
|
7740 {$$ = NULL; |
|
7741 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after 'MOD' in ST expression."); |
|
7742 yyerrok; |
|
7743 } |
|
7744 /* ERROR_CHECK_END */ |
4962 ; |
7745 ; |
4963 |
7746 |
4964 /* Not required... |
7747 /* Not required... |
4965 multiply_operator: '*' | '/' | 'MOD' |
7748 multiply_operator: '*' | '/' | 'MOD' |
4966 */ |
7749 */ |
4967 |
7750 |
4968 power_expression: |
7751 power_expression: |
4969 unary_expression |
7752 unary_expression |
4970 | power_expression OPER_EXP unary_expression |
7753 | power_expression OPER_EXP unary_expression |
4971 {$$ = new power_expression_c($1, $3, locloc(@$));} |
7754 {$$ = new power_expression_c($1, $3, locloc(@$));} |
|
7755 /* ERROR_CHECK_BEGIN */ |
|
7756 | power_expression OPER_EXP error |
|
7757 {$$ = NULL; |
|
7758 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '**' in ST expression."); |
|
7759 yyerrok; |
|
7760 } |
|
7761 /* ERROR_CHECK_END */ |
4972 ; |
7762 ; |
4973 |
7763 |
4974 |
7764 |
4975 unary_expression: |
7765 unary_expression: |
4976 primary_expression |
7766 primary_expression |
4977 | '-' primary_expression |
7767 | '-' primary_expression |
4978 {$$ = new neg_expression_c($2, locloc(@$));} |
7768 {$$ = new neg_expression_c($2, locloc(@$));} |
4979 | NOT primary_expression |
7769 | NOT primary_expression |
4980 {$$ = new not_expression_c($2, locloc(@$));} |
7770 {$$ = new not_expression_c($2, locloc(@$));} |
|
7771 /* ERROR_CHECK_BEGIN */ |
|
7772 | '-' error |
|
7773 {$$ = NULL; |
|
7774 print_err_msg(current_filename, locf(@1), locl(@1), "invalid expression after '-' in ST expression."); |
|
7775 yyerrok; |
|
7776 } |
|
7777 | NOT error |
|
7778 {$$ = NULL; |
|
7779 print_err_msg(current_filename, locf(@1), locl(@1), "invalid expression after 'NOT' in ST expression."); |
|
7780 yyerrok; |
|
7781 } |
|
7782 /* ERROR_CHECK_END */ |
4981 ; |
7783 ; |
4982 |
7784 |
4983 /* Not required... |
7785 /* Not required... |
4984 unary_operator: '-' | 'NOT' |
7786 unary_operator: '-' | 'NOT' |
4985 */ |
7787 */ |
5050 /* function_name '(' [param_assignment_list] ')' */ |
7859 /* function_name '(' [param_assignment_list] ')' */ |
5051 function_name_no_NOT_clashes '(' param_assignment_formal_list ')' |
7860 function_name_no_NOT_clashes '(' param_assignment_formal_list ')' |
5052 {$$ = new function_invocation_c($1, $3, locloc(@$));} |
7861 {$$ = new function_invocation_c($1, $3, locloc(@$));} |
5053 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')' |
7862 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')' |
5054 {$$ = new function_invocation_c($1, $3, locloc(@$));} |
7863 {$$ = new function_invocation_c($1, $3, locloc(@$));} |
|
7864 /* ERROR_CHECK_BEGIN */ |
|
7865 | function_name_no_NOT_clashes param_assignment_formal_list ')' |
|
7866 {$$ = NULL; |
|
7867 yynerrs++; |
|
7868 print_err_msg(current_filename, locf(@1), locl(@2), "'(' missing after function name in ST expression."); |
|
7869 } |
|
7870 | function_name_no_NOT_clashes error param_assignment_formal_list ')' |
|
7871 {$$ = NULL; |
|
7872 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '(' after function name in ST expression."); |
|
7873 yyerrok; |
|
7874 } |
|
7875 | function_name_no_NOT_clashes error param_assignment_nonformal_list ')' |
|
7876 {$$ = NULL; |
|
7877 print_err_msg(current_filename, locf(@1), locl(@3), "expecting '(' after function name in ST expression."); |
|
7878 yyerrok; |
|
7879 } |
|
7880 | function_name_no_NOT_clashes '(' ')' |
|
7881 {$$ = NULL; |
|
7882 yynerrs++; |
|
7883 print_err_msg(current_filename, locf(@1), locl(@3), "no parameter defined in function invocation of ST expression."); |
|
7884 } |
|
7885 | function_name_no_NOT_clashes '(' error ')' |
|
7886 {$$ = NULL; |
|
7887 print_err_msg(current_filename, locf(@1), locl(@3), "invalid parameter(s) defined in function invocation of ST expression."); |
|
7888 yyerrok; |
|
7889 } |
|
7890 | function_name_no_NOT_clashes '(' param_assignment_formal_list error |
|
7891 {$$ = NULL; |
|
7892 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of function invocation in ST expression."); |
|
7893 yyerrok; |
|
7894 } |
|
7895 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list error |
|
7896 {$$ = NULL; |
|
7897 print_err_msg(current_filename, locf(@1), locl(@3), "')' missing at the end of function invocation in ST expression."); |
|
7898 yyerrok; |
|
7899 } |
|
7900 /* ERROR_CHECK_END */ |
5055 ; |
7901 ; |
5056 |
7902 |
5057 |
7903 |
5058 /********************/ |
7904 /********************/ |
5059 /* B 3.2 Statements */ |
7905 /* B 3.2 Statements */ |
5117 {$$ = new fb_invocation_c($1, NULL, locloc(@$)); } |
7979 {$$ = new fb_invocation_c($1, NULL, locloc(@$)); } |
5118 | prev_declared_fb_name '(' param_assignment_formal_list ')' |
7980 | prev_declared_fb_name '(' param_assignment_formal_list ')' |
5119 {$$ = new fb_invocation_c($1, $3, locloc(@$));} |
7981 {$$ = new fb_invocation_c($1, $3, locloc(@$));} |
5120 | prev_declared_fb_name '(' param_assignment_nonformal_list ')' |
7982 | prev_declared_fb_name '(' param_assignment_nonformal_list ')' |
5121 {$$ = new fb_invocation_c($1, $3, locloc(@$));} |
7983 {$$ = new fb_invocation_c($1, $3, locloc(@$));} |
|
7984 /* ERROR_CHECK_BEGIN */ |
|
7985 | prev_declared_fb_name ')' |
|
7986 {$$ = $1; |
|
7987 yynerrs++; |
|
7988 print_err_msg(current_filename, locf(@1), locl(@1), "'(' missing after function block name in ST statement."); |
|
7989 } |
|
7990 | prev_declared_fb_name param_assignment_formal_list ')' |
|
7991 {$$ = $1; |
|
7992 yynerrs++; |
|
7993 print_err_msg(current_filename, locf(@1), locl(@1), "'(' missing after function block name in ST statement."); |
|
7994 } |
|
7995 | prev_declared_fb_name error ')' |
|
7996 {$$ = $1; |
|
7997 print_err_msg(current_filename, locf(@1), locl(@1), "expecting '(' after function block name in ST statement."); |
|
7998 yyerrok; |
|
7999 } |
|
8000 | prev_declared_fb_name error param_assignment_formal_list ')' |
|
8001 {$$ = $1; |
|
8002 print_err_msg(current_filename, locf(@1), locl(@1), "expecting '(' after function block name in ST statement."); |
|
8003 yyerrok; |
|
8004 } |
|
8005 | prev_declared_fb_name error param_assignment_nonformal_list ')' |
|
8006 {$$ = $1; |
|
8007 print_err_msg(current_filename, locf(@1), locl(@1), "expecting '(' after function block name in ST statement."); |
|
8008 yyerrok; |
|
8009 } |
|
8010 | prev_declared_fb_name '(' error ')' |
|
8011 {$$ = $1; |
|
8012 print_err_msg(current_filename, locf(@1), locl(@1), "invalid parameter list in function block invocation in ST statement."); |
|
8013 yyerrok; |
|
8014 } |
|
8015 | prev_declared_fb_name '(' error |
|
8016 {$$ = $1; |
|
8017 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing after parameter list of function block invocation in ST statement."); |
|
8018 yyerrok; |
|
8019 } |
|
8020 | prev_declared_fb_name '(' param_assignment_formal_list error |
|
8021 {$$ = $1; |
|
8022 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing after parameter list of function block invocation in ST statement."); |
|
8023 yyerrok; |
|
8024 } |
|
8025 | prev_declared_fb_name '(' param_assignment_nonformal_list error |
|
8026 {$$ = $1; |
|
8027 print_err_msg(current_filename, locf(@1), locl(@1), "')' missing after parameter list of function block invocation in ST statement."); |
|
8028 yyerrok; |
|
8029 } |
|
8030 /* ERROR_CHECK_END */ |
5122 ; |
8031 ; |
5123 |
8032 |
5124 |
8033 |
5125 /* helper symbol for |
8034 /* helper symbol for |
5126 * - fb_invocation |
8035 * - fb_invocation |
5206 if_statement: |
8161 if_statement: |
5207 IF expression THEN statement_list elseif_statement_list END_IF |
8162 IF expression THEN statement_list elseif_statement_list END_IF |
5208 {$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));} |
8163 {$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));} |
5209 | IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF |
8164 | IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF |
5210 {$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));} |
8165 {$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));} |
|
8166 /* ERROR_CHECK_BEGIN */ |
|
8167 | IF THEN statement_list elseif_statement_list END_IF |
|
8168 {$$ = NULL; |
|
8169 yynerrs++; |
|
8170 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'IF' statement."); |
|
8171 } |
|
8172 | IF THEN statement_list elseif_statement_list ELSE statement_list END_IF |
|
8173 {$$ = NULL; |
|
8174 yynerrs++; |
|
8175 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'IF' statement."); |
|
8176 } |
|
8177 | IF error THEN statement_list elseif_statement_list END_IF |
|
8178 {$$ = NULL; |
|
8179 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'IF' statement."); |
|
8180 yyerrok; |
|
8181 } |
|
8182 | IF error THEN statement_list elseif_statement_list ELSE statement_list END_IF |
|
8183 {$$ = NULL; |
|
8184 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'IF' statement."); |
|
8185 yyerrok; |
|
8186 } |
|
8187 | IF expression error statement_list elseif_statement_list END_IF |
|
8188 {$$ = NULL; |
|
8189 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'THEN' after test expression in ST 'IF' statement."); |
|
8190 yyerrok; |
|
8191 } |
|
8192 | IF expression error statement_list elseif_statement_list ELSE statement_list END_IF |
|
8193 {$$ = NULL; |
|
8194 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'THEN' after test expression in ST 'IF' statement."); |
|
8195 yyerrok; |
|
8196 } |
|
8197 | IF expression THEN elseif_statement_list END_IF |
|
8198 {$$ = NULL; |
|
8199 yynerrs++; |
|
8200 print_err_msg(current_filename, locf(@3), locl(@4), "no statement defined after 'THEN' in ST 'IF' statement."); |
|
8201 } |
|
8202 | IF expression THEN elseif_statement_list ELSE statement_list END_IF |
|
8203 {$$ = NULL; |
|
8204 yynerrs++; |
|
8205 print_err_msg(current_filename, locf(@3), locl(@4), "no statement defined after 'THEN' in ST 'IF' statement."); |
|
8206 } |
|
8207 | IF expression THEN statement_list elseif_statement_list ELSE END_IF |
|
8208 {$$ = NULL; |
|
8209 yynerrs++; |
|
8210 print_err_msg(current_filename, locf(@6), locl(@7), "no statement defined after 'ELSE' in ST 'IF' statement."); |
|
8211 } |
|
8212 | IF expression THEN statement_list elseif_statement_list ELSE error END_IF |
|
8213 {$$ = NULL; |
|
8214 print_err_msg(current_filename, locf(@6), locl(@8), "invalid statement defined after 'ELSE' in ST 'IF' statement."); |
|
8215 yyerrok; |
|
8216 } |
|
8217 | IF error END_IF |
|
8218 {$$ = NULL; |
|
8219 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'IF' statement."); |
|
8220 yyerrok; |
|
8221 } |
|
8222 /* ERROR_CHECK_END */ |
5211 ; |
8223 ; |
5212 |
8224 |
5213 /* helper symbol for if_statement */ |
8225 /* helper symbol for if_statement */ |
5214 elseif_statement_list: |
8226 elseif_statement_list: |
5215 /* empty */ |
8227 /* empty */ |
5220 |
8232 |
5221 /* helper symbol for elseif_statement_list */ |
8233 /* helper symbol for elseif_statement_list */ |
5222 elseif_statement: |
8234 elseif_statement: |
5223 ELSIF expression THEN statement_list |
8235 ELSIF expression THEN statement_list |
5224 {$$ = new elseif_statement_c($2, $4, locloc(@$));} |
8236 {$$ = new elseif_statement_c($2, $4, locloc(@$));} |
|
8237 /* ERROR_CHECK_BEGIN */ |
|
8238 | ELSIF THEN statement_list |
|
8239 {$$ = NULL; |
|
8240 yynerrs++; |
|
8241 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined for 'ELSEIF' statement in ST 'IF' statement."); |
|
8242 } |
|
8243 | ELSIF error THEN statement_list |
|
8244 {$$ = NULL; |
|
8245 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for 'ELSEIF' statement in ST 'IF' statement."); |
|
8246 yyerrok; |
|
8247 } |
|
8248 | ELSIF expression error statement_list |
|
8249 {$$ = NULL; |
|
8250 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'THEN' after test expression in 'ELSEIF' statement of ST 'IF' statement."); |
|
8251 yyerrok; |
|
8252 } |
|
8253 | ELSIF expression THEN error |
|
8254 {$$ = NULL; |
|
8255 print_err_msg(current_filename, locf(@3), locl(@3), "invalid statement list in 'ELSEIF' statement of ST 'IF' statement."); |
|
8256 yyerrok; |
|
8257 } |
|
8258 /* ERROR_CHECK_END */ |
5225 ; |
8259 ; |
5226 |
8260 |
5227 |
8261 |
5228 case_statement: |
8262 case_statement: |
5229 CASE expression OF case_element_list END_CASE |
8263 CASE expression OF case_element_list END_CASE |
5230 {$$ = new case_statement_c($2, $4, NULL, locloc(@$));} |
8264 {$$ = new case_statement_c($2, $4, NULL, locloc(@$));} |
5231 | CASE expression OF case_element_list ELSE statement_list END_CASE |
8265 | CASE expression OF case_element_list ELSE statement_list END_CASE |
5232 {$$ = new case_statement_c($2, $4, $6, locloc(@$));} |
8266 {$$ = new case_statement_c($2, $4, $6, locloc(@$));} |
|
8267 /* ERROR_CHECK_BEGIN */ |
|
8268 | CASE OF case_element_list END_CASE |
|
8269 {$$ = NULL; |
|
8270 yynerrs++; |
|
8271 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'CASE' statement."); |
|
8272 } |
|
8273 | CASE OF case_element_list ELSE statement_list END_CASE |
|
8274 {$$ = NULL; |
|
8275 yynerrs++; |
|
8276 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'CASE' statement."); |
|
8277 } |
|
8278 | CASE error OF case_element_list END_CASE |
|
8279 {$$ = NULL; |
|
8280 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'CASE' statement."); |
|
8281 yyerrok; |
|
8282 } |
|
8283 | CASE error OF case_element_list ELSE statement_list END_CASE |
|
8284 {$$ = NULL; |
|
8285 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'CASE' statement."); |
|
8286 yyerrok; |
|
8287 } |
|
8288 | CASE expression error case_element_list END_CASE |
|
8289 {$$ = NULL; |
|
8290 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'OF' after test expression in ST 'CASE' statement."); |
|
8291 yyerrok; |
|
8292 } |
|
8293 | CASE expression error case_element_list ELSE statement_list END_CASE |
|
8294 {$$ = NULL; |
|
8295 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'OF' after test expression in ST 'CASE' statement."); |
|
8296 yyerrok; |
|
8297 } |
|
8298 | CASE expression OF END_CASE |
|
8299 {$$ = NULL; |
|
8300 yynerrs++; |
|
8301 print_err_msg(current_filename, locf(@3), locl(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); |
|
8302 } |
|
8303 | CASE expression OF ELSE statement_list END_CASE |
|
8304 {$$ = NULL; |
|
8305 yynerrs++; |
|
8306 print_err_msg(current_filename, locf(@3), locl(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); |
|
8307 } |
|
8308 | CASE expression OF error END_CASE |
|
8309 {$$ = NULL; |
|
8310 print_err_msg(current_filename, locf(@3), locl(@5), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); |
|
8311 yyerrok; |
|
8312 } |
|
8313 | CASE expression OF error ELSE statement_list END_CASE |
|
8314 {$$ = NULL; |
|
8315 print_err_msg(current_filename, locf(@3), locl(@5), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); |
|
8316 yyerrok; |
|
8317 } |
|
8318 | CASE expression OF case_element_list ELSE END_CASE |
|
8319 {$$ = NULL; |
|
8320 yynerrs++; |
|
8321 print_err_msg(current_filename, locf(@5), locl(@6), "no statement defined after 'ELSE' in ST 'CASE' statement."); |
|
8322 } |
|
8323 | CASE expression OF case_element_list ELSE error END_CASE |
|
8324 {$$ = NULL; |
|
8325 print_err_msg(current_filename, locf(@5), locl(@7), "invalid statement defined after 'ELSE' in ST 'CASE' statement."); |
|
8326 yyerrok; |
|
8327 } |
|
8328 | CASE error END_CASE |
|
8329 {$$ = NULL; |
|
8330 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'CASE' statement."); |
|
8331 yyerrok; |
|
8332 } |
|
8333 /* ERROR_CHECK_END */ |
5233 ; |
8334 ; |
5234 |
8335 |
5235 |
8336 |
5236 /* helper symbol for case_statement */ |
8337 /* helper symbol for case_statement */ |
5237 case_element_list: |
8338 case_element_list: |
5280 for_statement: |
8400 for_statement: |
5281 FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_FOR |
8401 FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_FOR |
5282 {$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));} |
8402 {$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));} |
5283 | FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR |
8403 | FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR |
5284 {$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));} |
8404 {$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));} |
|
8405 /* ERROR_CHECK_BEGIN */ |
|
8406 | FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR |
|
8407 {$$ = NULL; |
|
8408 yynerrs++; |
|
8409 print_err_msg(current_filename, locf(@1), locl(@2), "no control variable defined in ST 'FOR' statement."); |
|
8410 } |
|
8411 | FOR ASSIGN expression TO expression DO statement_list END_FOR |
|
8412 {$$ = NULL; |
|
8413 yynerrs++; |
|
8414 print_err_msg(current_filename, locf(@1), locl(@2), "no control variable defined in ST 'FOR' statement."); |
|
8415 } |
|
8416 | FOR error ASSIGN expression TO expression BY expression DO statement_list END_FOR |
|
8417 {$$ = NULL; |
|
8418 print_err_msg(current_filename, locf(@1), locl(@3), "invalid control variable defined for ST 'FOR' statement."); |
|
8419 yyerrok; |
|
8420 } |
|
8421 | FOR error ASSIGN expression TO expression DO statement_list END_FOR |
|
8422 {$$ = NULL; |
|
8423 print_err_msg(current_filename, locf(@1), locl(@3), "invalid control variable defined for ST 'FOR' statement."); |
|
8424 yyerrok; |
|
8425 } |
|
8426 | FOR control_variable expression TO expression BY expression DO statement_list END_FOR |
|
8427 {$$ = NULL; |
|
8428 yynerrs++; |
|
8429 print_err_msg(current_filename, locf(@2), locl(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); |
|
8430 } |
|
8431 | FOR control_variable expression TO expression DO statement_list END_FOR |
|
8432 {$$ = NULL; |
|
8433 yynerrs++; |
|
8434 print_err_msg(current_filename, locf(@2), locl(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); |
|
8435 } |
|
8436 | FOR control_variable error expression TO expression BY expression DO statement_list END_FOR |
|
8437 {$$ = NULL; |
|
8438 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); |
|
8439 yyerrok; |
|
8440 } |
|
8441 | FOR control_variable error expression TO expression DO statement_list END_FOR |
|
8442 {$$ = NULL; |
|
8443 print_err_msg(current_filename, locf(@2), locl(@4), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); |
|
8444 yyerrok; |
|
8445 } |
|
8446 | FOR control_variable ASSIGN TO expression BY expression DO statement_list END_FOR |
|
8447 {$$ = NULL; |
|
8448 yynerrs++; |
|
8449 print_err_msg(current_filename, locf(@3), locl(@4), "no start expression defined in ST 'FOR' statement."); |
|
8450 } |
|
8451 | FOR control_variable ASSIGN TO expression DO statement_list END_FOR |
|
8452 {$$ = NULL; |
|
8453 yynerrs++; |
|
8454 print_err_msg(current_filename, locf(@3), locl(@4), "no start expression defined in ST 'FOR' statement."); |
|
8455 } |
|
8456 | FOR control_variable ASSIGN error TO expression BY expression DO statement_list END_FOR |
|
8457 {$$ = NULL; |
|
8458 print_err_msg(current_filename, locf(@3), locl(@5), "invalid start expression defined in ST 'FOR' statement."); |
|
8459 yyerrok; |
|
8460 } |
|
8461 | FOR control_variable ASSIGN error TO expression DO statement_list END_FOR |
|
8462 {$$ = NULL; |
|
8463 print_err_msg(current_filename, locf(@3), locl(@5), "invalid start expression in ST 'FOR' statement."); |
|
8464 yyerrok; |
|
8465 } |
|
8466 | FOR control_variable ASSIGN expression error expression BY expression DO statement_list END_FOR |
|
8467 {$$ = NULL; |
|
8468 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); |
|
8469 yyerrok; |
|
8470 } |
|
8471 | FOR control_variable ASSIGN expression error expression DO statement_list END_FOR |
|
8472 {$$ = NULL; |
|
8473 print_err_msg(current_filename, locf(@4), locl(@6), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); |
|
8474 yyerrok; |
|
8475 } |
|
8476 | FOR control_variable ASSIGN expression TO expression error expression DO statement_list END_FOR |
|
8477 {$$ = NULL; |
|
8478 print_err_msg(current_filename, locf(@6), locl(@8), "expecting 'BY' between end expression and step expression in ST 'FOR' statement."); |
|
8479 yyerrok; |
|
8480 } |
|
8481 | FOR control_variable ASSIGN expression TO expression BY expression error statement_list END_FOR |
|
8482 {$$ = NULL; |
|
8483 print_err_msg(current_filename, locf(@8), locl(@10), "expecting 'DO' after step expression in ST 'FOR' statement."); |
|
8484 yyerrok; |
|
8485 } |
|
8486 | FOR control_variable ASSIGN expression TO expression error statement_list END_FOR |
|
8487 {$$ = NULL; |
|
8488 print_err_msg(current_filename, locf(@6), locl(@8), "expecting 'DO' after end expression in ST 'FOR' statement."); |
|
8489 yyerrok; |
|
8490 } |
|
8491 | FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR |
|
8492 {$$ = NULL; |
|
8493 print_err_msg(current_filename, locf(@9), locl(@10), "no statement(s) defined after 'DO' in ST 'FOR' statement."); |
|
8494 yyerrok; |
|
8495 } |
|
8496 | FOR control_variable ASSIGN expression TO expression DO END_FOR |
|
8497 {$$ = NULL; |
|
8498 print_err_msg(current_filename, locf(@7), locl(@8), "no statement(s) defined after 'DO' in ST 'FOR' statement."); |
|
8499 yyerrok; |
|
8500 } |
|
8501 | FOR control_variable ASSIGN expression TO expression BY expression DO error END_FOR |
|
8502 {$$ = NULL; |
|
8503 print_err_msg(current_filename, locf(@9), locl(@11), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); |
|
8504 yyerrok; |
|
8505 } |
|
8506 | FOR control_variable ASSIGN expression TO expression DO error END_FOR |
|
8507 {$$ = NULL; |
|
8508 print_err_msg(current_filename, locf(@7), locl(@9), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); |
|
8509 yyerrok; |
|
8510 } |
|
8511 /* ERROR_CHECK_END */ |
5285 ; |
8512 ; |
5286 |
8513 |
5287 /* The spec has the syntax |
8514 /* The spec has the syntax |
5288 * control_variable: identifier; |
8515 * control_variable: identifier; |
5289 * but then defines the semantics of control_variable |
8516 * but then defines the semantics of control_variable |
5310 |
8537 |
5311 |
8538 |
5312 while_statement: |
8539 while_statement: |
5313 WHILE expression DO statement_list END_WHILE |
8540 WHILE expression DO statement_list END_WHILE |
5314 {$$ = new while_statement_c($2, $4, locloc(@$));} |
8541 {$$ = new while_statement_c($2, $4, locloc(@$));} |
|
8542 /* ERROR_CHECK_BEGIN */ |
|
8543 | WHILE DO statement_list END_WHILE |
|
8544 {$$ = NULL; |
|
8545 yynerrs++; |
|
8546 print_err_msg(current_filename, locf(@1), locl(@2), "no test expression defined in ST 'WHILE' statement."); |
|
8547 } |
|
8548 | WHILE error DO statement_list END_WHILE |
|
8549 {$$ = NULL; |
|
8550 print_err_msg(current_filename, locf(@1), locl(@3), "invalid test expression defined for ST 'WHILE' statement."); |
|
8551 yyerrok; |
|
8552 } |
|
8553 | WHILE expression error statement_list END_WHILE |
|
8554 {$$ = NULL; |
|
8555 print_err_msg(current_filename, locf(@2), locl(@4), "expecting 'DO' after test expression in ST 'WHILE' statement."); |
|
8556 yyerrok; |
|
8557 } |
|
8558 | WHILE expression DO END_WHILE |
|
8559 {$$ = NULL; |
|
8560 yynerrs++; |
|
8561 print_err_msg(current_filename, locf(@3), locl(@4), "no statement(s) defined after 'DO' in ST 'WHILE' statement."); |
|
8562 } |
|
8563 | WHILE expression DO error END_WHILE |
|
8564 {$$ = NULL; |
|
8565 print_err_msg(current_filename, locf(@3), locl(@5), "invalid statement(s) defined after 'DO' in ST 'WHILE' statement."); |
|
8566 yyerrok; |
|
8567 } |
|
8568 | WHILE error END_WHILE |
|
8569 {$$ = NULL; |
|
8570 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'WHILE' statement."); |
|
8571 yyerrok; |
|
8572 } |
|
8573 /* ERROR_CHECK_END */ |
5315 ; |
8574 ; |
5316 |
8575 |
5317 |
8576 |
5318 repeat_statement: |
8577 repeat_statement: |
5319 REPEAT statement_list UNTIL expression END_REPEAT |
8578 REPEAT statement_list UNTIL expression END_REPEAT |
5320 {$$ = new repeat_statement_c($2, $4, locloc(@$));} |
8579 {$$ = new repeat_statement_c($2, $4, locloc(@$));} |
|
8580 /* ERROR_CHECK_BEGIN */ |
|
8581 | REPEAT UNTIL expression END_REPEAT |
|
8582 {$$ = NULL; |
|
8583 yynerrs++; |
|
8584 print_err_msg(current_filename, locf(@1), locl(@2), "no statement(s) defined after 'REPEAT' in ST 'REPEAT' statement."); |
|
8585 } |
|
8586 | REPEAT error UNTIL expression END_REPEAT |
|
8587 {$$ = NULL; |
|
8588 print_err_msg(current_filename, locf(@1), locl(@3), "invalid statement(s) defined after 'REPEAT' for ST 'REPEAT' statement."); |
|
8589 yyerrok; |
|
8590 } |
|
8591 | REPEAT statement_list UNTIL END_REPEAT |
|
8592 {$$ = NULL; |
|
8593 yynerrs++; |
|
8594 print_err_msg(current_filename, locf(@3), locl(@4), "no test expression defined after 'UNTIL' in ST 'REPEAT' statement."); |
|
8595 } |
|
8596 | REPEAT statement_list UNTIL error END_REPEAT |
|
8597 {$$ = NULL; |
|
8598 print_err_msg(current_filename, locf(@3), locl(@5), "invalid test expression defined after 'UNTIL' in ST 'REPEAT' statement."); |
|
8599 yyerrok; |
|
8600 } |
|
8601 | REPEAT error END_REPEAT |
|
8602 {$$ = NULL; |
|
8603 print_err_msg(current_filename, locf(@1), locl(@3), "unknown error in ST 'REPEAT' statement."); |
|
8604 yyerrok; |
|
8605 } |
|
8606 /* ERROR_CHECK_END */ |
5321 ; |
8607 ; |
5322 |
8608 |
5323 |
8609 |
5324 exit_statement: |
8610 exit_statement: |
5325 EXIT {$$ = new exit_statement_c(locloc(@$));} |
8611 EXIT {$$ = new exit_statement_c(locloc(@$));} |