stage1_2/iec.y
changeset 136 32bd7ef40897
parent 134 0e43c556cd2d
child 142 120772c527f3
equal deleted inserted replaced
135:0f3f6714b938 136:32bd7ef40897
   152 /* The functions declared here are defined at the end of this file... */
   152 /* The functions declared here are defined at the end of this file... */
   153 
   153 
   154 /* Convert an il_operator_c into an identifier_c */
   154 /* Convert an il_operator_c into an identifier_c */
   155 symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator);
   155 symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator);
   156 
   156 
       
   157 /* return if current token is a syntax element */
       
   158 bool is_current_syntax_token();
       
   159 
   157 /* print an error message */
   160 /* print an error message */
   158 void print_err_msg(const char *filename,
   161 void print_err_msg(int first_line,
   159                    int first_line,
       
   160                    int first_column,
   162                    int first_column,
   161                    int last_line,
   163                    int last_line,
   162                    int last_column,
   164                    int last_column,
   163                    const char *additional_error_msg);
   165                    const char *additional_error_msg);
   164 %}
   166 %}
   289   octal_digit
   291   octal_digit
   290   hex_digit
   292   hex_digit
   291 */
   293 */
   292 %token <ID>	identifier_token
   294 %token <ID>	identifier_token
   293 %type  <leaf>	identifier
   295 %type  <leaf>	identifier
   294 
   296 %token INVALID_IDENTIFIER
   295 
   297 
   296 /*********************/
   298 /*********************/
   297 /* B 1.2 - Constants */
   299 /* B 1.2 - Constants */
   298 /*********************/
   300 /*********************/
   299 %type <leaf>	constant
   301 %type <leaf>	constant
  1362 | prev_declared_program_name
  1364 | prev_declared_program_name
  1363 | prev_declared_global_var_name
  1365 | prev_declared_global_var_name
  1364 ;
  1366 ;
  1365 
  1367 
  1366 
  1368 
  1367 
       
  1368 
       
  1369 prev_declared_variable_name: prev_declared_variable_name_token {$$ = new identifier_c($1, locloc(@$));};
  1369 prev_declared_variable_name: prev_declared_variable_name_token {$$ = new identifier_c($1, locloc(@$));};
  1370 prev_declared_fb_name: prev_declared_fb_name_token {$$ = new identifier_c($1, locloc(@$));};
  1370 prev_declared_fb_name: prev_declared_fb_name_token {$$ = new identifier_c($1, locloc(@$));};
  1371 
  1371 
  1372 prev_declared_simple_type_name: prev_declared_simple_type_name_token {$$ = new identifier_c($1, locloc(@$));};
  1372 prev_declared_simple_type_name: prev_declared_simple_type_name_token {$$ = new identifier_c($1, locloc(@$));};
  1373 prev_declared_subrange_type_name: prev_declared_subrange_type_name_token {$$ = new identifier_c($1, locloc(@$));};
  1373 prev_declared_subrange_type_name: prev_declared_subrange_type_name_token {$$ = new identifier_c($1, locloc(@$));};
  1392 	 $$ = (list_c *)tree_root;
  1392 	 $$ = (list_c *)tree_root;
  1393 	}
  1393 	}
  1394 | library library_element_declaration
  1394 | library library_element_declaration
  1395 	{$$ = $1; $$->add_element($2);}
  1395 	{$$ = $1; $$->add_element($2);}
  1396 /* ERROR_CHECK_BEGIN */
  1396 /* ERROR_CHECK_BEGIN */
       
  1397 | library error library_element_declaration
       
  1398 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unknown syntax error."); yyerrok;}
  1397 | library error END_OF_INPUT
  1399 | library error END_OF_INPUT
  1398 	{$$ = NULL;
  1400 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unknown syntax error."); yyerrok;}
  1399 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown syntax error.");
       
  1400 	 yyerrok;
       
  1401 	}
       
  1402 /* ERROR_CHECK_END */
  1401 /* ERROR_CHECK_END */
  1403 ;
  1402 ;
  1404 
  1403 
  1405 
  1404 
  1406 library_element_declaration:
  1405 library_element_declaration:
  1680  * why signed_integer, binary_integer, octal_integer
  1679  * why signed_integer, binary_integer, octal_integer
  1681  * and hex_integer are missing here!
  1680  * and hex_integer are missing here!
  1682  */
  1681  */
  1683 /* ERROR_CHECK_BEGIN */
  1682 /* ERROR_CHECK_BEGIN */
  1684 | integer_type_name signed_integer
  1683 | integer_type_name signed_integer
  1685 	{$$ = NULL;
  1684 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;}
  1686 	 yynerrs++;
       
  1687 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal.");
       
  1688 	}
       
  1689 | integer_type_name binary_integer
  1685 | integer_type_name binary_integer
  1690 	{$$ = NULL;
  1686 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;}
  1691 	 yynerrs++;
       
  1692 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal.");
       
  1693 	}
       
  1694 | integer_type_name octal_integer
  1687 | integer_type_name octal_integer
  1695 	{$$ = NULL;
  1688 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;}
  1696 	 yynerrs++;
       
  1697 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal.");
       
  1698 	}
       
  1699 | integer_type_name hex_integer
  1689 | integer_type_name hex_integer
  1700 	{$$ = NULL;
  1690 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;}
  1701 	 yynerrs++;
       
  1702 	 print_err_msg(current_filename, locl(@1), locf(@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(@2), locl(@2), "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(@2), locl(@2), "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(@2), locl(@2), "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(@2), locl(@2), "expecting '#' between integer type name and value in integer literal.");
       
  1722 	 yyerrok;
       
  1723 	}
       
  1724 | integer_type_name '#' error
  1691 | integer_type_name '#' error
  1725 	{$$ = NULL;
  1692 	{$$ = NULL; 
  1726 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for integer literal.");
  1693 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for integer literal.");}
       
  1694 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for integer literal."); yyclearin;}
  1727 	 yyerrok;
  1695 	 yyerrok;
  1728 	}
  1696 	}
  1729 /* ERROR_CHECK_END */
  1697 /* ERROR_CHECK_END */
  1730 ;
  1698 ;
  1731 
  1699 
  1749   signed_real
  1717   signed_real
  1750 | real_type_name '#' signed_real
  1718 | real_type_name '#' signed_real
  1751 	{$$ = new real_literal_c($1, $3, locf(@1), locl(@3));}
  1719 	{$$ = new real_literal_c($1, $3, locf(@1), locl(@3));}
  1752 /* ERROR_CHECK_BEGIN */
  1720 /* ERROR_CHECK_BEGIN */
  1753 | real_type_name signed_real
  1721 | real_type_name signed_real
  1754 	{$$ = NULL;
  1722 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between real type name and value in real literal."); yynerrs++;}
  1755 	 yynerrs++;
       
  1756 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between real type name and value in real literal.");
       
  1757 	}
       
  1758 | real_type_name error signed_real
       
  1759 	{$$ = NULL;
       
  1760 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '#' between real type name and value in real literal.");
       
  1761 	 yyerrok;
       
  1762 	}
       
  1763 | real_type_name '#' error
  1723 | real_type_name '#' error
  1764 	{$$ = NULL;
  1724   {$$ = NULL;
  1765 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for real literal.");
  1725 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for real literal.");}
       
  1726 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for real literal."); yyclearin;}
  1766 	 yyerrok;
  1727 	 yyerrok;
  1767 	}
  1728 	}
  1768 /* ERROR_CHECK_END */
  1729 /* ERROR_CHECK_END */
  1769 ;
  1730 ;
  1770 
  1731 
  1806  * bit_string_type_name, although seemingly incorrect, is
  1767  * bit_string_type_name, although seemingly incorrect, is
  1807  * really correct here!
  1768  * really correct here!
  1808  */
  1769  */
  1809 /* ERROR_CHECK_BEGIN */
  1770 /* ERROR_CHECK_BEGIN */
  1810 | bit_string_type_name integer
  1771 | bit_string_type_name integer
  1811 	{$$ = NULL;
  1772 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;}
  1812 	 yynerrs++;
       
  1813 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal.");
       
  1814 	}
       
  1815 | bit_string_type_name binary_integer
  1773 | bit_string_type_name binary_integer
  1816 	{$$ = NULL;
  1774 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;}
  1817 	 yynerrs++;
       
  1818 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal.");
       
  1819 	}
       
  1820 | bit_string_type_name octal_integer
  1775 | bit_string_type_name octal_integer
  1821 	{$$ = NULL;
  1776 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;}
  1822 	 yynerrs++;
       
  1823 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal.");
       
  1824 	}
       
  1825 | bit_string_type_name hex_integer
  1777 | bit_string_type_name hex_integer
  1826 	{$$ = NULL;
  1778 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;}
  1827 	 yynerrs++;
       
  1828 	 print_err_msg(current_filename, locl(@1), locf(@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(@2), locl(@2), "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(@2), locl(@2), "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(@2), locl(@2), "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(@2), locl(@2), "expecting '#' between bit string type name and value in bit string literal.");
       
  1848 	 yyerrok;
       
  1849 	}
       
  1850 | bit_string_type_name '#' error
  1779 | bit_string_type_name '#' error
  1851 	{$$ = NULL;
  1780   {$$ = NULL;
  1852 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for bit string literal.");
  1781 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for bit string literal.");}
       
  1782 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for bit string literal."); yyclearin;}
  1853 	 yyerrok;
  1783 	 yyerrok;
  1854 	}
  1784 	}
  1855 /* ERROR_CHECK_END */
  1785 /* ERROR_CHECK_END */
  1856 ;
  1786 ;
  1857 
  1787 
  1951 	{$$ = new duration_c(NULL, $2, locloc(@$));}
  1881 	{$$ = new duration_c(NULL, $2, locloc(@$));}
  1952 | T_SHARP '-' interval
  1882 | T_SHARP '-' interval
  1953 	{$$ = new duration_c(new neg_time_c(locloc(@$)), $3, locloc(@$));}
  1883 	{$$ = new duration_c(new neg_time_c(locloc(@$)), $3, locloc(@$));}
  1954 /* ERROR_CHECK_BEGIN */
  1884 /* ERROR_CHECK_BEGIN */
  1955 | TIME interval
  1885 | TIME interval
  1956 	{$$ = NULL;
  1886 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;}
  1957 	 yynerrs++;
       
  1958 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration.");
       
  1959 	}
       
  1960 | TIME '-' interval
  1887 | TIME '-' interval
  1961 	{$$ = NULL;
  1888 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;}
  1962 	 yynerrs++;
       
  1963 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration.");
       
  1964 	}
       
  1965 | TIME error interval
       
  1966 	{$$ = NULL;
       
  1967 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '#' between 'TIME' and interval in duration.");
       
  1968 	 yyerrok;
       
  1969 	}
       
  1970 | TIME error '-' interval
       
  1971 	{$$ = NULL;
       
  1972 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '#' between 'TIME' and interval in duration.");
       
  1973 	 yyerrok;
       
  1974 	}
       
  1975 | TIME '#' error
  1889 | TIME '#' error
  1976 	{$$ = NULL;
  1890 	{$$ = NULL;
  1977 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for duration.");
  1891 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for duration.");}
       
  1892 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yyclearin;}
  1978 	 yyerrok;
  1893 	 yyerrok;
  1979 	}
  1894 	}
  1980 | T_SHARP error
  1895 | T_SHARP error
  1981 	{$$ = NULL;
  1896 	{$$ = NULL;
  1982 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for duration.");
  1897 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for duration.");}
       
  1898 	 else {print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yyclearin;}
  1983 	 yyerrok;
  1899 	 yyerrok;
  1984 	}
  1900 	}
  1985 /* ERROR_CHECK_END */
  1901 /* ERROR_CHECK_END */
  1986 ;
  1902 ;
  1987 
  1903 
  2048 | integer_d '_' hours
  1964 | integer_d '_' hours
  2049 	{$$ = new days_c($1, $3, locloc(@$));}
  1965 	{$$ = new days_c($1, $3, locloc(@$));}
  2050 /* ERROR_CHECK_BEGIN */
  1966 /* ERROR_CHECK_BEGIN */
  2051 | integer_d '_' error
  1967 | integer_d '_' error
  2052 	{$$ = NULL;
  1968 	{$$ = NULL;
  2053 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for hours in duration.");
  1969 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for hours in duration.");}
       
  1970 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for hours in duration."); yyclearin;}
  2054 	 yyerrok;
  1971 	 yyerrok;
  2055 	}
  1972 	}
  2056 /* ERROR_CHECK_END */
  1973 /* ERROR_CHECK_END */
  2057 ;
  1974 ;
  2058 
  1975 
  2067 | integer_h '_' minutes
  1984 | integer_h '_' minutes
  2068 	{$$ = new hours_c($1, $3, locloc(@$));}
  1985 	{$$ = new hours_c($1, $3, locloc(@$));}
  2069 /* ERROR_CHECK_BEGIN */
  1986 /* ERROR_CHECK_BEGIN */
  2070 | integer_h '_' error
  1987 | integer_h '_' error
  2071 	{$$ = NULL;
  1988 	{$$ = NULL;
  2072 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for minutes in duration.");
  1989 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for minutes in duration.");}
       
  1990 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for minutes in duration."); yyclearin;}
  2073 	 yyerrok;
  1991 	 yyerrok;
  2074 	}
  1992 	}
  2075 /* ERROR_CHECK_END */
  1993 /* ERROR_CHECK_END */
  2076 
  1994 
  2077 ;
  1995 ;
  2086 | integer_m '_' seconds
  2004 | integer_m '_' seconds
  2087 	{$$ = new minutes_c($1, $3, locloc(@$));}
  2005 	{$$ = new minutes_c($1, $3, locloc(@$));}
  2088 /* ERROR_CHECK_BEGIN */
  2006 /* ERROR_CHECK_BEGIN */
  2089 | integer_m '_' error
  2007 | integer_m '_' error
  2090 	{$$ = NULL;
  2008 	{$$ = NULL;
  2091 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for seconds in duration.");
  2009 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for seconds in duration.");}
       
  2010 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for seconds in duration."); yyclearin;}
  2092 	 yyerrok;
  2011 	 yyerrok;
  2093 	}
  2012 	}
  2094 /* ERROR_CHECK_END */
  2013 /* ERROR_CHECK_END */
  2095 ;
  2014 ;
  2096 
  2015 
  2104 | integer_s '_' milliseconds
  2023 | integer_s '_' milliseconds
  2105 	{$$ = new seconds_c($1, $3, locloc(@$));}
  2024 	{$$ = new seconds_c($1, $3, locloc(@$));}
  2106 /* ERROR_CHECK_BEGIN */
  2025 /* ERROR_CHECK_BEGIN */
  2107 | integer_s '_' error
  2026 | integer_s '_' error
  2108 	{$$ = NULL;
  2027 	{$$ = NULL;
  2109 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for milliseconds in duration.");
  2028 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for milliseconds in duration.");}
       
  2029 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for milliseconds in duration."); yyclearin;}
  2110 	 yyerrok;
  2030 	 yyerrok;
  2111 	}
  2031 	}
  2112 /* ERROR_CHECK_END */
  2032 /* ERROR_CHECK_END */
  2113 ;
  2033 ;
  2114 
  2034 
  2126 time_of_day:
  2046 time_of_day:
  2127   TIME_OF_DAY '#' daytime
  2047   TIME_OF_DAY '#' daytime
  2128 	{$$ = new time_of_day_c($3, locloc(@$));}
  2048 	{$$ = new time_of_day_c($3, locloc(@$));}
  2129 /* ERROR_CHECK_BEGIN */
  2049 /* ERROR_CHECK_BEGIN */
  2130 | TIME_OF_DAY daytime
  2050 | TIME_OF_DAY daytime
  2131 	{$$ = NULL;
  2051 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME_OF_DAY' and daytime in time of day."); yynerrs++;}
  2132 	 yynerrs++;
       
  2133 	 print_err_msg(current_filename, locl(@1), locf(@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(@2), locl(@2), "expecting '#' between 'TIME_OF_DAY' and daytime in time of day.");
       
  2138 	 yyerrok;
       
  2139 	}
       
  2140 | TIME_OF_DAY '#' error
  2052 | TIME_OF_DAY '#' error
  2141 	{$$ = NULL;
  2053 	{$$ = NULL;
  2142 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for time of day.");
  2054 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for time of day.");}
       
  2055 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for time of day."); yyclearin;}
  2143 	 yyerrok;
  2056 	 yyerrok;
  2144 	}
  2057 	}
  2145 /* ERROR_CHECK_END */
  2058 /* ERROR_CHECK_END */
  2146 ;
  2059 ;
  2147 
  2060 
  2148 
  2061 
  2149 daytime:
  2062 daytime:
  2150   day_hour ':' day_minute ':' day_second
  2063   day_hour ':' day_minute ':' day_second
  2151 	{$$ = new daytime_c($1, $3, $5, locloc(@$));}
  2064 	{$$ = new daytime_c($1, $3, $5, locloc(@$));}
  2152 /* ERROR_CHECK_BEGIN */
  2065 /* ERROR_CHECK_BEGIN */
       
  2066 | ':' day_minute ':' day_second
       
  2067   {$$ = NULL; print_err_msg(locf(@1), locl(@4), "no value defined for hours in daytime."); yynerrs++;}
       
  2068 | error ':' day_minute ':' day_second
       
  2069   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid value defined for hours in daytime."); yyerrok;}
  2153 | day_hour day_minute ':' day_second
  2070 | day_hour day_minute ':' day_second
  2154   {$$ = NULL;
  2071   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between hours and minutes in daytime."); yynerrs++;}
  2155 	 yynerrs++;
       
  2156 	 print_err_msg(current_filename, locl(@1), locf(@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(@2), locl(@2), "expecting ':' between hours and minutes in daytime.");
       
  2161 	 yyerrok;
       
  2162 	}
       
  2163 | day_hour ':' ':' day_second
  2072 | day_hour ':' ':' day_second
  2164 	{$$ = NULL;
  2073 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for minutes in daytime."); yynerrs++;}
  2165 	 yynerrs++;
       
  2166 	 print_err_msg(current_filename, locl(@2), locf(@3), "no minutes defined in daytime.");
       
  2167 	}
       
  2168 | day_hour ':' error ':' day_second
  2074 | day_hour ':' error ':' day_second
  2169 	{$$ = NULL;
  2075 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value defined for minutes in daytime."); yyerrok;}
  2170 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for minutes in daytime.");
       
  2171 	 yyerrok;
       
  2172 	}
       
  2173 | day_hour ':' day_minute day_second
  2076 | day_hour ':' day_minute day_second
  2174   {$$ = NULL;
  2077   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "':' missing between minutes and seconds in daytime."); yynerrs++;}
  2175 	 yynerrs++;
       
  2176 	 print_err_msg(current_filename, locl(@3), locf(@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(@4), locl(@4), "expecting ':' between minutes and seconds in daytime.");
       
  2181 	 yyerrok;
       
  2182 	}
       
  2183 | day_hour ':' day_minute ':' error
  2078 | day_hour ':' day_minute ':' error
  2184   {$$ = NULL;
  2079   {$$ = NULL;
  2185 	 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for seconds in daytime.");
  2080 	 if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for seconds in daytime.");}
       
  2081 	 else {print_err_msg(locf(@5), locl(@5), "invalid value for seconds in daytime."); yyclearin;}
  2186 	 yyerrok;
  2082 	 yyerrok;
  2187 	}
  2083 	}
  2188 /* ERROR_CHECK_END */
  2084 /* ERROR_CHECK_END */
  2189 ;
  2085 ;
  2190 
  2086 
  2199 	{$$ = new date_c($3, locloc(@$));}
  2095 	{$$ = new date_c($3, locloc(@$));}
  2200 | D_SHARP date_literal
  2096 | D_SHARP date_literal
  2201 	{$$ = new date_c($2, locloc(@$));}
  2097 	{$$ = new date_c($2, locloc(@$));}
  2202 /* ERROR_CHECK_BEGIN */
  2098 /* ERROR_CHECK_BEGIN */
  2203 | DATE date_literal
  2099 | DATE date_literal
  2204 	{$$ = NULL;
  2100 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'DATE' and date literal in date."); yynerrs++;}
  2205 	 yynerrs++;
       
  2206 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between 'DATE' and date literal in date.");
       
  2207 	}
       
  2208 | DATE error date_literal
       
  2209 	{$$ = NULL;
       
  2210 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '#' between 'DATE' and date literal in date.");
       
  2211 	 yyerrok;
       
  2212 	}
       
  2213 | DATE '#' error
  2101 | DATE '#' error
  2214 	{$$ = NULL;
  2102 	{$$ = NULL;
  2215 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for date.");
  2103 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for date.");}
       
  2104 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for date."); yyclearin;}
  2216 	 yyerrok;
  2105 	 yyerrok;
  2217 	}
  2106 	}
  2218 | D_SHARP error
  2107 | D_SHARP error
  2219 	{$$ = NULL;
  2108   {$$ = NULL;
  2220 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid value for date.");
  2109 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for date.");}
       
  2110 	 else {print_err_msg(locf(@2), locl(@2), "invalid value for date."); yyclearin;}
  2221 	 yyerrok;
  2111 	 yyerrok;
  2222 	}
  2112 	}
  2223 /* ERROR_CHECK_END */
  2113 /* ERROR_CHECK_END */
  2224 ;
  2114 ;
  2225 
  2115 
  2226 
  2116 
  2227 date_literal:
  2117 date_literal:
  2228   year '-' month '-' day
  2118   year '-' month '-' day
  2229 	{$$ = new date_literal_c($1, $3, $5, locloc(@$));}
  2119 	{$$ = new date_literal_c($1, $3, $5, locloc(@$));}
  2230 /* ERROR_CHECK_BEGIN */
  2120 /* ERROR_CHECK_BEGIN */
       
  2121 | '-' month '-' day
       
  2122   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no value defined for year in date literal."); yynerrs++;}
  2231 | year month '-' day
  2123 | year month '-' day
       
  2124   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'-' missing between year and month in date literal."); yynerrs++;}
       
  2125 | year '-' '-' day
       
  2126 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for month in date literal."); yynerrs++;}
       
  2127 | year '-' error '-' day
       
  2128 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value defined for month in date literal."); yyerrok;}
       
  2129 | year '-' month day
       
  2130   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "'-' missing between month and day in date literal."); yynerrs++;}
       
  2131 | year '-' month '-' error
  2232   {$$ = NULL;
  2132   {$$ = NULL;
  2233 	 yynerrs++;
  2133 	 if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for day in date literal.");}
  2234 	 print_err_msg(current_filename, locl(@1), locf(@2), "'-' missing between year and month in date literal.");
  2134 	 else {print_err_msg(locf(@5), locl(@5), "invalid value for day in date literal."); yyclearin;}
  2235 	}
       
  2236 | year error month '-' day
       
  2237   {$$ = NULL;
       
  2238 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '-' between year and month in date literal.");
       
  2239 	 yyerrok;
       
  2240 	}
       
  2241 | year '-' '-' day
       
  2242 	{$$ = NULL;
       
  2243 	 yynerrs++;
       
  2244 	 print_err_msg(current_filename, locl(@2), locf(@3), "no month defined in date literal.");
       
  2245 	}
       
  2246 | year '-' error '-' day
       
  2247 	{$$ = NULL;
       
  2248 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for month in date literal.");
       
  2249 	 yyerrok;
       
  2250 	}
       
  2251 | year '-' month day
       
  2252   {$$ = NULL;
       
  2253 	 yynerrs++;
       
  2254 	 print_err_msg(current_filename, locl(@3), locf(@4), "':' missing between month and day in date literal.");
       
  2255 	}
       
  2256 | year ':' month error day
       
  2257   {$$ = NULL;
       
  2258 	 print_err_msg(current_filename, locf(@4), locl(@4), "expecting ':' between month and day in date literal.");
       
  2259 	 yyerrok;
       
  2260 	}
       
  2261 | year ':' month ':' error
       
  2262   {$$ = NULL;
       
  2263 	 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for day in date literal.");
       
  2264 	 yyerrok;
  2135 	 yyerrok;
  2265 	}
  2136 	}
  2266 /* ERROR_CHECK_END */
  2137 /* ERROR_CHECK_END */
  2267 ;
  2138 ;
  2268 
  2139 
  2275 date_and_time:
  2146 date_and_time:
  2276   DATE_AND_TIME '#' date_literal '-' daytime
  2147   DATE_AND_TIME '#' date_literal '-' daytime
  2277 	{$$ = new date_and_time_c($3, $5, locloc(@$));}
  2148 	{$$ = new date_and_time_c($3, $5, locloc(@$));}
  2278 /* ERROR_CHECK_BEGIN */
  2149 /* ERROR_CHECK_BEGIN */
  2279 | DATE_AND_TIME date_literal '-' daytime
  2150 | DATE_AND_TIME date_literal '-' daytime
  2280 	{$$ = NULL;
  2151 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'DATE_AND_TIME' and date literal in date and time."); yynerrs++;}
  2281 	 yynerrs++;
       
  2282 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between 'DATE_AND_TIME' and date literal in date and time.");
       
  2283 	}
       
  2284 | DATE_AND_TIME error date_literal '-' daytime
       
  2285 	{$$ = NULL;
       
  2286 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '#' between 'DATE_AND_TIME' and date literal in date and time.");
       
  2287 	 yyerrok;
       
  2288 	}
       
  2289 | DATE_AND_TIME '#' '-' daytime
  2152 | DATE_AND_TIME '#' '-' daytime
  2290 	{$$ = NULL;
  2153 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for date literal in date and time."); yynerrs++;}
  2291 	 yynerrs++;
       
  2292 	 print_err_msg(current_filename, locl(@2), locf(@3), "no value defined for date literal in date and time.");
       
  2293 	}
       
  2294 | DATE_AND_TIME '#' error '-' daytime
  2154 | DATE_AND_TIME '#' error '-' daytime
  2295 	{$$ = NULL;
  2155 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for date literal in date and time."); yyerrok;}
  2296 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for date literal in date and time.");
       
  2297 	 yyerrok;
       
  2298 	}
       
  2299 | DATE_AND_TIME '#' date_literal daytime
  2156 | DATE_AND_TIME '#' date_literal daytime
  2300 	{$$ = NULL;
  2157 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "'-' missing between date literal and daytime in date and time."); yynerrs++;}
  2301 	 yynerrs++;
       
  2302 	 print_err_msg(current_filename, locl(@3), locf(@4), "'-' missing between date literal and daytime in date and time.");
       
  2303 	}
       
  2304 | DATE_AND_TIME '#' date_literal error daytime
       
  2305 	{$$ = NULL;
       
  2306 	 print_err_msg(current_filename, locf(@4), locl(@4), "expecting '-' between date literal and daytime in date and time.");
       
  2307 	 yyerrok;
       
  2308 	}
       
  2309 | DATE_AND_TIME '#' date_literal '-' error
  2158 | DATE_AND_TIME '#' date_literal '-' error
  2310 	{$$ = NULL;
  2159 	{$$ = NULL;
  2311 	 print_err_msg(current_filename, locf(@5), locl(@5), "invalid value for daytime in date and time.");
  2160 	 if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for daytime in date and time.");}
       
  2161 	 else {print_err_msg(locf(@5), locl(@5), "invalid value for daytime in date and time."); yyclearin;}
  2312 	 yyerrok;
  2162 	 yyerrok;
  2313 	}
  2163 	}
  2314 /* ERROR_CHECK_END */
  2164 /* ERROR_CHECK_END */
  2315 ;
  2165 ;
  2316 
  2166 
  2475 data_type_declaration:
  2325 data_type_declaration:
  2476   TYPE type_declaration_list END_TYPE
  2326   TYPE type_declaration_list END_TYPE
  2477 	{$$ = new data_type_declaration_c($2, locloc(@$));}
  2327 	{$$ = new data_type_declaration_c($2, locloc(@$));}
  2478 /* ERROR_CHECK_BEGIN */
  2328 /* ERROR_CHECK_BEGIN */
  2479 | TYPE END_TYPE
  2329 | TYPE END_TYPE
  2480 	{$$ = NULL;
  2330 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no data type declared in data type(s) declaration."); yynerrs++;}
  2481 	 yynerrs++;
       
  2482 	 print_err_msg(current_filename, locl(@1), locf(@2), "no data type declared in data type(s) declaration.");
       
  2483 	}
       
  2484 | TYPE error type_declaration_list END_TYPE
  2331 | TYPE error type_declaration_list END_TYPE
  2485 	{$$ = NULL;
  2332 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'TYPE' in data type(s) declaration."); yyerrok;}
  2486 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'TYPE' in data type(s) declaration.");
  2333 | TYPE type_declaration_list error END_OF_INPUT
  2487 	 yyerrok;
  2334 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed data type(s) declaration."); yyerrok;}
  2488 	}
       
  2489 | TYPE error END_TYPE
  2335 | TYPE error END_TYPE
  2490 	{$$ = NULL;
  2336 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in data type(s) declaration."); yyerrok;}
  2491 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in data type(s) declaration.");
       
  2492 	 yyerrok;
       
  2493 	}
       
  2494 /* ERROR_CHECK_END */
  2337 /* ERROR_CHECK_END */
  2495 ;
  2338 ;
  2496 
  2339 
  2497 /* helper symbol for data_type_declaration */
  2340 /* helper symbol for data_type_declaration */
  2498 type_declaration_list:
  2341 type_declaration_list:
  2500 	{$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);}
  2343 	{$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);}
  2501 | type_declaration_list type_declaration ';'
  2344 | type_declaration_list type_declaration ';'
  2502 	{$$ = $1; $$->add_element($2);}
  2345 	{$$ = $1; $$->add_element($2);}
  2503 /* ERROR_CHECK_BEGIN */
  2346 /* ERROR_CHECK_BEGIN */
  2504 | error ';'
  2347 | error ';'
  2505 	{$$ = new type_declaration_list_c(locloc(@$));
  2348 	{$$ = new type_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid data type declaration."); yyerrok;}
  2506 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid data type declaration.");
       
  2507 	 yyerrok;
       
  2508 	}
       
  2509 | type_declaration error
  2349 | type_declaration error
  2510 	{$$ = new type_declaration_list_c(locloc(@$));
  2350 	{$$ = new type_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of data type declaration."); yyerrok;}
  2511 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of data type declaration.");
       
  2512 	 yyerrok;
       
  2513 	}
       
  2514 | type_declaration_list type_declaration error
  2351 | type_declaration_list type_declaration error
  2515 	{$$ = $1;
  2352 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of data type declaration."); yyerrok;}
  2516 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of data type declaration.");
       
  2517 	 yyerrok;
       
  2518 	}
       
  2519 | type_declaration_list error ';'
  2353 | type_declaration_list error ';'
  2520 	{$$ = $1;
  2354 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid data type declaration."); yyerrok;}
  2521 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid data type declaration.");
       
  2522 	 yyerrok;
       
  2523 	}
       
  2524 | type_declaration_list ';'
  2355 | type_declaration_list ';'
  2525 	{$$ = $1;
  2356 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after data type declaration."); yynerrs++;}
  2526 	 yynerrs++;
       
  2527 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after data type declaration.");
       
  2528 	}
       
  2529 /* ERROR_CHECK_END */
  2357 /* ERROR_CHECK_END */
  2530 ;
  2358 ;
  2531 
  2359 
  2532 type_declaration:
  2360 type_declaration:
  2533   single_element_type_declaration
  2361   single_element_type_declaration
  2547   identifier ':' simple_spec_init
  2375   identifier ':' simple_spec_init
  2548 	{$$ = new simple_type_declaration_c($1, $3, locloc(@$));
  2376 	{$$ = new simple_type_declaration_c($1, $3, locloc(@$));
  2549 	 library_element_symtable.insert($1, prev_declared_simple_type_name_token);
  2377 	 library_element_symtable.insert($1, prev_declared_simple_type_name_token);
  2550 	}
  2378 	}
  2551 /* ERROR_CHECK_BEGIN */
  2379 /* ERROR_CHECK_BEGIN */
       
  2380 | error ':' simple_spec_init
       
  2381 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for data type declaration.");yyerrok;}
  2552 | identifier simple_spec_init
  2382 | identifier simple_spec_init
  2553 	{$$ = NULL;
  2383 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in simple type declaration."); yynerrs++;}
  2554 	 yynerrs++;
       
  2555 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between data type name and specification in simple type declaration.");
       
  2556 	}
       
  2557 | identifier ':' identifier
       
  2558 	{$$ = NULL;
       
  2559 	 yynerrs++;
       
  2560 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown data type defined in specification for data type declaration.");
       
  2561 	}
       
  2562 | identifier ':' error
  2384 | identifier ':' error
  2563 	{$$ = NULL;
  2385 	{$$ = NULL;
  2564 	 print_err_msg(current_filename, locf(@3), locl(@3), "no specification defined in data type declaration.");
  2386 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in data type declaration.");}
       
  2387 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in data type declaration."); yyclearin;}
  2565 	 yyerrok;
  2388 	 yyerrok;
  2566 	}
  2389 	}
  2567 /* ERROR_CHECK_END */
  2390 /* ERROR_CHECK_END */
  2568 ;
  2391 ;
  2569 
  2392 
  2583 	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
  2406 	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
  2584 | prev_declared_simple_type_name ASSIGN constant
  2407 | prev_declared_simple_type_name ASSIGN constant
  2585 	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
  2408 	{$$ = new simple_spec_init_c($1, $3, locloc(@$));}
  2586 /* ERROR_CHECK_BEGIN */
  2409 /* ERROR_CHECK_BEGIN */
  2587 | elementary_type_name constant
  2410 | elementary_type_name constant
       
  2411 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in specification with initialization."); yynerrs++;}
       
  2412 | prev_declared_simple_type_name constant
       
  2413 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in specification with initialization."); yynerrs++;}
       
  2414 | elementary_type_name ASSIGN error
  2588 	{$$ = NULL;
  2415 	{$$ = NULL;
  2589 	 yynerrs++;
  2416 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in specification with initialization.");}
  2590 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in specification with initialization.");
  2417 	 else {print_err_msg(locf(@3), locl(@3), "invalid initial value in specification with initialization."); yyclearin;}
  2591 	}
  2418 	 yyerrok;
  2592 | prev_declared_simple_type_name constant
  2419 	}
       
  2420 | prev_declared_simple_type_name ASSIGN error
  2593 	{$$ = NULL;
  2421 	{$$ = NULL;
  2594 	 yynerrs++;
  2422 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in specification with initialization.");}
  2595 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in specification with initialization.");
  2423 	 else {print_err_msg(locf(@3), locl(@3), "invalid initial value in specification with initialization."); yyclearin;}
  2596 	}
  2424 	 yyerrok;
  2597 | identifier ASSIGN constant
       
  2598 	{$$ = NULL;
       
  2599 	 yynerrs++;
       
  2600 	 print_err_msg(current_filename, locf(@1), locl(@1), "unknown type defined in specification.");
       
  2601 	}
  2425 	}
  2602 /* ERROR_CHECK_END */
  2426 /* ERROR_CHECK_END */
  2603 ;
  2427 ;
  2604 
  2428 
  2605 /* When converting to C/C++, we need to know whether
  2429 /* When converting to C/C++, we need to know whether
  2627   identifier ':' subrange_spec_init
  2451   identifier ':' subrange_spec_init
  2628 	{$$ = new subrange_type_declaration_c($1, $3, locloc(@$));
  2452 	{$$ = new subrange_type_declaration_c($1, $3, locloc(@$));
  2629 	 library_element_symtable.insert($1, prev_declared_subrange_type_name_token);
  2453 	 library_element_symtable.insert($1, prev_declared_subrange_type_name_token);
  2630 	}
  2454 	}
  2631 /* ERROR_CHECK_BEGIN */
  2455 /* ERROR_CHECK_BEGIN */
       
  2456 | error ':' subrange_spec_init
       
  2457 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for subrange type declaration."); yyerrok;}
  2632 | identifier subrange_spec_init
  2458 | identifier subrange_spec_init
  2633 	{$$ = NULL;
  2459 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in subrange type declaration."); yynerrs++;}
  2634 	 yynerrs++;
       
  2635 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between data type name and specification in subrange type declaration.");
       
  2636 	}
       
  2637 /* ERROR_CHECK_END */
  2460 /* ERROR_CHECK_END */
  2638 ;
  2461 ;
  2639 
  2462 
  2640 subrange_spec_init:
  2463 subrange_spec_init:
  2641   subrange_specification
  2464   subrange_specification
  2642 	{$$ = new subrange_spec_init_c($1, NULL, locloc(@$));}
  2465 	{$$ = new subrange_spec_init_c($1, NULL, locloc(@$));}
  2643 | subrange_specification ASSIGN signed_integer
  2466 | subrange_specification ASSIGN signed_integer
  2644 	{$$ = new subrange_spec_init_c($1, $3, locloc(@$));}
  2467 	{$$ = new subrange_spec_init_c($1, $3, locloc(@$));}
  2645 /* ERROR_CHECK_BEGIN */
  2468 /* ERROR_CHECK_BEGIN */
  2646 | subrange_specification signed_integer
  2469 | subrange_specification signed_integer
       
  2470 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in subrange specification with initialization."); yynerrs++;}
       
  2471 | subrange_specification ASSIGN error
  2647 	{$$ = NULL;
  2472 	{$$ = NULL;
  2648 	 yynerrs++;
  2473 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in subrange specification with initialization.");}
  2649 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in subrange specification with initialization.");
  2474 	 else {print_err_msg(locf(@3), locl(@3), "invalid initial value in subrange specification with initialization."); yyclearin;}
       
  2475 	 yyerrok;
  2650 	}
  2476 	}
  2651 /* ERROR_CHECK_END */
  2477 /* ERROR_CHECK_END */
  2652 ;
  2478 ;
  2653 
  2479 
  2654 subrange_specification:
  2480 subrange_specification:
  2656 	{$$ = new subrange_specification_c($1, $3, locloc(@$));}
  2482 	{$$ = new subrange_specification_c($1, $3, locloc(@$));}
  2657 | prev_declared_subrange_type_name
  2483 | prev_declared_subrange_type_name
  2658   {$$ = new subrange_specification_c($1, NULL, locloc(@$));}
  2484   {$$ = new subrange_specification_c($1, NULL, locloc(@$));}
  2659 /* ERROR_CHECK_BEGIN */
  2485 /* ERROR_CHECK_BEGIN */
  2660 | integer_type_name '(' ')'
  2486 | integer_type_name '(' ')'
  2661 	{$$ = NULL;
  2487 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no subrange defined in subrange specification."); yynerrs++;}
  2662 	 yynerrs++;
       
  2663 	 print_err_msg(current_filename, locl(@2), locf(@3), "no subrange defined in subrange specification.");
       
  2664 	}
       
  2665 | integer_type_name '(' error ')'
  2488 | integer_type_name '(' error ')'
  2666 	{$$ = NULL;
  2489 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid subrange defined in subrange specification."); yyerrok;}
  2667 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid subrange defined in subrange specification.");
       
  2668 	 yyerrok;
       
  2669 	}
       
  2670 | integer_type_name '(' subrange error
  2490 | integer_type_name '(' subrange error
  2671 	{$$ = NULL;
  2491 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after subrange defined in subrange specification."); yyerrok;}
  2672 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing after subrange defined in subrange specification.");
       
  2673 	 yyerrok;
       
  2674 	}
       
  2675 /* ERROR_CHECK_END */
  2492 /* ERROR_CHECK_END */
  2676 ;
  2493 ;
  2677 
  2494 
  2678 
  2495 
  2679 subrange:
  2496 subrange:
  2680   signed_integer DOTDOT signed_integer
  2497   signed_integer DOTDOT signed_integer
  2681 	{$$ = new subrange_c($1, $3, locloc(@$));}
  2498 	{$$ = new subrange_c($1, $3, locloc(@$));}
  2682 /* ERROR_CHECK_BEGIN */
  2499 /* ERROR_CHECK_BEGIN */
  2683 | signed_integer signed_integer
  2500 | signed_integer signed_integer
  2684 	{$$ = NULL;
  2501 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'..' missing between bounds in subrange definition."); yynerrs++;}
  2685 	 yynerrs++;
       
  2686 	 print_err_msg(current_filename, locl(@1), locf(@2), "'..' missing between bounds in subrange definition.");
       
  2687 	}
       
  2688 | signed_integer error signed_integer
       
  2689 	{$$ = NULL;
       
  2690 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '..' between bounds in subrange definition.");
       
  2691 	 yyerrok;
       
  2692 	}
       
  2693 | signed_integer DOTDOT error
  2502 | signed_integer DOTDOT error
  2694 	{$$ = NULL;
  2503 	{$$ = NULL;
  2695 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for upper bound in subrange definition.");
  2504 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for upper bound in subrange definition.");}
       
  2505 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for upper bound in subrange definition."); yyclearin;}
  2696 	 yyerrok;
  2506 	 yyerrok;
  2697 	}
  2507 	}
  2698 /* ERROR_CHECK_END */
  2508 /* ERROR_CHECK_END */
  2699 ;
  2509 ;
  2700 
  2510 
  2703   identifier ':' enumerated_spec_init
  2513   identifier ':' enumerated_spec_init
  2704 	{$$ = new enumerated_type_declaration_c($1, $3, locloc(@$));
  2514 	{$$ = new enumerated_type_declaration_c($1, $3, locloc(@$));
  2705 	 library_element_symtable.insert($1, prev_declared_enumerated_type_name_token);
  2515 	 library_element_symtable.insert($1, prev_declared_enumerated_type_name_token);
  2706 	}
  2516 	}
  2707 /* ERROR_CHECK_BEGIN */
  2517 /* ERROR_CHECK_BEGIN */
       
  2518 | error ':' enumerated_spec_init
       
  2519 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for enumerated type declaration."); yyerrok;}
  2708 | identifier enumerated_spec_init
  2520 | identifier enumerated_spec_init
  2709 	{$$ = NULL;
  2521 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in enumerated type declaration."); yynerrs++;}
  2710 	 yynerrs++;
       
  2711 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between data type name and specification in enumerated type declaration.");
       
  2712 	}
       
  2713 /* ERROR_CHECK_END */
  2522 /* ERROR_CHECK_END */
  2714 ;
  2523 ;
  2715 
  2524 
  2716 
  2525 
  2717 enumerated_spec_init:
  2526 enumerated_spec_init:
  2719 	{$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));}
  2528 	{$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));}
  2720 | enumerated_specification ASSIGN enumerated_value
  2529 | enumerated_specification ASSIGN enumerated_value
  2721 	{$$ = new enumerated_spec_init_c($1, $3, locloc(@$));}
  2530 	{$$ = new enumerated_spec_init_c($1, $3, locloc(@$));}
  2722 /* ERROR_CHECK_BEGIN */
  2531 /* ERROR_CHECK_BEGIN */
  2723 | enumerated_specification enumerated_value
  2532 | enumerated_specification enumerated_value
       
  2533 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in enumerated specification with initialization."); yynerrs++;}
       
  2534 | enumerated_specification ASSIGN error
  2724 	{$$ = NULL;
  2535 	{$$ = NULL;
  2725 	 yynerrs++;
  2536 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in enumerated specification with initialization.");}
  2726 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in enumerated specification with initialization.");
  2537 	 else {print_err_msg(locf(@3), locl(@3), "invalid value in enumerated specification with initialization."); yyclearin;}
       
  2538 	 yyerrok;
  2727 	}
  2539 	}
  2728 /* ERROR_CHECK_END */
  2540 /* ERROR_CHECK_END */
  2729 ;
  2541 ;
  2730 
  2542 
  2731 enumerated_specification:
  2543 enumerated_specification:
  2732   '(' enumerated_value_list ')'
  2544   '(' enumerated_value_list ')'
  2733 	{$$ = $2;}
  2545 	{$$ = $2;}
  2734 | prev_declared_enumerated_type_name
  2546 | prev_declared_enumerated_type_name
  2735 /* ERROR_CHECK_BEGIN */
  2547 /* ERROR_CHECK_BEGIN */
  2736 | '(' ')'
  2548 | '(' ')'
  2737 	{$$ = NULL;
  2549 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no enumerated value list defined in enumerated specification."); yynerrs++;}
  2738 	 yynerrs++;
       
  2739 	 print_err_msg(current_filename, locl(@1), locf(@2), "no enumerated value list defined in enumerated specification.");
       
  2740 	}
       
  2741 | '(' error ')'
  2550 | '(' error ')'
  2742 	{$$ = NULL;
  2551 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid enumerated value list defined in enumerated specification.");yyerrok;}
  2743 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid enumerated value list defined in enumerated specification.");
       
  2744 	 yyerrok;
       
  2745 	}
       
  2746 | '(' enumerated_value_list error
  2552 | '(' enumerated_value_list error
  2747 	{$$ = NULL;
  2553 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of enumerated specification."); yyerrok;}
  2748 	 print_err_msg(current_filename, locl(@2), locf(@3), "')' missing at the end of enumerated specification.");
       
  2749 	 yyerrok;
       
  2750 	}
       
  2751 /* ERROR_CHECK_END */
  2554 /* ERROR_CHECK_END */
  2752 ;
  2555 ;
  2753 
  2556 
  2754 /* helper symbol for enumerated_specification */
  2557 /* helper symbol for enumerated_specification */
  2755 enumerated_value_list:
  2558 enumerated_value_list:
  2757 	{$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);}
  2560 	{$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);}
  2758 | enumerated_value_list ',' enumerated_value
  2561 | enumerated_value_list ',' enumerated_value
  2759 	{$$ = $1; $$->add_element($3);}
  2562 	{$$ = $1; $$->add_element($3);}
  2760 /* ERROR_CHECK_BEGIN */
  2563 /* ERROR_CHECK_BEGIN */
  2761 | enumerated_value_list enumerated_value
  2564 | enumerated_value_list enumerated_value
  2762 	{$$ = $1;
  2565 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in enumerated value list.");}
  2763 	 yynerrs++;
       
  2764 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in enumerated value list.");
       
  2765 	}
       
  2766 | enumerated_value_list ',' error
  2566 | enumerated_value_list ',' error
  2767 	{$$ = $1;
  2567 	{$$ = $1;
  2768 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value in enumerated value list.");
  2568 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in enumerated value list.");}
       
  2569 	 else {print_err_msg(locf(@3), locl(@3), "invalid value in enumerated value list."); yyclearin;}
  2769 	 yyerrok;
  2570 	 yyerrok;
  2770 	}
  2571 	}
  2771 /* ERROR_CHECK_END */
  2572 /* ERROR_CHECK_END */
  2772 ;
  2573 ;
  2773 
  2574 
  2777   {$$ = new enumerated_value_c(NULL, $1, locloc(@$));}
  2578   {$$ = new enumerated_value_c(NULL, $1, locloc(@$));}
  2778 | prev_declared_enumerated_type_name '#' any_identifier
  2579 | prev_declared_enumerated_type_name '#' any_identifier
  2779 	{$$ = new enumerated_value_c($1, $3, locloc(@$));}
  2580 	{$$ = new enumerated_value_c($1, $3, locloc(@$));}
  2780 /* ERROR_CHECK_BEGIN */
  2581 /* ERROR_CHECK_BEGIN */
  2781 | prev_declared_enumerated_type_name any_identifier
  2582 | prev_declared_enumerated_type_name any_identifier
  2782 	{$$ = NULL;
  2583 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between enumerated type name and value in enumerated literal."); yynerrs++;}
  2783 	 yynerrs++;
       
  2784 	 print_err_msg(current_filename, locl(@1), locf(@2), "'#' missing between enumerated type name and value in enumerated literal.");
       
  2785 	}
       
  2786 | prev_declared_enumerated_type_name error any_identifier
       
  2787 	{$$ = NULL;
       
  2788 	 print_err_msg(current_filename, locl(@1), locf(@3), "expecting '#' between enumerated type name and value in enumerated literal.");
       
  2789 	 yyerrok;
       
  2790 	}
       
  2791 | prev_declared_enumerated_type_name '#' error
  2584 | prev_declared_enumerated_type_name '#' error
  2792 	{$$ = NULL;
  2585 	{$$ = NULL;
  2793 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for enumerated literal.");
  2586 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for enumerated literal.");}
  2794 	 yyerrok;
  2587 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for enumerated literal."); yyclearin;}
  2795 	}
  2588 	 yyerrok;
  2796 | identifier '#' any_identifier
       
  2797 	{$$ = NULL;
       
  2798 	 yynerrs++;
       
  2799 	 print_err_msg(current_filename, locf(@1), locl(@1), "unknown type name for typed literal.");
       
  2800 	}
  2589 	}
  2801 /* ERROR_CHECK_END */
  2590 /* ERROR_CHECK_END */
  2802 ;
  2591 ;
  2803 
  2592 
  2804 
  2593 
  2816 	{$$ = new array_type_declaration_c($1, $3, locloc(@$));
  2605 	{$$ = new array_type_declaration_c($1, $3, locloc(@$));
  2817 	 library_element_symtable.insert($1, prev_declared_array_type_name_token);
  2606 	 library_element_symtable.insert($1, prev_declared_array_type_name_token);
  2818 	}
  2607 	}
  2819 /* ERROR_CHECK_BEGIN */
  2608 /* ERROR_CHECK_BEGIN */
  2820 | identifier array_spec_init
  2609 | identifier array_spec_init
  2821 	{$$ = NULL;
  2610 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in array type declaration."); yynerrs++;}
  2822 	 yynerrs++;
       
  2823 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between data type name and specification in array type declaration.");
       
  2824 	}
       
  2825 /* ERROR_CHECK_END */
  2611 /* ERROR_CHECK_END */
  2826 ;
  2612 ;
  2827 
  2613 
  2828 array_spec_init:
  2614 array_spec_init:
  2829   array_specification
  2615   array_specification
  2830 	{$$ = new array_spec_init_c($1, NULL, locloc(@$));}
  2616 	{$$ = new array_spec_init_c($1, NULL, locloc(@$));}
  2831 | array_specification ASSIGN array_initialization
  2617 | array_specification ASSIGN array_initialization
  2832 	{$$ = new array_spec_init_c($1, $3, locloc(@$));}
  2618 	{$$ = new array_spec_init_c($1, $3, locloc(@$));}
  2833 /* ERROR_CHECK_BEGIN */
  2619 /* ERROR_CHECK_BEGIN */
  2834 | array_specification array_initialization
  2620 | array_specification array_initialization
       
  2621 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in array specification with initialization."); yynerrs++;}
       
  2622 | array_specification ASSIGN error
  2835 	{$$ = NULL;
  2623 	{$$ = NULL;
  2836 	 yynerrs++;
  2624 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in array specification with initialization.");}
  2837 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in array specification with initialization.");
  2625 	 else {print_err_msg(locf(@3), locl(@3), "invalid initial value in array specification with initialization."); yyclearin;}
       
  2626 	 yyerrok;
  2838 	}
  2627 	}
  2839 /* ERROR_CHECK_END */
  2628 /* ERROR_CHECK_END */
  2840 ;
  2629 ;
  2841 
  2630 
  2842 
  2631 
  2844   prev_declared_array_type_name
  2633   prev_declared_array_type_name
  2845 | ARRAY '[' array_subrange_list ']' OF non_generic_type_name
  2634 | ARRAY '[' array_subrange_list ']' OF non_generic_type_name
  2846 	{$$ = new array_specification_c($3, $6, locloc(@$));}
  2635 	{$$ = new array_specification_c($3, $6, locloc(@$));}
  2847 /* ERROR_CHECK_BEGIN */
  2636 /* ERROR_CHECK_BEGIN */
  2848 | ARRAY array_subrange_list ']' OF non_generic_type_name
  2637 | ARRAY array_subrange_list ']' OF non_generic_type_name
  2849 	{$$ = NULL;
  2638 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'[' missing before subrange list in array specification."); yynerrs++;}
  2850 	 yynerrs++;
       
  2851 	 print_err_msg(current_filename, locl(@1), locf(@2), "'[' missing before subrange list in array specification.");
       
  2852 	}
       
  2853 | ARRAY error array_subrange_list ']' OF non_generic_type_name
       
  2854 	{$$ = NULL;
       
  2855 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '[' after 'ARRAY' in array specification.");
       
  2856 	 yyerrok;
       
  2857 	}
       
  2858 | ARRAY '[' ']' OF non_generic_type_name
  2639 | ARRAY '[' ']' OF non_generic_type_name
  2859 	{$$ = NULL;
  2640 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no subrange list defined in array specification."); yynerrs++;}
  2860 	 yynerrs++;
       
  2861 	 print_err_msg(current_filename, locl(@2), locf(@3), "no subrange list defined in array specification.");
       
  2862 	}
       
  2863 | ARRAY '[' error ']' OF non_generic_type_name
  2641 | ARRAY '[' error ']' OF non_generic_type_name
  2864 	{$$ = NULL;
  2642 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid subrange list defined in array specification."); yyerrok;}
  2865 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid subrange list defined in array specification.");
       
  2866 	 yyerrok;
       
  2867 	}
       
  2868 | ARRAY OF non_generic_type_name
  2643 | ARRAY OF non_generic_type_name
  2869 	{$$ = NULL;
  2644 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no subrange list defined in array specification."); yynerrs++;}
  2870 	 yynerrs++;
       
  2871 	 print_err_msg(current_filename, locl(@1), locf(@2), "no subrange list defined in array specification.");
       
  2872 	}
       
  2873 | ARRAY error OF non_generic_type_name
  2645 | ARRAY error OF non_generic_type_name
  2874 	{$$ = NULL;
  2646 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid subrange list defined in array specification."); yyerrok;}
  2875 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid subrange list defined in array specification.");
       
  2876 	 yyerrok;
       
  2877 	}
       
  2878 | ARRAY '[' array_subrange_list OF non_generic_type_name
  2647 | ARRAY '[' array_subrange_list OF non_generic_type_name
  2879 	{$$ = NULL;
  2648 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "']' missing after subrange list in array specification."); yynerrs++;}
  2880 	 yynerrs++;
       
  2881 	 print_err_msg(current_filename, locl(@3), locf(@4), "']' missing after subrange list in array specification.");
       
  2882 	}
       
  2883 | ARRAY '[' array_subrange_list error OF non_generic_type_name
       
  2884 	{$$ = NULL;
       
  2885 	 print_err_msg(current_filename, locf(@4), locl(@4), "expecting '[' after subrange list in array specification.");
       
  2886 	 yyerrok;
       
  2887 	}
       
  2888 | ARRAY '[' array_subrange_list ']' non_generic_type_name
  2649 | ARRAY '[' array_subrange_list ']' non_generic_type_name
  2889 	{$$ = NULL;
  2650 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "'OF' missing between subrange list and item type name in array specification."); yynerrs++;}
  2890 	 yynerrs++;
       
  2891 	 print_err_msg(current_filename, locl(@4), locf(@5), "'OF' missing between subrange list and item type name in array specification.");
       
  2892 	}
       
  2893 | ARRAY '[' array_subrange_list ']' error non_generic_type_name
       
  2894 	{$$ = NULL;
       
  2895 	 print_err_msg(current_filename, locf(@5), locl(@5), "expecting 'OF' between subrange list and item type name in array specification.");
       
  2896 	 yyerrok;
       
  2897 	}
       
  2898 | ARRAY '[' array_subrange_list ']' OF error
  2651 | ARRAY '[' array_subrange_list ']' OF error
  2899 	{$$ = NULL;
  2652 	{$$ = NULL;
  2900 	 print_err_msg(current_filename, locf(@6), locl(@6), "no item data type defined in array specification.");
  2653 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no item data type defined in array specification.");}
       
  2654 	 else {print_err_msg(locf(@3), locl(@3), "invalid item data type in array specification."); yyclearin;}
  2901 	 yyerrok;
  2655 	 yyerrok;
  2902 	}
  2656 	}
  2903 /* ERROR_CHECK_END */
  2657 /* ERROR_CHECK_END */
  2904 ;
  2658 ;
  2905 
  2659 
  2909 	{$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);}
  2663 	{$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);}
  2910 | array_subrange_list ',' subrange
  2664 | array_subrange_list ',' subrange
  2911 	{$$ = $1; $$->add_element($3);}
  2665 	{$$ = $1; $$->add_element($3);}
  2912 /* ERROR_CHECK_BEGIN */
  2666 /* ERROR_CHECK_BEGIN */
  2913 | array_subrange_list subrange
  2667 | array_subrange_list subrange
  2914 	{$$ = $1;
  2668 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in subrange list."); yynerrs++;}
  2915 	 yynerrs++;
       
  2916 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in subrange list.");
       
  2917 	}
       
  2918 | array_subrange_list ',' error
  2669 | array_subrange_list ',' error
  2919 	{$$ = $1;
  2670 	{$$ = $1;
  2920 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid subrange in subrange list.");
  2671 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no subrange defined in subrange list.");}
       
  2672 	 else {print_err_msg(locf(@3), locl(@3), "invalid subrange in subrange list."); yyclearin;}
  2921 	 yyerrok;
  2673 	 yyerrok;
  2922 	}
  2674 	}
  2923 /* ERROR_CHECK_END */
  2675 /* ERROR_CHECK_END */
  2924 ;
  2676 ;
  2925 
  2677 
  2927 array_initialization:
  2679 array_initialization:
  2928   '[' array_initial_elements_list ']'
  2680   '[' array_initial_elements_list ']'
  2929 	{$$ = $2;}
  2681 	{$$ = $2;}
  2930 /* ERROR_CHECK_BEGIN */
  2682 /* ERROR_CHECK_BEGIN */
  2931 | '[' ']'
  2683 | '[' ']'
  2932 	{$$ = NULL;
  2684 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no initial values list defined in array initialization."); yynerrs++;}
  2933 	 yynerrs++;
       
  2934 	 print_err_msg(current_filename, locl(@1), locf(@2), "no initial values list defined in array initialization.");
       
  2935 	}
       
  2936 | '[' error ']'
  2685 | '[' error ']'
  2937 	{$$ = NULL;
  2686 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid initial values list defined in array initialization."); yyerrok;}
  2938 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid initial values list defined in array initialization.");
       
  2939 	 yyerrok;
       
  2940 	}
       
  2941 | '[' array_initial_elements_list error
  2687 | '[' array_initial_elements_list error
  2942 	{$$ = NULL;
  2688 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "']' missing at the end of array initialization."); yyerrok;}
  2943 	 print_err_msg(current_filename, locl(@2), locf(@3), "']' missing at the end of array initialization.");
       
  2944 	 yyerrok;
       
  2945 	}
       
  2946 /* ERROR_CHECK_END */
  2689 /* ERROR_CHECK_END */
  2947 ;
  2690 ;
  2948 
  2691 
  2949 
  2692 
  2950 /* helper symbol for array_initialization */
  2693 /* helper symbol for array_initialization */
  2954 | array_initial_elements_list ',' array_initial_elements
  2697 | array_initial_elements_list ',' array_initial_elements
  2955 	{$$ = $1; $$->add_element($3);}
  2698 	{$$ = $1; $$->add_element($3);}
  2956 /* ERROR_CHECK_BEGIN 
  2699 /* ERROR_CHECK_BEGIN 
  2957 | array_initial_elements_list ',' error
  2700 | array_initial_elements_list ',' error
  2958 	{$$ = $1;
  2701 	{$$ = $1;
  2959 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid array initial value in array initial values list.");
  2702 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");}
       
  2703 	 else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;}
  2960 	 yyerrok;
  2704 	 yyerrok;
  2961 	}
  2705 	}
  2962 /* ERROR_CHECK_END */
  2706 /* ERROR_CHECK_END */
  2963 ;
  2707 ;
  2964 
  2708 
  2966 array_initial_elements:
  2710 array_initial_elements:
  2967   array_initial_element
  2711   array_initial_element
  2968 | integer '(' ')'
  2712 | integer '(' ')'
  2969 | integer '(' array_initial_element ')'
  2713 | integer '(' array_initial_element ')'
  2970 	{$$ = new array_initial_elements_c($1, $3, locloc(@$));}
  2714 	{$$ = new array_initial_elements_c($1, $3, locloc(@$));}
  2971 /* ERROR_CHECK_BEGIN 
  2715 /* ERROR_CHECK_BEGIN */
  2972 | integer '(' error ')'
  2716 | integer '(' error ')'
  2973 	{$$ = NULL;
  2717 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyerrok;}
  2974 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid array initial value in array initial values list.");
       
  2975 	 yyerrok;
       
  2976 	}
       
  2977 | integer '(' array_initial_element error
  2718 | integer '(' array_initial_element error
  2978 	{$$ = NULL;
  2719 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of array initial value in array initial values list."); yyerrok;}
  2979 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing at the end of array initial value in array initial values list.");
       
  2980 	 yyerrok;
       
  2981 	}
       
  2982 /* ERROR_CHECK_END */
  2720 /* ERROR_CHECK_END */
  2983 ;
  2721 ;
  2984 
  2722 
  2985 
  2723 
  2986 array_initial_element:
  2724 array_initial_element:
  2998 	{$$ = new structure_type_declaration_c($1, $3, locloc(@$));
  2736 	{$$ = new structure_type_declaration_c($1, $3, locloc(@$));
  2999 	 library_element_symtable.insert($1, prev_declared_structure_type_name_token);
  2737 	 library_element_symtable.insert($1, prev_declared_structure_type_name_token);
  3000 	}
  2738 	}
  3001 /* ERROR_CHECK_BEGIN */
  2739 /* ERROR_CHECK_BEGIN */
  3002 | identifier structure_specification
  2740 | identifier structure_specification
  3003 	{$$ = NULL;
  2741 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in structure type declaration."); yynerrs++;}
  3004 	 yynerrs++;
       
  3005 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between data type name and specification in structure type declaration.");
       
  3006 	}
       
  3007 /* ERROR_CHECK_END */
  2742 /* ERROR_CHECK_END */
  3008 ;
  2743 ;
  3009 
  2744 
  3010 
  2745 
  3011 structure_specification:
  2746 structure_specification:
  3019 	{$$ = new initialized_structure_c($1, NULL, locloc(@$));}
  2754 	{$$ = new initialized_structure_c($1, NULL, locloc(@$));}
  3020 | prev_declared_structure_type_name ASSIGN structure_initialization
  2755 | prev_declared_structure_type_name ASSIGN structure_initialization
  3021 	{$$ = new initialized_structure_c($1, $3, locloc(@$));}
  2756 	{$$ = new initialized_structure_c($1, $3, locloc(@$));}
  3022 /* ERROR_CHECK_BEGIN */
  2757 /* ERROR_CHECK_BEGIN */
  3023 | prev_declared_structure_type_name structure_initialization
  2758 | prev_declared_structure_type_name structure_initialization
       
  2759 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structure specification with initialization."); yynerrs++;}
       
  2760 | prev_declared_structure_type_name ASSIGN error
  3024 	{$$ = NULL;
  2761 	{$$ = NULL;
  3025 	 yynerrs++;
  2762 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in structure specification with initialization.");}
  3026 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in structure specification with initialization.");
  2763 	 else {print_err_msg(locf(@3), locl(@3), "invalid value in structure specification with initialization."); yyclearin;}
  3027 	}
  2764 	 yyerrok;
  3028 | identifier ASSIGN structure_initialization
       
  3029 	{$$ = NULL;
       
  3030 	 yynerrs++;
       
  3031 	 print_err_msg(current_filename, locf(@1), locl(@1), "unknown type name for structure specification with initialization.");
       
  3032 	}
  2765 	}
  3033 /* ERROR_CHECK_END */
  2766 /* ERROR_CHECK_END */
  3034 ;
  2767 ;
  3035 
  2768 
  3036 
  2769 
  3037 structure_declaration:
  2770 structure_declaration:
  3038   STRUCT structure_element_declaration_list END_STRUCT
  2771   STRUCT structure_element_declaration_list END_STRUCT
  3039 	{$$ = $2;}
  2772 	{$$ = $2;}
  3040 /* ERROR_CHECK_BEGIN */
  2773 /* ERROR_CHECK_BEGIN */
  3041 | STRUCT END_STRUCT
  2774 | STRUCT END_STRUCT
  3042 	{$$ = NULL;
  2775 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no structure element declared in structure type declaration."); yynerrs++;}
  3043 	 yynerrs++;
       
  3044 	 print_err_msg(current_filename, locl(@1), locf(@2), "no structure element declared in structure type declaration.");
       
  3045 	}
       
  3046 | STRUCT error structure_element_declaration_list END_STRUCT
  2776 | STRUCT error structure_element_declaration_list END_STRUCT
  3047 	{$$ = NULL;
  2777 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'STRUCT' in structure type declaration."); yyerrok;}
  3048 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'STRUCT' in structure type declaration.");
  2778 | STRUCT structure_element_declaration_list error END_OF_INPUT
  3049 	 yyerrok;
  2779 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed structure type declaration."); yyerrok;}
  3050 	}
       
  3051 | STRUCT error END_STRUCT
  2780 | STRUCT error END_STRUCT
  3052 	{$$ = NULL;
  2781 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in structure type declaration."); yyerrok;}
  3053 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in structure type declaration.");
       
  3054 	 yyerrok;
       
  3055 	}
       
  3056 /* ERROR_CHECK_END */
  2782 /* ERROR_CHECK_END */
  3057 ;
  2783 ;
  3058 
  2784 
  3059 /* helper symbol for structure_declaration */
  2785 /* helper symbol for structure_declaration */
  3060 structure_element_declaration_list:
  2786 structure_element_declaration_list:
  3062 	{$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);}
  2788 	{$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);}
  3063 | structure_element_declaration_list structure_element_declaration ';'
  2789 | structure_element_declaration_list structure_element_declaration ';'
  3064 	{$$ = $1; $$->add_element($2);}
  2790 	{$$ = $1; $$->add_element($2);}
  3065 /* ERROR_CHECK_BEGIN */
  2791 /* ERROR_CHECK_BEGIN */
  3066 | error ';'
  2792 | error ';'
  3067 	{$$ = new structure_element_declaration_list_c(locloc(@$));
  2793 	{$$ = new structure_element_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid structure element declaration."); yyerrok;}
  3068 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid structure element declaration.");
       
  3069 	 yyerrok;
       
  3070 	}
       
  3071 | structure_element_declaration error
  2794 | structure_element_declaration error
  3072 	{$$ = new structure_element_declaration_list_c(locloc(@$));
  2795 	{$$ = new structure_element_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of structure element declaration."); yyerrok;}
  3073 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of structure element declaration.");
       
  3074 	 yyerrok;
       
  3075 	}
       
  3076 | structure_element_declaration_list structure_element_declaration error
  2796 | structure_element_declaration_list structure_element_declaration error
  3077 	{$$ = $1;
  2797 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of structure element declaration."); yyerrok;}
  3078 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of structure element declaration.");
       
  3079 	 yyerrok;
       
  3080 	}
       
  3081 | structure_element_declaration_list error ';'
  2798 | structure_element_declaration_list error ';'
  3082 	{$$ = $1;
  2799 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid structure element declaration."); yyerrok;}
  3083 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid structure element declaration.");
       
  3084 	 yyerrok;
       
  3085 	}
       
  3086 | structure_element_declaration_list ';'
  2800 | structure_element_declaration_list ';'
  3087 	{$$ = $1;
  2801 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after structure element declaration."); yynerrs++;}
  3088 	 yynerrs++;
       
  3089 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after structure element declaration.");
       
  3090 	}
       
  3091 /* ERROR_CHECK_END */
  2802 /* ERROR_CHECK_END */
  3092 ;
  2803 ;
  3093 
  2804 
  3094 
  2805 
  3095 structure_element_declaration:
  2806 structure_element_declaration:
  3103 	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
  2814 	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
  3104 | structure_element_name ':' initialized_structure
  2815 | structure_element_name ':' initialized_structure
  3105 	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
  2816 	{$$ = new structure_element_declaration_c($1, $3, locloc(@$));}
  3106 /* ERROR_CHECK_BEGIN */
  2817 /* ERROR_CHECK_BEGIN */
  3107 | structure_element_name simple_spec_init
  2818 | structure_element_name simple_spec_init
  3108 	{$$ = NULL;
  2819 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and simple specification."); yynerrs++;}
  3109 	 yynerrs++;
       
  3110 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between structure element name and simple specification.");
       
  3111 	}
       
  3112 | structure_element_name subrange_spec_init
  2820 | structure_element_name subrange_spec_init
  3113 	{$$ = NULL;
  2821 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and subrange specification."); yynerrs++;}
  3114 	 yynerrs++;
       
  3115 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between structure element name and subrange specification.");
       
  3116 	}
       
  3117 | structure_element_name enumerated_spec_init
  2822 | structure_element_name enumerated_spec_init
  3118 	{$$ = NULL;
  2823 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and enumerated specification."); yynerrs++;}
  3119 	 yynerrs++;
       
  3120 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between structure element name and enumerated specification.");
       
  3121 	}
       
  3122 | structure_element_name array_spec_init
  2824 | structure_element_name array_spec_init
  3123 	{$$ = NULL;
  2825 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and array specification."); yynerrs++;}
  3124 	 yynerrs++;
       
  3125 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between structure element name and array specification.");
       
  3126 	}
       
  3127 | structure_element_name initialized_structure
  2826 | structure_element_name initialized_structure
  3128 	{$$ = NULL;
  2827 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and structure specification."); yynerrs++;}
  3129 	 yynerrs++;
       
  3130 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between structure element name and structure specification.");
       
  3131 	}
       
  3132 | structure_element_name ':' identifier
       
  3133 	{$$ = NULL;
       
  3134 	 yynerrs++;
       
  3135 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown variable type defined in structure element declaration.");
       
  3136 	}
       
  3137 | structure_element_name ':' error
  2828 | structure_element_name ':' error
  3138 	{$$ = NULL;
  2829 	{$$ = NULL;
  3139 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in structure element declaration.");
  2830 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in structure element declaration.");}
       
  2831 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in structure element declaration."); yyclearin;}
  3140 	 yyerrok;
  2832 	 yyerrok;
  3141 	}
  2833 	}
  3142 /* ERROR_CHECK_END */
  2834 /* ERROR_CHECK_END */
  3143 ;
  2835 ;
  3144 
  2836 
  3149 structure_initialization:
  2841 structure_initialization:
  3150   '(' structure_element_initialization_list ')'
  2842   '(' structure_element_initialization_list ')'
  3151 	{$$ = $2;}
  2843 	{$$ = $2;}
  3152 /* ERROR_CHECK_BEGIN */
  2844 /* ERROR_CHECK_BEGIN */
  3153 | '(' error ')'
  2845 | '(' error ')'
  3154 	{$$ = NULL;
  2846 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid structure element initialization list in structure initialization."); yyerrok;}
  3155 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid structure element initialization list in structure initialization.");
       
  3156 	 yyerrok;
       
  3157 	}
       
  3158 | '(' structure_element_initialization_list error
  2847 | '(' structure_element_initialization_list error
  3159 	{$$ = NULL;
  2848 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ')' at the end of structure element initialization list in structure initialization."); yyerrok;}
  3160 	 print_err_msg(current_filename, locl(@2), locf(@3), "expecting ')' at the end of structure element initialization list in structure initialization.");
       
  3161 	 yyerrok;
       
  3162 	}
       
  3163 /* ERROR_CHECK_END */
  2849 /* ERROR_CHECK_END */
  3164 ;
  2850 ;
  3165 
  2851 
  3166 /* helper symbol for structure_initialization */
  2852 /* helper symbol for structure_initialization */
  3167 structure_element_initialization_list:
  2853 structure_element_initialization_list:
  3169 	{$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);}
  2855 	{$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);}
  3170 | structure_element_initialization_list ',' structure_element_initialization
  2856 | structure_element_initialization_list ',' structure_element_initialization
  3171 	{$$ = $1; $$->add_element($3);}
  2857 	{$$ = $1; $$->add_element($3);}
  3172 /* ERROR_CHECK_BEGIN 
  2858 /* ERROR_CHECK_BEGIN 
  3173 | structure_element_initialization_list structure_element_initialization
  2859 | structure_element_initialization_list structure_element_initialization
  3174 	{$$ = $1;
  2860 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;}
  3175 	 yynerrs++;
       
  3176 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization.");
       
  3177 	}
       
  3178 | structure_element_initialization_list ',' error
  2861 | structure_element_initialization_list ',' error
  3179 	{$$ = $1;
  2862 	{$$ = $1;
  3180 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid structure element initialization in structure initialization.");
  2863 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");}
       
  2864 	 else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;}
  3181 	 yyerrok;
  2865 	 yyerrok;
  3182 	}
  2866 	}
  3183 /* ERROR_CHECK_END */
  2867 /* ERROR_CHECK_END */
  3184 ;
  2868 ;
  3185 
  2869 
  3193 	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
  2877 	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
  3194 | structure_element_name ASSIGN structure_initialization
  2878 | structure_element_name ASSIGN structure_initialization
  3195 	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
  2879 	{$$ = new structure_element_initialization_c($1, $3, locloc(@$));}
  3196 /* ERROR_CHECK_BEGIN */
  2880 /* ERROR_CHECK_BEGIN */
  3197 | structure_element_name constant
  2881 | structure_element_name constant
       
  2882 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structure element initialization."); yynerrs++;}
       
  2883 | structure_element_name enumerated_value
       
  2884 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in enumerated structure element initialization."); yynerrs++;}
       
  2885 | structure_element_name array_initialization
       
  2886 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in array structure element initialization."); yynerrs++;}
       
  2887 | structure_element_name structure_initialization
       
  2888 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structured structure element initialization."); yynerrs++;}
       
  2889 | structure_element_name ASSIGN error
  3198 	{$$ = NULL;
  2890 	{$$ = NULL;
  3199 	 yynerrs++;
  2891 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in structured structure element initialization.");}
  3200 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in structure element initialization.");
  2892 	 else {print_err_msg(locf(@3), locl(@3), "invalid initial value in structured structure element initialization."); yyclearin;}
  3201 	}
  2893 	 yyerrok;
  3202 | structure_element_name enumerated_value
       
  3203 	{$$ = NULL;
       
  3204 	 yynerrs++;
       
  3205 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in enumerated structure element initialization.");
       
  3206 	}
       
  3207 | structure_element_name array_initialization
       
  3208 	{$$ = NULL;
       
  3209 	 yynerrs++;
       
  3210 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in array structure element initialization.");
       
  3211 	}
       
  3212 | structure_element_name structure_initialization
       
  3213 	{$$ = NULL;
       
  3214 	 yynerrs++;
       
  3215 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing in structured structure element initialization.");
       
  3216 	}
  2894 	}
  3217 /* ERROR_CHECK_END */
  2895 /* ERROR_CHECK_END */
  3218 ;
  2896 ;
  3219 
  2897 
  3220 /* NOTE: in order to remove a reduce/reduce conflict,
  2898 /* NOTE: in order to remove a reduce/reduce conflict,
  3419 	{$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3097 	{$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3420 | VAR_INPUT NON_RETAIN input_declaration_list END_VAR
  3098 | VAR_INPUT NON_RETAIN input_declaration_list END_VAR
  3421 	{$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3099 	{$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3422 /* ERROR_CHECK_BEGIN */
  3100 /* ERROR_CHECK_BEGIN */
  3423 | VAR_INPUT END_VAR
  3101 | VAR_INPUT END_VAR
  3424 	{$$ = NULL;
  3102 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in input variable(s) declaration."); yynerrs++;}
  3425 	 yynerrs++;
       
  3426 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in input variable(s) declaration.");
       
  3427 	}
       
  3428 | VAR_INPUT RETAIN END_VAR
  3103 | VAR_INPUT RETAIN END_VAR
  3429 	{$$ = NULL;
  3104 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive input variable(s) declaration."); yynerrs++;}
  3430 	 yynerrs++;
       
  3431 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in retentive input variable(s) declaration.");
       
  3432 	}
       
  3433 | VAR_INPUT NON_RETAIN END_VAR
  3105 | VAR_INPUT NON_RETAIN END_VAR
  3434 	{$$ = NULL;
  3106 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive input variable(s) declaration."); yynerrs++;}
  3435 	 yynerrs++;
       
  3436 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in non-retentive input variable(s) declaration.");
       
  3437 	}
       
  3438 | VAR_INPUT error input_declaration_list END_VAR
  3107 | VAR_INPUT error input_declaration_list END_VAR
  3439 	{$$ = NULL;
  3108 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_INPUT' in input variable(s) declaration."); yyerrok;}
  3440 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_INPUT' in input variable(s) declaration.");
       
  3441 	 yyerrok;
       
  3442 	}
       
  3443 | VAR_INPUT RETAIN error input_declaration_list END_VAR
  3109 | VAR_INPUT RETAIN error input_declaration_list END_VAR
  3444 	{$$ = NULL;
  3110 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive input variable(s) declaration."); yyerrok;}
  3445 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive input variable(s) declaration.");
       
  3446 	 yyerrok;
       
  3447 	}
       
  3448 | VAR_INPUT NON_RETAIN error input_declaration_list END_VAR
  3111 | VAR_INPUT NON_RETAIN error input_declaration_list END_VAR
  3449 	{$$ = NULL;
  3112 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive input variable(s) declaration."); yyerrok;}
  3450 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive input variable(s) declaration.");
  3113 | VAR_INPUT input_declaration_list error END_OF_INPUT
  3451 	 yyerrok;
  3114 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed input variable(s) declaration."); yyerrok;}
  3452 	}
  3115 | VAR_INPUT RETAIN input_declaration_list error END_OF_INPUT
       
  3116 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive input variable(s) declaration."); yyerrok;}
       
  3117 | VAR_INPUT NON_RETAIN input_declaration_list error END_OF_INPUT
       
  3118 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive input variable(s) declaration."); yyerrok;}
  3453 | VAR_INPUT error END_VAR
  3119 | VAR_INPUT error END_VAR
  3454 	{$$ = NULL;
  3120 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in input variable(s) declaration."); yyerrok;}
  3455 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in input variable(s) declaration.");
       
  3456 	 yyerrok;
       
  3457 	}
       
  3458 | VAR_INPUT RETAIN error END_VAR
  3121 | VAR_INPUT RETAIN error END_VAR
  3459 	{$$ = NULL;
  3122 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive input variable(s) declaration."); yyerrok;}
  3460 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in retentive input variable(s) declaration.");
       
  3461 	 yyerrok;
       
  3462 	}
       
  3463 | VAR_INPUT NON_RETAIN error END_VAR
  3123 | VAR_INPUT NON_RETAIN error END_VAR
  3464 	{$$ = NULL;
  3124 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non-retentive input variable(s) declaration."); yyerrok;}
  3465 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in non-retentive input variable(s) declaration.");
       
  3466 	 yyerrok;
       
  3467 	}
       
  3468 /* ERROR_CHECK_END */
  3125 /* ERROR_CHECK_END */
  3469 ;
  3126 ;
  3470 
  3127 
  3471 /* helper symbol for input_declarations */
  3128 /* helper symbol for input_declarations */
  3472 input_declaration_list:
  3129 input_declaration_list:
  3474 	{$$ = new input_declaration_list_c(locloc(@$)); $$->add_element($1);}
  3131 	{$$ = new input_declaration_list_c(locloc(@$)); $$->add_element($1);}
  3475 | input_declaration_list input_declaration ';'
  3132 | input_declaration_list input_declaration ';'
  3476 	{$$ = $1; $$->add_element($2);}
  3133 	{$$ = $1; $$->add_element($2);}
  3477 /* ERROR_CHECK_BEGIN */
  3134 /* ERROR_CHECK_BEGIN */
  3478 | error ';'
  3135 | error ';'
  3479 	{$$ = new input_declaration_list_c(locloc(@$));
  3136 	{$$ = new input_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid input variable(s) declaration."); yyerrok;}
  3480 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid input variable(s) declaration.");
       
  3481 	 yyerrok;
       
  3482 	}
       
  3483 | input_declaration error
  3137 | input_declaration error
  3484 	{$$ = new input_declaration_list_c(locloc(@$));
  3138 	{$$ = new input_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of input variable(s) declaration."); yyerrok;}
  3485 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of input variable(s) declaration.");
       
  3486 	 yyerrok;
       
  3487 	}
       
  3488 | input_declaration_list input_declaration error
  3139 | input_declaration_list input_declaration error
  3489 	{$$ = $1;
  3140 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of input variable(s) declaration."); yyerrok;}
  3490 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of input variable(s) declaration.");
       
  3491 	 yyerrok;
       
  3492 	}
       
  3493 | input_declaration_list error ';'
  3141 | input_declaration_list error ';'
  3494 	{$$ = $1;
  3142 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid input variable(s) declaration."); yyerrok;}
  3495 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid input variable(s) declaration.");
       
  3496 	 yyerrok;
       
  3497 	}
       
  3498 | input_declaration_list ';'
  3143 | input_declaration_list ';'
  3499 	{$$ = $1;
  3144 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after input variable(s) declaration."); yynerrs++;}
  3500 	 yynerrs++;
       
  3501 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after input variable(s) declaration.");
       
  3502 	}
       
  3503 /* ERROR_CHECK_END */
  3145 /* ERROR_CHECK_END */
  3504 ;
  3146 ;
  3505 
  3147 
  3506 
  3148 
  3507 input_declaration:
  3149 input_declaration:
  3515 	{$$ = new edge_declaration_c(new raising_edge_option_c(locloc(@3)), $1, locloc(@$));}
  3157 	{$$ = new edge_declaration_c(new raising_edge_option_c(locloc(@3)), $1, locloc(@$));}
  3516 | var1_list ':' BOOL F_EDGE
  3158 | var1_list ':' BOOL F_EDGE
  3517 	{$$ = new edge_declaration_c(new falling_edge_option_c(locloc(@3)), $1, locloc(@$));}
  3159 	{$$ = new edge_declaration_c(new falling_edge_option_c(locloc(@3)), $1, locloc(@$));}
  3518 /* ERROR_CHECK_BEGIN */
  3160 /* ERROR_CHECK_BEGIN */
  3519 | var1_list BOOL R_EDGE
  3161 | var1_list BOOL R_EDGE
  3520 	{$$ = NULL;
  3162 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification."); yynerrs++;}
  3521 	 yynerrs++;
       
  3522 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and specification.");
       
  3523 	}
       
  3524 | var1_list BOOL F_EDGE
  3163 | var1_list BOOL F_EDGE
  3525 	{$$ = NULL;
  3164 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification."); yynerrs++;}
  3526 	 yynerrs++;
       
  3527 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and specification.");
       
  3528 	}
       
  3529 | var1_list ':' BOOL R_EDGE F_EDGE
  3165 | var1_list ':' BOOL R_EDGE F_EDGE
  3530 	{$$ = NULL;
  3166 	{$$ = NULL; print_err_msg(locf(@5), locl(@5), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration."); yynerrs++;}
  3531 	 yynerrs++;
       
  3532 	 print_err_msg(current_filename, locf(@5), locl(@5), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration.");
       
  3533 	}
       
  3534 | var1_list ':' R_EDGE
  3167 | var1_list ':' R_EDGE
  3535 	{$$ = NULL;
  3168 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in edge declaration."); yynerrs++;}
  3536 	 yynerrs++;
       
  3537 	 print_err_msg(current_filename, locl(@2), locf(@3), "'BOOL' missing in edge declaration.");
       
  3538 	}
       
  3539 | var1_list ':' F_EDGE
  3169 | var1_list ':' F_EDGE
  3540 	{$$ = NULL;
  3170 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in edge declaration."); yynerrs++;}
  3541 	 yynerrs++;
       
  3542 	 print_err_msg(current_filename, locl(@2), locf(@3), "'BOOL' missing in edge declaration.");
       
  3543 	}
       
  3544 /* ERROR_CHECK_END */
  3171 /* ERROR_CHECK_END */
  3545 ;
  3172 ;
  3546 
  3173 
  3547 
  3174 
  3548 var_init_decl:
  3175 var_init_decl:
  3563 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3190 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3564 | var1_list ':' enumerated_spec_init
  3191 | var1_list ':' enumerated_spec_init
  3565 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3192 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3566 /* ERROR_CHECK_BEGIN */
  3193 /* ERROR_CHECK_BEGIN */
  3567 | var1_list simple_spec_init
  3194 | var1_list simple_spec_init
  3568 	{$$ = NULL;
  3195 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and simple specification."); yynerrs++;}
  3569 	 yynerrs++;
       
  3570 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and simple specification.");
       
  3571 	}
       
  3572 | var1_list subrange_spec_init
  3196 | var1_list subrange_spec_init
  3573 	{$$ = NULL;
  3197 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and subrange specification."); yynerrs++;}
  3574 	 yynerrs++;
       
  3575 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and subrange specification.");
       
  3576 	}
       
  3577 | var1_list enumerated_spec_init
  3198 | var1_list enumerated_spec_init
  3578 	{$$ = NULL;
  3199 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and enumerated specification."); yynerrs++;}
  3579 	 yynerrs++;
       
  3580 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and enumerated specification.");
       
  3581 	}
       
  3582 | var1_list ':' identifier
       
  3583 	{$$ = NULL;
       
  3584 	 yynerrs++;
       
  3585 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown variable type defined in variable declaration.");
       
  3586 	}
       
  3587 | var1_list ':' error
  3200 | var1_list ':' error
  3588 	{$$ = NULL;
  3201 	{$$ = NULL;
  3589 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in variable declaration.");
  3202 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in variable declaration.");}
       
  3203 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in variable declaration."); yyclearin;}
  3590 	 yyerrok;
  3204 	 yyerrok;
  3591 	}
  3205 	}
  3592 /* ERROR_CHECK_END */
  3206 /* ERROR_CHECK_END */
  3593 ;
  3207 ;
  3594 
  3208 
  3602 	{$$ = $1; $$->add_element($3);
  3216 	{$$ = $1; $$->add_element($3);
  3603 	 variable_name_symtable.insert($3, prev_declared_variable_name_token);
  3217 	 variable_name_symtable.insert($3, prev_declared_variable_name_token);
  3604 	}
  3218 	}
  3605 /* ERROR_CHECK_BEGIN */
  3219 /* ERROR_CHECK_BEGIN */
  3606 | var1_list variable_name
  3220 | var1_list variable_name
  3607 	{$$ = $1;
  3221 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in variable list."); yynerrs++;}
  3608 	 yynerrs++;
       
  3609 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in variable list.");
       
  3610 	}
       
  3611 | var1_list ',' error
  3222 | var1_list ',' error
  3612 	{$$ = $1;
  3223 	{$$ = $1;
  3613 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ',' in variable declaration.");
  3224 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable name defined in variable declaration.");}
       
  3225 	 else {print_err_msg(locf(@3), locl(@3), "invalid variable name in variable declaration."); yyclearin;}
  3614 	 yyerrok;
  3226 	 yyerrok;
  3615 	}
  3227 	}
  3616 /* ERROR_CHECK_END */
  3228 /* ERROR_CHECK_END */
  3617 ;
  3229 ;
  3618 
  3230 
  3621 array_var_init_decl:
  3233 array_var_init_decl:
  3622  var1_list ':' array_spec_init
  3234  var1_list ':' array_spec_init
  3623 	{$$ = new array_var_init_decl_c($1, $3, locloc(@$));}
  3235 	{$$ = new array_var_init_decl_c($1, $3, locloc(@$));}
  3624 /* ERROR_CHECK_BEGIN */
  3236 /* ERROR_CHECK_BEGIN */
  3625 | var1_list array_spec_init
  3237 | var1_list array_spec_init
  3626 	{$$ = NULL;
  3238 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and array specification."); yynerrs++;}
  3627 	 yynerrs++;
       
  3628 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and array specification.");
       
  3629 	}
       
  3630 /* ERROR_CHECK_END */
  3239 /* ERROR_CHECK_END */
  3631 ;
  3240 ;
  3632 
  3241 
  3633 
  3242 
  3634 structured_var_init_decl:
  3243 structured_var_init_decl:
  3635   var1_list ':' initialized_structure
  3244   var1_list ':' initialized_structure
  3636 	{$$ = new structured_var_init_decl_c($1, $3, locloc(@$));}
  3245 	{$$ = new structured_var_init_decl_c($1, $3, locloc(@$));}
  3637 /* ERROR_CHECK_BEGIN */
  3246 /* ERROR_CHECK_BEGIN */
  3638 | var1_list initialized_structure
  3247 | var1_list initialized_structure
  3639 	{$$ = NULL;
  3248 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and structured specification."); yynerrs++;}
  3640 	 yynerrs++;
       
  3641 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and structured specification.");
       
  3642 	}
       
  3643 /* ERROR_CHECK_END */
  3249 /* ERROR_CHECK_END */
  3644 ;
  3250 ;
  3645 
  3251 
  3646 
  3252 
  3647 /* NOTE: see notes above fb_name_list and var1_list
  3253 /* NOTE: see notes above fb_name_list and var1_list
  3656 /*| fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
  3262 /*| fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
  3657 | fb_name_list_with_colon function_block_type_name ASSIGN structure_initialization
  3263 | fb_name_list_with_colon function_block_type_name ASSIGN structure_initialization
  3658 	{$$ = new fb_name_decl_c($1, $2, $4, locloc(@$));}
  3264 	{$$ = new fb_name_decl_c($1, $2, $4, locloc(@$));}
  3659 /* ERROR_CHECK_BEGIN */
  3265 /* ERROR_CHECK_BEGIN */
  3660 | fb_name_list_with_colon ASSIGN structure_initialization
  3266 | fb_name_list_with_colon ASSIGN structure_initialization
  3661 	{$$ = NULL;
  3267 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block type name defined in function block declaration with initialization."); yynerrs++;}
  3662 	 yynerrs++;
       
  3663 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function block type name defined in function block declaration with initialization.");
       
  3664 	}
       
  3665 | fb_name_list_with_colon function_block_type_name structure_initialization
  3268 | fb_name_list_with_colon function_block_type_name structure_initialization
  3666 	{$$ = NULL;
  3269 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing in function block declaration with initialization."); yynerrs++;}
  3667 	 yynerrs++;
       
  3668 	 print_err_msg(current_filename, locl(@2), locf(@3), "':=' missing in function block declaration with initialization.");
       
  3669 	}
       
  3670 | fb_name_list_with_colon function_block_type_name ASSIGN error
  3270 | fb_name_list_with_colon function_block_type_name ASSIGN error
  3671 	{$$ = NULL;
  3271 	{$$ = NULL;
  3672 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid initialization in function block declaration.");
  3272 	 if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no initialization defined in function block declaration.");}
       
  3273 	 else {print_err_msg(locf(@4), locl(@4), "invalid initialization in function block declaration."); yyclearin;}
  3673 	 yyerrok;
  3274 	 yyerrok;
  3674 	}
  3275 	}
  3675 /* ERROR_CHECK_END */
  3276 /* ERROR_CHECK_END */
  3676 ;
  3277 ;
  3677 
  3278 
  3735 	{$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3336 	{$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3736 | VAR_OUTPUT NON_RETAIN var_init_decl_list END_VAR
  3337 | VAR_OUTPUT NON_RETAIN var_init_decl_list END_VAR
  3737 	{$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3338 	{$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3738 /* ERROR_CHECK_BEGIN */
  3339 /* ERROR_CHECK_BEGIN */
  3739 | VAR_OUTPUT END_VAR
  3340 | VAR_OUTPUT END_VAR
  3740 	{$$ = NULL;
  3341 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in output variable(s) declaration."); yynerrs++;}
  3741 	 yynerrs++;
       
  3742 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in output variable(s) declaration.");
       
  3743 	}
       
  3744 | VAR_OUTPUT RETAIN END_VAR
  3342 | VAR_OUTPUT RETAIN END_VAR
  3745 	{$$ = NULL;
  3343 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive output variable(s) declaration."); yynerrs++;}
  3746 	 yynerrs++;
       
  3747 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in retentive output variable(s) declaration.");
       
  3748 	}
       
  3749 | VAR_OUTPUT NON_RETAIN END_VAR
  3344 | VAR_OUTPUT NON_RETAIN END_VAR
  3750 	{$$ = NULL;
  3345 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive output variable(s) declaration."); yynerrs++;}
  3751 	 yynerrs++;
       
  3752 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in non-retentive output variable(s) declaration.");
       
  3753 	}
       
  3754 | VAR_OUTPUT error var_init_decl_list END_VAR
  3346 | VAR_OUTPUT error var_init_decl_list END_VAR
  3755 	{$$ = NULL;
  3347 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_OUPUT' in output variable(s) declaration."); yyerrok;}
  3756 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_OUPUT' in output variable(s) declaration.");
       
  3757 	 yyerrok;
       
  3758 	}
       
  3759 | VAR_OUTPUT RETAIN error var_init_decl_list END_VAR
  3348 | VAR_OUTPUT RETAIN error var_init_decl_list END_VAR
  3760 	{$$ = NULL;
  3349 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive output variable(s) declaration."); yyerrok;}
  3761 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive output variable(s) declaration.");
       
  3762 	 yyerrok;
       
  3763 	}
       
  3764 | VAR_OUTPUT NON_RETAIN error var_init_decl_list END_VAR
  3350 | VAR_OUTPUT NON_RETAIN error var_init_decl_list END_VAR
  3765 	{$$ = NULL;
  3351 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive output variable(s) declaration."); yyerrok;}
  3766 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive output variable(s) declaration.");
  3352 | VAR_OUTPUT var_init_decl_list error END_OF_INPUT
  3767 	 yyerrok;
  3353 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed output variable(s) declaration."); yyerrok;}
  3768 	}
  3354 | VAR_OUTPUT RETAIN var_init_decl_list error END_OF_INPUT
       
  3355 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive output variable(s) declaration."); yyerrok;}
       
  3356 | VAR_OUTPUT NON_RETAIN var_init_decl_list error END_OF_INPUT
       
  3357 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive output variable(s) declaration."); yyerrok;}
  3769 | VAR_OUTPUT error END_VAR
  3358 | VAR_OUTPUT error END_VAR
  3770 	{$$ = NULL;
  3359 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in output variable(s) declaration."); yyerrok;}
  3771 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in output variable(s) declaration.");
       
  3772 	 yyerrok;
       
  3773 	}
       
  3774 | VAR_OUTPUT RETAIN error END_VAR
  3360 | VAR_OUTPUT RETAIN error END_VAR
  3775 	{$$ = NULL;
  3361 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive output variable(s) declaration."); yyerrok;}
  3776 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in retentive output variable(s) declaration.");
       
  3777 	 yyerrok;
       
  3778 	}
       
  3779 | VAR_OUTPUT NON_RETAIN error END_VAR
  3362 | VAR_OUTPUT NON_RETAIN error END_VAR
  3780 	{$$ = NULL;
  3363 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non-retentive output variable(s) declaration."); yyerrok;}
  3781 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in non-retentive output variable(s) declaration.");
       
  3782 	 yyerrok;
       
  3783 	}
       
  3784 /* ERROR_CHECK_END */
  3364 /* ERROR_CHECK_END */
  3785 ;
  3365 ;
  3786 
  3366 
  3787 
  3367 
  3788 
  3368 
  3789 input_output_declarations:
  3369 input_output_declarations:
  3790   VAR_IN_OUT var_declaration_list END_VAR
  3370   VAR_IN_OUT var_declaration_list END_VAR
  3791 	{$$ = new input_output_declarations_c($2, locloc(@$));}
  3371 	{$$ = new input_output_declarations_c($2, locloc(@$));}
  3792 /* ERROR_CHECK_BEGIN */
  3372 /* ERROR_CHECK_BEGIN */
  3793 | VAR_IN_OUT END_VAR
  3373 | VAR_IN_OUT END_VAR
  3794 	{$$ = NULL;
  3374 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in in_out variable(s) declaration."); yynerrs++;}
  3795 	 yynerrs++;
  3375 | VAR_IN_OUT error var_declaration_list END_VAR
  3796 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in in_out variable(s) declaration.");
  3376 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_IN_OUT' in in_out variable(s) declaration."); yyerrok;}
  3797 	}
  3377 | VAR_IN_OUT var_declaration_list error END_OF_INPUT
       
  3378 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed in_out variable(s) declaration."); yyerrok;}
  3798 | VAR_IN_OUT error END_VAR
  3379 | VAR_IN_OUT error END_VAR
  3799 	{$$ = NULL;
  3380 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in in_out variable(s) declaration."); yyerrok;}
  3800 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in in_out variable(s) declaration.");
       
  3801 	 yyerrok;
       
  3802 	}
       
  3803 /* ERROR_CHECK_END */
  3381 /* ERROR_CHECK_END */
  3804 ;
  3382 ;
  3805 
  3383 
  3806 
  3384 
  3807 
  3385 
  3811 	{$$ = new var_declaration_list_c(locloc(@$)); $$->add_element($1);}
  3389 	{$$ = new var_declaration_list_c(locloc(@$)); $$->add_element($1);}
  3812 | var_declaration_list var_declaration ';'
  3390 | var_declaration_list var_declaration ';'
  3813 	{$$ = $1; $$->add_element($2);}
  3391 	{$$ = $1; $$->add_element($2);}
  3814 /* ERROR_CHECK_BEGIN */
  3392 /* ERROR_CHECK_BEGIN */
  3815 | error ';'
  3393 | error ';'
  3816 	{$$ = new var_declaration_list_c(locloc(@$));
  3394 	{$$ = new var_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid variable(s) declaration."); yyerrok;}
  3817 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid variable(s) declaration.");
       
  3818 	 yyerrok;
       
  3819 	}
       
  3820 | var_declaration error
  3395 | var_declaration error
  3821 	{$$ = new var_declaration_list_c(locloc(@$));
  3396 	{$$ = new var_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of variable(s) declaration."); yyerrok;}
  3822 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of variable(s) declaration.");
       
  3823 	 yyerrok;
       
  3824 	}
       
  3825 | var_declaration_list var_declaration error
  3397 | var_declaration_list var_declaration error
  3826 	{$$ = $1;
  3398 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;}
  3827 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of variable(s) declaration.");
       
  3828 	 yyerrok;
       
  3829 	}
       
  3830 | var_declaration_list error ';'
  3399 | var_declaration_list error ';'
  3831 	{$$ = $1;
  3400 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;}
  3832 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid variable(s) declaration.");
       
  3833 	 yyerrok;
       
  3834 	}
       
  3835 | var_declaration_list ';'
  3401 | var_declaration_list ';'
  3836 	{$$ = $1;
  3402 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after variable(s) declaration."); yynerrs++;}
  3837 	 yynerrs++;
       
  3838 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after variable(s) declaration.");
       
  3839 	}
       
  3840 /* ERROR_CHECK_END */
  3403 /* ERROR_CHECK_END */
  3841 ;
  3404 ;
  3842 
  3405 
  3843 
  3406 
  3844 var_declaration:
  3407 var_declaration:
  3861 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3424 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3862 | var1_list ':' enumerated_specification
  3425 | var1_list ':' enumerated_specification
  3863 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3426 	{$$ = new var1_init_decl_c($1, $3, locloc(@$));}
  3864 /* ERROR_CHECK_BEGIN */
  3427 /* ERROR_CHECK_BEGIN */
  3865 | var1_list simple_specification
  3428 | var1_list simple_specification
  3866 	{$$ = NULL;
  3429 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and simple specification."); yynerrs++;}
  3867 	 yynerrs++;
       
  3868 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and simple specification.");
       
  3869 	}
       
  3870 | var1_list subrange_specification
  3430 | var1_list subrange_specification
  3871 	{$$ = NULL;
  3431 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and subrange specification."); yynerrs++;}
  3872 	 yynerrs++;
       
  3873 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and subrange specification.");
       
  3874 	}
       
  3875 | var1_list enumerated_specification
  3432 | var1_list enumerated_specification
  3876 	{$$ = NULL;
  3433 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and enumerated specification."); yynerrs++;}
  3877 	 yynerrs++;
       
  3878 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and enumerated specification.");
       
  3879 	}
       
  3880 /* ERROR_CHECK_END */
  3434 /* ERROR_CHECK_END */
  3881 ;
  3435 ;
  3882 
  3436 
  3883 
  3437 
  3884 
  3438 
  3885 array_var_declaration:
  3439 array_var_declaration:
  3886   var1_list ':' array_specification
  3440   var1_list ':' array_specification
  3887 	{$$ = new array_var_declaration_c($1, $3, locloc(@$));}
  3441 	{$$ = new array_var_declaration_c($1, $3, locloc(@$));}
  3888 /* ERROR_CHECK_BEGIN */
  3442 /* ERROR_CHECK_BEGIN */
  3889 | var1_list array_specification
  3443 | var1_list array_specification
  3890 	{$$ = NULL;
  3444 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and array specification."); yynerrs++;}
  3891 	 yynerrs++;
       
  3892 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and array specification.");
       
  3893 	}
       
  3894 /* ERROR_CHECK_END */
  3445 /* ERROR_CHECK_END */
  3895 ;
  3446 ;
  3896 
  3447 
  3897 structured_var_declaration:
  3448 structured_var_declaration:
  3898   var1_list ':' prev_declared_structure_type_name
  3449   var1_list ':' prev_declared_structure_type_name
  3899 	{$$ = new structured_var_declaration_c($1, $3, locloc(@$));}
  3450 	{$$ = new structured_var_declaration_c($1, $3, locloc(@$));}
  3900 /* ERROR_CHECK_BEGIN */
  3451 /* ERROR_CHECK_BEGIN */
  3901 | var1_list prev_declared_structure_type_name
  3452 | var1_list prev_declared_structure_type_name
  3902 	{$$ = NULL;
  3453 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and structured specification."); yynerrs++;}
  3903 	 yynerrs++;
       
  3904 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and structured specification.");
       
  3905 	}
       
  3906 | var1_list ':' identifier
       
  3907 	{$$ = NULL;
       
  3908 	 yynerrs++;
       
  3909 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown type name in structured variable declaration.");
       
  3910 	}
       
  3911 /* ERROR_CHECK_END */
  3454 /* ERROR_CHECK_END */
  3912 ;
  3455 ;
  3913 
  3456 
  3914 
  3457 
  3915 var_declarations:
  3458 var_declarations:
  3917 	{$$ = new var_declarations_c(NULL, $2, locloc(@$));}
  3460 	{$$ = new var_declarations_c(NULL, $2, locloc(@$));}
  3918 | VAR CONSTANT var_init_decl_list END_VAR
  3461 | VAR CONSTANT var_init_decl_list END_VAR
  3919 	{$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  3462 	{$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  3920 /* ERROR_CHECK_BEGIN */
  3463 /* ERROR_CHECK_BEGIN */
  3921 | VAR END_VAR
  3464 | VAR END_VAR
  3922 	{$$ = NULL;
  3465 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in variable(s) declaration."); yynerrs++;}
  3923 	 yynerrs++;
       
  3924 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in variable(s) declaration.");
       
  3925 	}
       
  3926 | VAR CONSTANT END_VAR
  3466 | VAR CONSTANT END_VAR
  3927 	{$$ = NULL;
  3467 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant variable(s) declaration."); yynerrs++;}
  3928 	 yynerrs++;
       
  3929 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in constant variable(s) declaration.");
       
  3930 	}
       
  3931 | VAR error var_init_decl_list END_VAR
  3468 | VAR error var_init_decl_list END_VAR
  3932 	{$$ = NULL;
  3469 	{$$ = NULL; print_err_msg(locl(@1), locf(@3), "unexpected token after 'VAR' in variable(s) declaration."); yyerrok;}
  3933 	 print_err_msg(current_filename, locl(@1), locf(@3), "unexpected token after 'VAR' in variable(s) declaration.");
       
  3934 	 yyerrok;
       
  3935 	}
       
  3936 | VAR CONSTANT error var_init_decl_list END_VAR
  3470 | VAR CONSTANT error var_init_decl_list END_VAR
  3937 	{$$ = NULL;
  3471 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant variable(s) declaration."); yyerrok;}
  3938 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant variable(s) declaration.");
  3472 | VAR var_init_decl_list error END_OF_INPUT
  3939 	 yyerrok;
  3473 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed variable(s) declaration."); yyerrok;}
  3940 	}
  3474 | VAR CONSTANT var_init_decl_list error END_OF_INPUT
       
  3475 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant variable(s) declaration."); yyerrok;}
  3941 | VAR error END_VAR
  3476 | VAR error END_VAR
  3942 	{$$ = NULL;
  3477 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in variable(s) declaration."); yyerrok;}
  3943 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in variable(s) declaration.");
       
  3944 	 yyerrok;
       
  3945 	}
       
  3946 | VAR CONSTANT error END_VAR
  3478 | VAR CONSTANT error END_VAR
  3947 	{$$ = NULL;
  3479 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant variable(s) declaration."); yyerrok;}
  3948 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in constant variable(s) declaration.");
       
  3949 	 yyerrok;
       
  3950 	}
       
  3951 /* ERROR_CHECK_END */
  3480 /* ERROR_CHECK_END */
  3952 ;
  3481 ;
  3953 
  3482 
  3954 
  3483 
  3955 retentive_var_declarations:
  3484 retentive_var_declarations:
  3956   VAR RETAIN var_init_decl_list END_VAR
  3485   VAR RETAIN var_init_decl_list END_VAR
  3957 	{$$ = new retentive_var_declarations_c($3, locloc(@$));}
  3486 	{$$ = new retentive_var_declarations_c($3, locloc(@$));}
  3958 /* ERROR_CHECK_BEGIN */
  3487 /* ERROR_CHECK_BEGIN */
  3959 | VAR RETAIN END_VAR
  3488 | VAR RETAIN END_VAR
  3960 	{$$ = NULL;
  3489 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive variable(s) declaration."); yynerrs++;}
  3961 	 yynerrs++;
       
  3962 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in retentive variable(s) declaration.");
       
  3963 	}
       
  3964 | VAR RETAIN error var_init_decl_list END_VAR
  3490 | VAR RETAIN error var_init_decl_list END_VAR
  3965 	{$$ = NULL;
  3491 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive variable(s) declaration."); yyerrok;}
  3966 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive variable(s) declaration.");
  3492 | VAR RETAIN var_init_decl_list error END_OF_INPUT
  3967 	 yyerrok;
  3493 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive variable(s) declaration."); yyerrok;}
  3968 	}
       
  3969 | VAR RETAIN error END_VAR
  3494 | VAR RETAIN error END_VAR
  3970 	{$$ = NULL;
  3495 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive variable(s) declaration."); yyerrok;}
  3971 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in retentive variable(s) declaration.");
       
  3972 	 yyerrok;
       
  3973 	}
       
  3974 /* ERROR_CHECK_END */
  3496 /* ERROR_CHECK_END */
  3975 ;
  3497 ;
  3976 
  3498 
  3977 
  3499 
  3978 located_var_declarations:
  3500 located_var_declarations:
  3984 	{$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3506 	{$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3985 | VAR NON_RETAIN located_var_decl_list END_VAR
  3507 | VAR NON_RETAIN located_var_decl_list END_VAR
  3986 	{$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3508 	{$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3987 /* ERROR_CHECK_BEGIN */
  3509 /* ERROR_CHECK_BEGIN */
  3988 | VAR NON_RETAIN END_VAR
  3510 | VAR NON_RETAIN END_VAR
  3989 	{$$ = NULL;
  3511 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive located variable(s) declaration."); yynerrs++;}
  3990 	 yynerrs++;
       
  3991 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in non-retentive located variable(s) declaration.");
       
  3992 	}
       
  3993 | VAR error located_var_decl_list END_VAR
  3512 | VAR error located_var_decl_list END_VAR
  3994 	{$$ = NULL;
  3513 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in located variable(s) declaration."); yyerrok;}
  3995 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR' in located variable(s) declaration.");
       
  3996 	 yyerrok;
       
  3997 	}
       
  3998 | VAR CONSTANT error located_var_decl_list END_VAR
  3514 | VAR CONSTANT error located_var_decl_list END_VAR
  3999 	{$$ = NULL;
  3515 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant located variable(s) declaration."); yyerrok;}
  4000 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant located variable(s) declaration.");
       
  4001 	 yyerrok;
       
  4002 	}
       
  4003 | VAR RETAIN error located_var_decl_list END_VAR
  3516 | VAR RETAIN error located_var_decl_list END_VAR
  4004 	{$$ = NULL;
  3517 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); yyerrok;}
  4005 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration.");
       
  4006 	 yyerrok;
       
  4007 	}
       
  4008 | VAR NON_RETAIN error located_var_decl_list END_VAR
  3518 | VAR NON_RETAIN error located_var_decl_list END_VAR
  4009 	{$$ = NULL;
  3519 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); yyerrok;}
  4010 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration.");
  3520 | VAR located_var_decl_list error END_OF_INPUT
  4011 	 yyerrok;
  3521 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed located variable(s) declaration."); yyerrok;}
  4012 	}
  3522 | VAR CONSTANT located_var_decl_list error END_OF_INPUT
       
  3523 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant located variable(s) declaration."); yyerrok;}
       
  3524 | VAR RETAIN located_var_decl_list error END_OF_INPUT
       
  3525 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive located variable(s) declaration."); yyerrok;}
       
  3526 | VAR NON_RETAIN located_var_decl_list error END_OF_INPUT
       
  3527 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive located variable(s) declaration."); yyerrok;}
  4013 | VAR NON_RETAIN error END_VAR
  3528 | VAR NON_RETAIN error END_VAR
  4014 	{$$ = NULL;
  3529 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non retentive variable(s) declaration."); yyerrok;}
  4015 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in non retentive variable(s) declaration.");
       
  4016 	 yyerrok;
       
  4017 	}
       
  4018 /* ERROR_CHECK_END */
  3530 /* ERROR_CHECK_END */
  4019 ;
  3531 ;
  4020 
  3532 
  4021 
  3533 
  4022 /* helper symbol for located_var_declarations */
  3534 /* helper symbol for located_var_declarations */
  4025 	{$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);}
  3537 	{$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);}
  4026 | located_var_decl_list located_var_decl ';'
  3538 | located_var_decl_list located_var_decl ';'
  4027 	{$$ = $1; $$->add_element($2);}
  3539 	{$$ = $1; $$->add_element($2);}
  4028 /* ERROR_CHECK_BEGIN */
  3540 /* ERROR_CHECK_BEGIN */
  4029 | error ';'
  3541 | error ';'
  4030 	{$$ = new located_var_decl_list_c(locloc(@$));
  3542 	{$$ = new located_var_decl_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid located variable declaration."); yyerrok;}
  4031 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid located variable declaration.");
       
  4032 	 yyerrok;
       
  4033 	}
       
  4034 | located_var_decl error
  3543 | located_var_decl error
  4035 	{$$ = new located_var_decl_list_c(locloc(@$));
  3544 	{$$ = new located_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of located variable declaration."); yyerrok;}
  4036 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of located variable declaration.");
       
  4037 	 yyerrok;
       
  4038 	}
       
  4039 | located_var_decl_list located_var_decl error
  3545 | located_var_decl_list located_var_decl error
  4040 	{$$ = $1;
  3546 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of located variable declaration."); yyerrok;}
  4041 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of located variable declaration.");
       
  4042 	 yyerrok;
       
  4043 	}
       
  4044 | located_var_decl_list error ';'
  3547 | located_var_decl_list error ';'
  4045 	{$$ = $1;
  3548 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid located variable declaration."); yyerrok;}
  4046 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid located variable declaration.");
       
  4047 	 yyerrok;
       
  4048 	}
       
  4049 | located_var_decl_list ';'
  3549 | located_var_decl_list ';'
  4050 	{$$ = $1;
  3550 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after located variable declaration."); yynerrs++;}
  4051 	 yynerrs++;
       
  4052 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after located variable declaration.");
       
  4053 	}
       
  4054 /* ERROR_CHECK_END */
  3551 /* ERROR_CHECK_END */
  4055 ;
  3552 ;
  4056 
  3553 
  4057 
  3554 
  4058 located_var_decl:
  3555 located_var_decl:
  4062 	}
  3559 	}
  4063 | location ':' located_var_spec_init
  3560 | location ':' located_var_spec_init
  4064 	{$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));}
  3561 	{$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));}
  4065 /* ERROR_CHECK_BEGIN */
  3562 /* ERROR_CHECK_BEGIN */
  4066 | variable_name location located_var_spec_init
  3563 | variable_name location located_var_spec_init
  4067 	{$$ = NULL;
  3564 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between located variable location and specification."); yynerrs++;}
  4068 	 yynerrs++;
       
  4069 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between located variable location and specification.");
       
  4070 	}
       
  4071 | location located_var_spec_init
  3565 | location located_var_spec_init
  4072 	{$$ = NULL;
  3566 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between located variable location and specification."); yynerrs++;}
  4073 	 yynerrs++;
       
  4074 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between located variable location and specification.");
       
  4075 	}
       
  4076 | variable_name location ':' error
  3567 | variable_name location ':' error
  4077 	{$$ = NULL;
  3568 	{$$ = NULL;
  4078 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in located variable declaration.");
  3569 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in located variable declaration.");}
       
  3570 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in located variable declaration."); yyclearin;}
  4079 	 yyerrok;
  3571 	 yyerrok;
  4080 	}
  3572 	}
  4081 | location ':' error
  3573 | location ':' error
  4082 	{$$ = NULL;
  3574 	{$$ = NULL;
  4083 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in located variable declaration.");
  3575 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in located variable declaration.");}
       
  3576 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in located variable declaration."); yyclearin;}
  4084 	 yyerrok;
  3577 	 yyerrok;
  4085 	}
  3578 	}
  4086 /* ERROR_CHECK_END */
  3579 /* ERROR_CHECK_END */
  4087 ;
  3580 ;
  4088 
  3581 
  4094 	{$$ = new external_var_declarations_c(NULL, $2, locloc(@$));}
  3587 	{$$ = new external_var_declarations_c(NULL, $2, locloc(@$));}
  4095 | VAR_EXTERNAL CONSTANT external_declaration_list END_VAR
  3588 | VAR_EXTERNAL CONSTANT external_declaration_list END_VAR
  4096 	{$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  3589 	{$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  4097 /* ERROR_CHECK_BEGIN */
  3590 /* ERROR_CHECK_BEGIN */
  4098 | VAR_EXTERNAL END_VAR
  3591 | VAR_EXTERNAL END_VAR
  4099 	{$$ = NULL;
  3592 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in external variable(s) declaration."); yynerrs++;}
  4100 	 yynerrs++;
       
  4101 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in external variable(s) declaration.");
       
  4102 	}
       
  4103 | VAR_EXTERNAL CONSTANT END_VAR
  3593 | VAR_EXTERNAL CONSTANT END_VAR
  4104 	{$$ = NULL;
  3594 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant external variable(s) declaration."); yynerrs++;}
  4105 	 yynerrs++;
       
  4106 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in constant external variable(s) declaration.");
       
  4107 	}
       
  4108 | VAR_EXTERNAL error external_declaration_list END_VAR
  3595 | VAR_EXTERNAL error external_declaration_list END_VAR
  4109 	{$$ = NULL;
  3596 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_EXTERNAL' in external variable(s) declaration."); yyerrok;}
  4110 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_EXTERNAL' in external variable(s) declaration.");
       
  4111 	 yyerrok;
       
  4112 	}
       
  4113 | VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR
  3597 | VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR
  4114 	{$$ = NULL;
  3598 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant external variable(s) declaration."); yyerrok;}
  4115 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant external variable(s) declaration.");
  3599 | VAR_EXTERNAL external_declaration_list error END_OF_INPUT
  4116 	 yyerrok;
  3600 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed external variable(s) declaration."); yyerrok;}
  4117 	}
  3601 | VAR_EXTERNAL CONSTANT external_declaration_list error END_OF_INPUT
       
  3602 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant external variable(s) declaration."); yyerrok;}
  4118 | VAR_EXTERNAL error END_VAR
  3603 | VAR_EXTERNAL error END_VAR
  4119 	{$$ = NULL;
  3604 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in external variable(s) declaration."); yyerrok;}
  4120 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in external variable(s) declaration.");
       
  4121 	 yyerrok;
       
  4122 	}
       
  4123 | VAR_EXTERNAL CONSTANT error END_VAR
  3605 | VAR_EXTERNAL CONSTANT error END_VAR
  4124 	{$$ = NULL;
  3606 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant external variable(s) declaration."); yyerrok;}
  4125 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in constant external variable(s) declaration.");
       
  4126 	 yyerrok;
       
  4127 	}
       
  4128 /* ERROR_CHECK_END */
  3607 /* ERROR_CHECK_END */
  4129 ;
  3608 ;
  4130 
  3609 
  4131 /* helper symbol for external_var_declarations */
  3610 /* helper symbol for external_var_declarations */
  4132 external_declaration_list:
  3611 external_declaration_list:
  4134 	{$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);}
  3613 	{$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);}
  4135 | external_declaration_list external_declaration ';'
  3614 | external_declaration_list external_declaration ';'
  4136 	{$$ = $1; $$->add_element($2);}
  3615 	{$$ = $1; $$->add_element($2);}
  4137 /* ERROR_CHECK_BEGIN */
  3616 /* ERROR_CHECK_BEGIN */
  4138 | error ';'
  3617 | error ';'
  4139 	{$$ = new external_declaration_list_c(locloc(@$));
  3618 	{$$ = new external_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid external variable declaration."); yyerrok;}
  4140 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid external variable declaration.");
       
  4141 	 yyerrok;
       
  4142 	}
       
  4143 | external_declaration error
  3619 | external_declaration error
  4144 	{$$ = new external_declaration_list_c(locloc(@$));
  3620 	{$$ = new external_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of external variable declaration."); yyerrok;}
  4145 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of external variable declaration.");
       
  4146 	 yyerrok;
       
  4147 	}
       
  4148 | external_declaration_list external_declaration error
  3621 | external_declaration_list external_declaration error
  4149 	{$$ = $1;
  3622 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of external variable declaration."); yyerrok;}
  4150 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of external variable declaration.");
       
  4151 	 yyerrok;
       
  4152 	}
       
  4153 | external_declaration_list error ';'
  3623 | external_declaration_list error ';'
  4154 	{$$ = $1;
  3624 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid external variable declaration."); yyerrok;}
  4155 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid external variable declaration.");
       
  4156 	 yyerrok;
       
  4157 	}
       
  4158 | external_declaration_list ';'
  3625 | external_declaration_list ';'
  4159 	{$$ = $1;
  3626 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after external variable declaration."); yynerrs++;}
  4160 	 yynerrs++;
       
  4161 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after external variable declaration.");
       
  4162 	}
       
  4163 /* ERROR_CHECK_END */
  3627 /* ERROR_CHECK_END */
  4164 ;
  3628 ;
  4165 
  3629 
  4166 
  3630 
  4167 external_declaration:
  3631 external_declaration:
  4189 	{$$ = new external_declaration_c($1, $3, locloc(@$));
  3653 	{$$ = new external_declaration_c($1, $3, locloc(@$));
  4190 	 variable_name_symtable.insert($1, prev_declared_fb_name_token);
  3654 	 variable_name_symtable.insert($1, prev_declared_fb_name_token);
  4191 	}
  3655 	}
  4192 /* ERROR_CHECK_BEGIN */
  3656 /* ERROR_CHECK_BEGIN */
  4193 | global_var_name simple_specification
  3657 | global_var_name simple_specification
  4194 	{$$ = NULL;
  3658 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and simple specification."); yynerrs++;}
  4195 	 yynerrs++;
       
  4196 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between external variable name and simple specification.");
       
  4197 	}
       
  4198 | global_var_name subrange_specification
  3659 | global_var_name subrange_specification
  4199 	{$$ = NULL;
  3660 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and subrange specification."); yynerrs++;}
  4200 	 yynerrs++;
       
  4201 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between external variable name and subrange specification.");
       
  4202 	}
       
  4203 | global_var_name enumerated_specification
  3661 | global_var_name enumerated_specification
  4204 	{$$ = NULL;
  3662 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and enumerated specification."); yynerrs++;}
  4205 	 yynerrs++;
       
  4206 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between external variable name and enumerated specification.");
       
  4207 	}
       
  4208 | global_var_name array_specification
  3663 | global_var_name array_specification
  4209 	{$$ = NULL;
  3664 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and array specification."); yynerrs++;}
  4210 	 yynerrs++;
       
  4211 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between external variable name and array specification.");
       
  4212 	}
       
  4213 | global_var_name prev_declared_structure_type_name
  3665 | global_var_name prev_declared_structure_type_name
  4214 	{$$ = NULL;
  3666 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and structured specification."); yynerrs++;}
  4215 	 yynerrs++;
       
  4216 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between external variable name and structured specification.");
       
  4217 	}
       
  4218 | global_var_name function_block_type_name
  3667 | global_var_name function_block_type_name
  4219 	{$$ = NULL;
  3668 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and function block type specification."); yynerrs++;}
  4220 	 yynerrs++;
       
  4221 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between external variable name and function block type specification.");
       
  4222 	}
       
  4223 | global_var_name ':' identifier
       
  4224 	{$$ = NULL;
       
  4225 	 yynerrs++;
       
  4226 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown type name in external variable declaration.");
       
  4227 	}
       
  4228 | global_var_name ':' error
  3669 | global_var_name ':' error
  4229 	{$$ = NULL;
  3670 	{$$ = NULL;
  4230 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in external variable declaration.");
  3671 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in external variable declaration.");}
       
  3672 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in external variable declaration."); yyclearin;}
  4231 	 yyerrok;
  3673 	 yyerrok;
  4232 	}
  3674 	}
  4233 /* ERROR_CHECK_END */
  3675 /* ERROR_CHECK_END */
  4234 ;
  3676 ;
  4235 
  3677 
  4244 	{$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  3686 	{$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  4245 | VAR_GLOBAL RETAIN global_var_decl_list END_VAR
  3687 | VAR_GLOBAL RETAIN global_var_decl_list END_VAR
  4246 	{$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3688 	{$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  4247 /* ERROR_CHECK_BEGIN */
  3689 /* ERROR_CHECK_BEGIN */
  4248 | VAR_GLOBAL END_VAR
  3690 | VAR_GLOBAL END_VAR
  4249 	{$$ = NULL;
  3691 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in global variable(s) declaration."); yynerrs++;}
  4250 	 yynerrs++;
       
  4251 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in global variable(s) declaration.");
       
  4252 	}
       
  4253 | VAR_GLOBAL CONSTANT END_VAR
  3692 | VAR_GLOBAL CONSTANT END_VAR
  4254 	{$$ = NULL;
  3693 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant global variable(s) declaration."); yynerrs++;}
  4255 	 yynerrs++;
       
  4256 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in constant global variable(s) declaration.");
       
  4257 	}
       
  4258 | VAR_GLOBAL RETAIN END_VAR
  3694 | VAR_GLOBAL RETAIN END_VAR
  4259 	{$$ = NULL;
  3695 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive global variable(s) declaration."); yynerrs++;}
  4260 	 yynerrs++;
       
  4261 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable declared in retentive global variable(s) declaration.");
       
  4262 	}
       
  4263 | VAR_GLOBAL error global_var_decl_list END_VAR
  3696 | VAR_GLOBAL error global_var_decl_list END_VAR
  4264 	{$$ = NULL;
  3697 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_GLOBAL' in global variable(s) declaration."); yyerrok;}
  4265 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_GLOBAL' in global variable(s) declaration.");
       
  4266 	 yyerrok;
       
  4267 	}
       
  4268 | VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR
  3698 | VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR
  4269 	{$$ = NULL;
  3699 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant global variable(s) declaration."); yyerrok;}
  4270 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant global variable(s) declaration.");
       
  4271 	 yyerrok;
       
  4272 	}
       
  4273 | VAR_GLOBAL RETAIN error global_var_decl_list END_VAR
  3700 | VAR_GLOBAL RETAIN error global_var_decl_list END_VAR
  4274 	{$$ = NULL;
  3701 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive global variable(s) declaration."); yyerrok;}
  4275 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive global variable(s) declaration.");
  3702 | VAR_GLOBAL global_var_decl_list error END_OF_INPUT
  4276 	 yyerrok;
  3703   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed global variable(s) declaration."); yyerrok;}
  4277 	}
  3704 | VAR_GLOBAL CONSTANT global_var_decl_list error END_OF_INPUT
       
  3705   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant global variable(s) declaration."); yyerrok;}
       
  3706 | VAR_GLOBAL RETAIN global_var_decl_list error END_OF_INPUT
       
  3707   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive global variable(s) declaration."); yyerrok;}
  4278 | VAR_GLOBAL error END_VAR
  3708 | VAR_GLOBAL error END_VAR
  4279 	{$$ = NULL;
  3709 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in global variable(s) declaration."); yyerrok;}
  4280 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in global variable(s) declaration.");
       
  4281 	 yyerrok;
       
  4282 	}
       
  4283 | VAR_GLOBAL CONSTANT error END_VAR
  3710 | VAR_GLOBAL CONSTANT error END_VAR
  4284 	{$$ = NULL;
  3711 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant global variable(s) declaration."); yyerrok;}
  4285 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in constant global variable(s) declaration.");
       
  4286 	 yyerrok;
       
  4287 	}
       
  4288 | VAR_GLOBAL RETAIN error END_VAR
  3712 | VAR_GLOBAL RETAIN error END_VAR
  4289 	{$$ = NULL;
  3713 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant global variable(s) declaration."); yyerrok;}
  4290 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown error in constant global variable(s) declaration.");
       
  4291 	 yyerrok;
       
  4292 	}
       
  4293 /* ERROR_CHECK_END */
  3714 /* ERROR_CHECK_END */
  4294 ;
  3715 ;
  4295 
  3716 
  4296 
  3717 
  4297 /* helper symbol for global_var_declarations */
  3718 /* helper symbol for global_var_declarations */
  4300 	{$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);}
  3721 	{$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);}
  4301 | global_var_decl_list global_var_decl ';'
  3722 | global_var_decl_list global_var_decl ';'
  4302 	{$$ = $1; $$->add_element($2);}
  3723 	{$$ = $1; $$->add_element($2);}
  4303 /* ERROR_CHECK_BEGIN */
  3724 /* ERROR_CHECK_BEGIN */
  4304 | error ';'
  3725 | error ';'
  4305 	{$$ = new global_var_decl_list_c(locloc(@$));
  3726 	{$$ = new global_var_decl_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid global variable(s) declaration."); yyerrok;}
  4306 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid global variable(s) declaration.");
       
  4307 	 yyerrok;
       
  4308 	}
       
  4309 | global_var_decl error
  3727 | global_var_decl error
  4310 	{$$ = new global_var_decl_list_c(locloc(@$));
  3728 	{$$ = new global_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of global variable(s) declaration."); yyerrok;}
  4311 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of global variable(s) declaration.");
       
  4312 	 yyerrok;
       
  4313 	}
       
  4314 | global_var_decl_list global_var_decl error
  3729 | global_var_decl_list global_var_decl error
  4315 	{$$ = $1;
  3730 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "';' missing at end of global variable(s) declaration."); yyerrok;}
  4316 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of global variable(s) declaration.");
       
  4317 	 yyerrok;
       
  4318 	}
       
  4319 | global_var_decl_list error ';'
  3731 | global_var_decl_list error ';'
  4320 	{$$ = $1;
  3732 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid global variable(s) declaration."); yyerrok;}
  4321 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid global variable(s) declaration.");
       
  4322 	 yyerrok;
       
  4323 	}
       
  4324 | global_var_decl_list ';'
  3733 | global_var_decl_list ';'
  4325 	{$$ = $1;
  3734 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after global variable(s) declaration."); yynerrs++;}
  4326 	 yynerrs++;
       
  4327 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after global variable(s) declaration.");
       
  4328 	}
       
  4329 /* ERROR_CHECK_END */
  3735 /* ERROR_CHECK_END */
  4330 ;
  3736 ;
  4331 
  3737 
  4332 
  3738 
  4333 global_var_decl:
  3739 global_var_decl:
  4339 	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
  3745 	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
  4340 | global_var_spec ':' function_block_type_name
  3746 | global_var_spec ':' function_block_type_name
  4341 	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
  3747 	{$$ = new global_var_decl_c($1, $3, locloc(@$));}
  4342 /* ERROR_CHECK_BEGIN */
  3748 /* ERROR_CHECK_BEGIN */
  4343 | global_var_list located_var_spec_init
  3749 | global_var_list located_var_spec_init
  4344 	{$$ = NULL;
  3750 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable list and type specification."); yynerrs++;}
  4345 	 yynerrs++;
       
  4346 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between global variable list and type specification.");
       
  4347 	}
       
  4348 | global_var_name location located_var_spec_init
  3751 | global_var_name location located_var_spec_init
  4349 	{$$ = NULL;
  3752 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable specification and type specification."); yynerrs++;}
  4350 	 yynerrs++;
       
  4351 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between global variable specification and type specification.");
       
  4352 	}
       
  4353 | global_var_spec function_block_type_name
  3753 | global_var_spec function_block_type_name
  4354 	{$$ = NULL;
  3754 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable specification and function block type specification."); yynerrs++;}
  4355 	 yynerrs++;
       
  4356 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between global variable specification and function block type specification.");
       
  4357 	}
       
  4358 | global_var_spec ':' identifier
       
  4359 	{$$ = NULL;
       
  4360 	 yynerrs++;
       
  4361 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown variable type defined in global variable declaration.");
       
  4362 	}
       
  4363 | global_var_spec ':' error
  3755 | global_var_spec ':' error
  4364 	{$$ = NULL;
  3756 	{$$ = NULL;
  4365 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in global variable declaration.");
  3757 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in global variable declaration.");}
       
  3758 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in global variable declaration."); yyclearin;}
  4366 	 yyerrok;
  3759 	 yyerrok;
  4367 	}
  3760 	}
  4368 /* ERROR_CHECK_END */
  3761 /* ERROR_CHECK_END */
  4369 ;
  3762 ;
  4370 
  3763 
  4395   AT direct_variable
  3788   AT direct_variable
  4396 	{$$ = new location_c($2, locloc(@$));}
  3789 	{$$ = new location_c($2, locloc(@$));}
  4397 /* ERROR_CHECK_BEGIN */
  3790 /* ERROR_CHECK_BEGIN */
  4398 | AT error
  3791 | AT error
  4399 	{$$ = NULL;
  3792 	{$$ = NULL;
  4400 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid location in location declaration.");
  3793 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no location defined in location declaration.");}
       
  3794 	 else {print_err_msg(locf(@2), locl(@2), "invalid location in global location declaration."); yyclearin;}
  4401 	 yyerrok;
  3795 	 yyerrok;
  4402 	}
  3796 	}
  4403 /* ERROR_CHECK_END */
  3797 /* ERROR_CHECK_END */
  4404 ;
  3798 ;
  4405 
  3799 
  4414 	{$$ = $1; $$->add_element($3);
  3808 	{$$ = $1; $$->add_element($3);
  4415 	 variable_name_symtable.insert($3, prev_declared_global_var_name_token);
  3809 	 variable_name_symtable.insert($3, prev_declared_global_var_name_token);
  4416 	}
  3810 	}
  4417 /* ERROR_CHECK_BEGIN */
  3811 /* ERROR_CHECK_BEGIN */
  4418 | global_var_list global_var_name
  3812 | global_var_list global_var_name
  4419 	{$$ = new global_var_list_c(locloc(@$));
  3813 	{$$ = new global_var_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing in global variable list."); yynerrs++;}
  4420 	 yynerrs++;
       
  4421 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in global variable list.");
       
  4422 	}
       
  4423 | global_var_list ',' error
  3814 | global_var_list ',' error
  4424 	{$$ = $1;
  3815 	{$$ = $1;
  4425 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ',' in global variable declaration.");
  3816 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable name defined in global variable declaration.");}
       
  3817 	 else {print_err_msg(locf(@3), locl(@3), "invalid variable name in global variable declaration."); yyclearin;}
  4426 	 yyerrok;
  3818 	 yyerrok;
  4427 	}
  3819 	}
  4428 /* ERROR_CHECK_END */
  3820 /* ERROR_CHECK_END */
  4429 ;
  3821 ;
  4430 
  3822 
  4438 single_byte_string_var_declaration:
  3830 single_byte_string_var_declaration:
  4439   var1_list ':' single_byte_string_spec
  3831   var1_list ':' single_byte_string_spec
  4440 	{$$ = new single_byte_string_var_declaration_c($1, $3, locloc(@$));}
  3832 	{$$ = new single_byte_string_var_declaration_c($1, $3, locloc(@$));}
  4441 /* ERROR_CHECK_BEGIN */
  3833 /* ERROR_CHECK_BEGIN */
  4442 | var1_list single_byte_string_spec
  3834 | var1_list single_byte_string_spec
  4443 	{$$ = NULL;
  3835 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and string type specification."); yynerrs++;}
  4444 	 yynerrs++;
       
  4445 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and string type specification.");
       
  4446 	}
       
  4447 /* ERROR_CHECK_END */
  3836 /* ERROR_CHECK_END */
  4448 ;
  3837 ;
  4449 
  3838 
  4450 /* NOTE: The constructs
  3839 /* NOTE: The constructs
  4451  *
  3840  *
  4491 */
  3880 */
  4492 | STRING '[' integer ']' ASSIGN single_byte_character_string
  3881 | STRING '[' integer ']' ASSIGN single_byte_character_string
  4493 	{$$ = new single_byte_string_spec_c($3, $6, locloc(@$));}
  3882 	{$$ = new single_byte_string_spec_c($3, $6, locloc(@$));}
  4494 /* ERROR_CHECK_BEGIN */
  3883 /* ERROR_CHECK_BEGIN */
  4495 | STRING '[' error ']'
  3884 | STRING '[' error ']'
  4496 	{$$ = NULL;
  3885 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited string type specification."); yyerrok;}
  4497 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid length value for limited string type specification.");
       
  4498 	 yyerrok;
       
  4499 	}
       
  4500 | STRING '[' error ']' ASSIGN single_byte_character_string
  3886 | STRING '[' error ']' ASSIGN single_byte_character_string
  4501 	{$$ = NULL;
  3887 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited string type specification."); yyerrok;}
  4502 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid length value for limited string type specification.");
       
  4503 	 yyerrok;
       
  4504 	}
       
  4505 | STRING '[' ']'
  3888 | STRING '[' ']'
  4506 	{$$ = NULL;
  3889 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited string type specification."); yynerrs++;}
  4507 	 yynerrs++;
       
  4508 	 print_err_msg(current_filename, locl(@2), locf(@3), "missing length value for limited string type specification.");
       
  4509 	}
       
  4510 | STRING '[' ']' ASSIGN single_byte_character_string
  3890 | STRING '[' ']' ASSIGN single_byte_character_string
  4511 	{$$ = NULL;
  3891 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited string type specification."); yynerrs++;}
  4512 	 yynerrs++;
       
  4513 	 print_err_msg(current_filename, locl(@2), locf(@3), "missing length value for limited string type specification.");
       
  4514 	}
       
  4515 | STRING '[' integer error
  3892 | STRING '[' integer error
  4516 	{$$ = NULL;
  3893 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "expecting ']' after length definition for limited string type specification."); yyerrok;}
  4517 	 print_err_msg(current_filename, locl(@3), locf(@4), "expecting ']' after length definition for limited string type specification.");
       
  4518 	 yyerrok;
       
  4519 	}
       
  4520 | STRING '[' integer error ASSIGN single_byte_character_string
       
  4521 	{$$ = NULL;
       
  4522 	 print_err_msg(current_filename, locf(@4), locl(@4), "expecting ']' after length definition for limited string type specification.");
       
  4523 	 yyerrok;
       
  4524 	}
       
  4525 | STRING '[' integer ']' single_byte_character_string
  3894 | STRING '[' integer ']' single_byte_character_string
  4526 	{$$ = NULL;
  3895 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "':=' missing before limited string type initialization."); yynerrs++;}
  4527 	 yynerrs++;
       
  4528 	 print_err_msg(current_filename, locl(@4), locf(@5), "':=' missing before limited string type initialization.");
       
  4529 	}
       
  4530 | STRING '[' integer ']' ASSIGN error
  3896 | STRING '[' integer ']' ASSIGN error
  4531 	{$$ = NULL;
  3897 	{$$ = NULL;
  4532 	 print_err_msg(current_filename, locf(@6), locl(@6), "invalid value for limited string type initialization.");
  3898 	 if (is_current_syntax_token()) {print_err_msg(locl(@5), locf(@6), "no initial value defined in limited string type initialization.");}
       
  3899 	 else {print_err_msg(locf(@6), locl(@6), "invalid initial value in limited string type initialization."); yyclearin;}
  4533 	 yyerrok;
  3900 	 yyerrok;
  4534 	}
  3901 	}
  4535 /* ERROR_CHECK_END */
  3902 /* ERROR_CHECK_END */
  4536 ;
  3903 ;
  4537 
  3904 
  4539 double_byte_string_var_declaration:
  3906 double_byte_string_var_declaration:
  4540   var1_list ':' double_byte_string_spec
  3907   var1_list ':' double_byte_string_spec
  4541 	{$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));}
  3908 	{$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));}
  4542 /* ERROR_CHECK_BEGIN */
  3909 /* ERROR_CHECK_BEGIN */
  4543 | var1_list double_byte_string_spec
  3910 | var1_list double_byte_string_spec
  4544 	{$$ = NULL;
  3911 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and double byte string type specification."); yynerrs++;}
  4545 	 yynerrs++;
       
  4546 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between variable list and double byte string type specification.");
       
  4547 	}
       
  4548 /* ERROR_CHECK_END */
  3912 /* ERROR_CHECK_END */
  4549 ;
  3913 ;
  4550 
  3914 
  4551 double_byte_string_spec:
  3915 double_byte_string_spec:
  4552 /*  WSTRING
  3916 /*  WSTRING
  4560 */
  3924 */
  4561 | WSTRING '[' integer ']' ASSIGN double_byte_character_string
  3925 | WSTRING '[' integer ']' ASSIGN double_byte_character_string
  4562 	{$$ = new double_byte_string_spec_c($3, $6, locloc(@$));}
  3926 	{$$ = new double_byte_string_spec_c($3, $6, locloc(@$));}
  4563 /* ERROR_CHECK_BEGIN */
  3927 /* ERROR_CHECK_BEGIN */
  4564 | WSTRING '[' error ']'
  3928 | WSTRING '[' error ']'
  4565 	{$$ = NULL;
  3929 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited double byte string type specification."); yyerrok;}
  4566 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid length value for limited double byte string type specification.");
       
  4567 	 yyerrok;
       
  4568 	}
       
  4569 | WSTRING '[' error ']' ASSIGN single_byte_character_string
  3930 | WSTRING '[' error ']' ASSIGN single_byte_character_string
  4570 	{$$ = NULL;
  3931 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited double byte string type specification."); yyerrok;}
  4571 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid length value for limited double byte string type specification.");
       
  4572 	 yyerrok;
       
  4573 	}
       
  4574 | WSTRING '[' ']'
  3932 | WSTRING '[' ']'
  4575 	{$$ = NULL;
  3933 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited double byte string type specification."); yynerrs++;}
  4576 	 yynerrs++;
       
  4577 	 print_err_msg(current_filename, locl(@2), locf(@3), "missing length value for limited double byte string type specification.");
       
  4578 	}
       
  4579 | WSTRING '[' ']' ASSIGN single_byte_character_string
  3934 | WSTRING '[' ']' ASSIGN single_byte_character_string
  4580 	{$$ = NULL;
  3935 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited double byte string type specification."); yynerrs++;}
  4581 	 yynerrs++;
       
  4582 	 print_err_msg(current_filename, locl(@2), locf(@3), "missing length value for limited double byte string type specification.");
       
  4583 	}
       
  4584 | WSTRING '[' integer error
  3936 | WSTRING '[' integer error
  4585 	{$$ = NULL;
  3937 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "expecting ']' after length definition for limited double byte string type specification."); yyerrok;}
  4586 	 print_err_msg(current_filename, locl(@3), locf(@4), "expecting ']' after length definition for limited double byte string type specification.");
       
  4587 	 yyerrok;
       
  4588 	}
       
  4589 | WSTRING '[' integer error ASSIGN single_byte_character_string
       
  4590 	{$$ = NULL;
       
  4591 	 print_err_msg(current_filename, locf(@4), locl(@4), "expecting ']' after length definition for limited double byte string type specification.");
       
  4592 	 yyerrok;
       
  4593 	}
       
  4594 | WSTRING '[' integer ']' single_byte_character_string
  3938 | WSTRING '[' integer ']' single_byte_character_string
  4595 	{$$ = NULL;
  3939 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "':=' missing before limited double byte string type initialization."); yynerrs++;}
  4596 	 yynerrs++;
       
  4597 	 print_err_msg(current_filename, locl(@4), locf(@5), "':=' missing before limited double byte string type initialization.");
       
  4598 	}
       
  4599 | WSTRING '[' integer ']' ASSIGN error
  3940 | WSTRING '[' integer ']' ASSIGN error
  4600 	{$$ = NULL;
  3941 	{$$ = NULL;
  4601 	 print_err_msg(current_filename, locf(@6), locl(@6), "invalid value for limited double byte string type initialization.");
  3942 	 if (is_current_syntax_token()) {print_err_msg(locl(@5), locf(@6), "no initial value defined double byte in limited string type initialization.");}
       
  3943 	 else {print_err_msg(locf(@6), locl(@6), "invalid initial value in limited double byte string type initialization."); yyclearin;}
  4602 	 yyerrok;
  3944 	 yyerrok;
  4603 	}
  3945 	}
  4604 /* ERROR_CHECK_END */
  3946 /* ERROR_CHECK_END */
  4605 ;
  3947 ;
  4606 
  3948 
  4612 | VAR     RETAIN incompl_located_var_decl_list END_VAR
  3954 | VAR     RETAIN incompl_located_var_decl_list END_VAR
  4613 	{$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  3955 	{$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));}
  4614 | VAR NON_RETAIN incompl_located_var_decl_list END_VAR
  3956 | VAR NON_RETAIN incompl_located_var_decl_list END_VAR
  4615 	{$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  3957 	{$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));}
  4616 /* ERROR_CHECK_BEGIN */
  3958 /* ERROR_CHECK_BEGIN */
       
  3959 | VAR incompl_located_var_decl_list error END_OF_INPUT
       
  3960   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed incomplete located variable(s) declaration."); yyerrok;}
       
  3961 | VAR RETAIN incompl_located_var_decl_list error END_OF_INPUT
       
  3962   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed incomplete retentive located variable(s) declaration."); yyerrok;}
       
  3963 | VAR NON_RETAIN incompl_located_var_decl_list error END_OF_INPUT
       
  3964   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed incomplete non-retentive located variable(s) declaration."); yyerrok;}
  4617 | VAR error incompl_located_var_decl_list END_VAR
  3965 | VAR error incompl_located_var_decl_list END_VAR
  4618 	{$$ = NULL;
  3966 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in incomplete located variable(s) declaration."); yyerrok;}
  4619 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR' in incomplete located variable(s) declaration.");
       
  4620 	 yyerrok;
       
  4621 	}
       
  4622 | VAR RETAIN error incompl_located_var_decl_list END_VAR
  3967 | VAR RETAIN error incompl_located_var_decl_list END_VAR
  4623 	{$$ = NULL;
  3968 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); yyerrok;}
  4624 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration.");
       
  4625 	 yyerrok;
       
  4626 	}
       
  4627 | VAR NON_RETAIN error incompl_located_var_decl_list END_VAR
  3969 | VAR NON_RETAIN error incompl_located_var_decl_list END_VAR
  4628 	{$$ = NULL;
  3970 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); yyerrok;}
  4629 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration.");
       
  4630 	 yyerrok;
       
  4631 	}
       
  4632 /* ERROR_CHECK_END */
  3971 /* ERROR_CHECK_END */
  4633 ;
  3972 ;
  4634 
  3973 
  4635 /* helper symbol for incompl_located_var_declarations */
  3974 /* helper symbol for incompl_located_var_declarations */
  4636 incompl_located_var_decl_list:
  3975 incompl_located_var_decl_list:
  4638 	{$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);}
  3977 	{$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);}
  4639 | incompl_located_var_decl_list incompl_located_var_decl ';'
  3978 | incompl_located_var_decl_list incompl_located_var_decl ';'
  4640 	{$$ = $1; $$->add_element($2);}
  3979 	{$$ = $1; $$->add_element($2);}
  4641 /* ERROR_CHECK_BEGIN */
  3980 /* ERROR_CHECK_BEGIN */
  4642 | incompl_located_var_decl error
  3981 | incompl_located_var_decl error
  4643 	{$$ = new incompl_located_var_decl_list_c(locloc(@$));
  3982 	{$$ = new incompl_located_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of incomplete located variable declaration."); yyerrok;}
  4644 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of incomplete located variable declaration.");
       
  4645 	 yyerrok;
       
  4646 	}
       
  4647 | incompl_located_var_decl_list incompl_located_var_decl error
  3983 | incompl_located_var_decl_list incompl_located_var_decl error
  4648 	{$$ = $1;
  3984 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of incomplete located variable declaration."); yyerrok;}
  4649 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of incomplete located variable declaration.");
       
  4650 	 yyerrok;
       
  4651 	}
       
  4652 | incompl_located_var_decl_list error ';'
  3985 | incompl_located_var_decl_list error ';'
  4653 	{$$ = $1;
  3986 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid incomplete located variable declaration."); yyerrok;}
  4654 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid incomplete located variable declaration.");
       
  4655 	 yyerrok;
       
  4656 	}
       
  4657 | incompl_located_var_decl_list ';'
  3987 | incompl_located_var_decl_list ';'
  4658 	{$$ = $1;
  3988 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after incomplete located variable declaration."); yynerrs++;}
  4659 	 yynerrs++;
       
  4660 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after incomplete located variable declaration.");
       
  4661 	}
       
  4662 /* ERROR_CHECK_END */
  3989 /* ERROR_CHECK_END */
  4663 ;
  3990 ;
  4664 
  3991 
  4665 
  3992 
  4666 incompl_located_var_decl:
  3993 incompl_located_var_decl:
  4667   variable_name incompl_location ':' var_spec
  3994   variable_name incompl_location ':' var_spec
  4668 	{$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));}
  3995 	{$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));}
  4669 /* ERROR_CHECK_BEGIN */
  3996 /* ERROR_CHECK_BEGIN */
  4670 | variable_name incompl_location var_spec
  3997 | variable_name incompl_location var_spec
  4671 	{$$ = NULL;
  3998 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between incomplete located variable and type specification."); yynerrs++;
  4672 	 yynerrs++;
       
  4673 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing between incomplete located variable and type specification.");
       
  4674 	}
  3999 	}
  4675 | variable_name incompl_location ':' error
  4000 | variable_name incompl_location ':' error
  4676 	{$$ = NULL;
  4001 	{$$ = NULL;
  4677 	 print_err_msg(current_filename, locl(@2), locf(@3), "no specification defined in incomplete located variable declaration.");
  4002 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in incomplete located variable declaration.");}
       
  4003 	 else {print_err_msg(locf(@3), locl(@3), "invalid specification in incomplete located variable declaration."); yyclearin;}
  4678 	 yyerrok;
  4004 	 yyerrok;
  4679 	}
  4005 	}
  4680 /* ERROR_CHECK_END */
  4006 /* ERROR_CHECK_END */
  4681 ;
  4007 ;
  4682 
  4008 
  4734 	{$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);}
  4060 	{$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);}
  4735 | var_init_decl_list var_init_decl ';'
  4061 | var_init_decl_list var_init_decl ';'
  4736 	{$$ = $1; $$->add_element($2);}
  4062 	{$$ = $1; $$->add_element($2);}
  4737 /* ERROR_CHECK_BEGIN */
  4063 /* ERROR_CHECK_BEGIN */
  4738 | var_init_decl_list var_init_decl error
  4064 | var_init_decl_list var_init_decl error
  4739 	{$$ = $1;
  4065 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;}
  4740 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of variable(s) declaration.");
       
  4741 	 yyerrok;
       
  4742 	}
       
  4743 | var_init_decl_list error ';'
  4066 | var_init_decl_list error ';'
  4744 	{$$ = $1;
  4067 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;}
  4745 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid variable(s) declaration.");
       
  4746 	 yyerrok;
       
  4747 	}
       
  4748 /* ERROR_CHECK_END */
  4068 /* ERROR_CHECK_END */
  4749 ;
  4069 ;
  4750 
  4070 
  4751 
  4071 
  4752 
  4072 
  4956 	   library_element_symtable.insert($1, prev_declared_derived_function_name_token);
  4276 	   library_element_symtable.insert($1, prev_declared_derived_function_name_token);
  4957 	 }
  4277 	 }
  4958 	}
  4278 	}
  4959 /* ERROR_CHECK_BEGIN */
  4279 /* ERROR_CHECK_BEGIN */
  4960 | function_name_declaration elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
  4280 | function_name_declaration elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
  4961 	{$$ = NULL;
  4281 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after function name in function declaration."); yynerrs++;}
  4962 	 yynerrs++;
       
  4963 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing after function name in function declaration.");
       
  4964 	}
       
  4965 | function_name_declaration derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
  4282 | function_name_declaration derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
  4966 	{$$ = NULL;
  4283 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after function name in function declaration."); yynerrs++;}
  4967 	 yynerrs++;
       
  4968 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing after function name in function declaration.");
       
  4969 	}
       
  4970 | function_name_declaration error derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION
       
  4971 	{$$ = NULL;
       
  4972 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':' after function name in function declaration.");
       
  4973 	 yyerrok;
       
  4974 	}
       
  4975 | function_name_declaration ':' io_OR_function_var_declarations_list function_body END_FUNCTION
  4284 | function_name_declaration ':' io_OR_function_var_declarations_list function_body END_FUNCTION
  4976 	{$$ = NULL;
  4285 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no return type defined in function declaration."); yynerrs++;}
  4977 	 yynerrs++;
       
  4978 	 print_err_msg(current_filename, locl(@2), locf(@3), "no return type defined in function declaration.");
       
  4979 	}
       
  4980 | function_name_declaration ':' error io_OR_function_var_declarations_list function_body END_FUNCTION
  4286 | function_name_declaration ':' error io_OR_function_var_declarations_list function_body END_FUNCTION
  4981 	{$$ = NULL;
  4287 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid return type defined in function declaration."); yyerrok;}
  4982 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid return type defined in function declaration.");
       
  4983 	 yyerrok;
       
  4984 	}
       
  4985 | function_name_declaration ':' identifier io_OR_function_var_declarations_list function_body END_FUNCTION
       
  4986 	{$$ = NULL;
       
  4987 	 yynerrs++;
       
  4988 	 print_err_msg(current_filename, locf(@3), locl(@3), "unknown return type defined in function declaration.");
       
  4989 	}
       
  4990 | function_name_declaration ':' elementary_type_name function_body END_FUNCTION
  4288 | function_name_declaration ':' elementary_type_name function_body END_FUNCTION
  4991 	{$$ = NULL;
  4289 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared in function declaration."); yynerrs++;}
  4992 	 yynerrs++;
       
  4993 	 print_err_msg(current_filename, locl(@3), locf(@4), "no variable(s) declared in function declaration.");
       
  4994 	}
       
  4995 | function_name_declaration ':' derived_type_name function_body END_FUNCTION
  4290 | function_name_declaration ':' derived_type_name function_body END_FUNCTION
  4996 	{$$ = NULL;
  4291 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared in function declaration."); yynerrs++;}
  4997 	 yynerrs++;
       
  4998 	 print_err_msg(current_filename, locl(@3), locf(@4), "no variable(s) declared in function declaration.");
       
  4999 	}
       
  5000 | function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list END_FUNCTION
  4292 | function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list END_FUNCTION
  5001 	{$$ = NULL;
  4293 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "no body defined in function declaration."); yynerrs++;}
  5002 	 yynerrs++;
       
  5003 	 print_err_msg(current_filename, locl(@4), locf(@5), "no body defined in function declaration.");
       
  5004 	}
       
  5005 | function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list END_FUNCTION
  4294 | function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list END_FUNCTION
  5006 	{$$ = NULL;
  4295 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "no body defined in function declaration."); yynerrs++;}
  5007 	 yynerrs++;
       
  5008 	 print_err_msg(current_filename, locl(@4), locf(@5), "no body defined in function declaration.");
       
  5009 	}
       
  5010 | function_name_declaration ':' elementary_type_name END_FUNCTION
  4296 | function_name_declaration ':' elementary_type_name END_FUNCTION
  5011 	{$$ = NULL;
  4297 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration."); yynerrs++;}
  5012 	 yynerrs++;
       
  5013 	 print_err_msg(current_filename, locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration.");
       
  5014 	}
       
  5015 | function_name_declaration ':' derived_type_name END_FUNCTION
  4298 | function_name_declaration ':' derived_type_name END_FUNCTION
  5016 	{$$ = NULL;
  4299 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration."); yynerrs++;}
  5017 	 yynerrs++;
  4300 | function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list function_body END_OF_INPUT
  5018 	 print_err_msg(current_filename, locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration.");
  4301 	{$$ = NULL; print_err_msg(locf(@1), locf(@3), "unclosed function declaration."); yynerrs++;}
  5019 	}
  4302 | function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list function_body END_OF_INPUT
       
  4303 	{$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed function declaration."); yynerrs++;}
  5020 | function_name_declaration error END_FUNCTION
  4304 | function_name_declaration error END_FUNCTION
  5021 	{$$ = NULL;
  4305 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in function declaration."); yyerrok;}
  5022 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in function declaration.");
       
  5023 	 yyerrok;
       
  5024 	}
       
  5025 /* ERROR_CHECK_END */
  4306 /* ERROR_CHECK_END */
  5026 ;
  4307 ;
  5027 
  4308 
  5028 
  4309 
  5029 
  4310 
  5070 	 variable_name_symtable.insert($2, prev_declared_variable_name_token);
  4351 	 variable_name_symtable.insert($2, prev_declared_variable_name_token);
  5071 	}
  4352 	}
  5072 /* ERROR_CHECK_BEGIN */
  4353 /* ERROR_CHECK_BEGIN */
  5073 | FUNCTION error 
  4354 | FUNCTION error 
  5074 	{$$ = NULL;
  4355 	{$$ = NULL;
  5075 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function name defined in function declaration.");
  4356 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no function name defined in function declaration.");}
       
  4357 	 else {print_err_msg(locf(@2), locl(@2), "invalid function name in function declaration."); yyclearin;}
  5076 	 yyerrok;
  4358 	 yyerrok;
  5077 	}
  4359 	}
  5078 /* ERROR_CHECK_END */
  4360 /* ERROR_CHECK_END */
  5079 ;
  4361 ;
  5080 
  4362 
  5090 	{$$ = $1; $$->add_element($2);}
  4372 	{$$ = $1; $$->add_element($2);}
  5091 | io_OR_function_var_declarations_list function_var_decls
  4373 | io_OR_function_var_declarations_list function_var_decls
  5092 	{$$ = $1; $$->add_element($2);}
  4374 	{$$ = $1; $$->add_element($2);}
  5093 /* ERROR_CHECK_BEGIN */
  4375 /* ERROR_CHECK_BEGIN */
  5094 | io_OR_function_var_declarations_list retentive_var_declarations
  4376 | io_OR_function_var_declarations_list retentive_var_declarations
  5095 	{$$ = $1;
  4377 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected retentive variable(s) declaration in function declaration."); yynerrs++;}
  5096 	 yynerrs++;
       
  5097 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected retentive variable(s) declaration in function declaration.");
       
  5098 	}
       
  5099 | io_OR_function_var_declarations_list located_var_declarations
  4378 | io_OR_function_var_declarations_list located_var_declarations
  5100 	{$$ = $1;
  4379 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected located variable(s) declaration in function declaration."); yynerrs++;}
  5101 	 yynerrs++;
       
  5102 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected located variable(s) declaration in function declaration.");
       
  5103 	}
       
  5104 | io_OR_function_var_declarations_list external_var_declarations
  4380 | io_OR_function_var_declarations_list external_var_declarations
  5105 	{$$ = $1;
  4381 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected external variable(s) declaration in function declaration."); yynerrs++;}
  5106 	 yynerrs++;
       
  5107 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected external variable(s) declaration in function declaration.");
       
  5108 	}
       
  5109 | io_OR_function_var_declarations_list global_var_declarations
  4382 | io_OR_function_var_declarations_list global_var_declarations
  5110 	{$$ = $1;
  4383 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function declaration."); yynerrs++;}
  5111 	 yynerrs++;
       
  5112 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected global variable(s) declaration in function declaration.");
       
  5113 	}
       
  5114 | io_OR_function_var_declarations_list incompl_located_var_declarations
  4384 | io_OR_function_var_declarations_list incompl_located_var_declarations
  5115 	{$$ = $1;
  4385 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected incomplete located variable(s) declaration in function declaration."); yynerrs++;}
  5116 	 yynerrs++;
       
  5117 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected incomplete located variable(s) declaration in function declaration.");
       
  5118 	}
       
  5119 | io_OR_function_var_declarations_list temp_var_decls
  4386 | io_OR_function_var_declarations_list temp_var_decls
  5120 	{$$ = $1;
  4387 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected temporary located variable(s) declaration in function declaration."); yynerrs++;}
  5121 	 yynerrs++;
       
  5122 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected temporary located variable(s) declaration in function declaration.");
       
  5123 	}
       
  5124 | io_OR_function_var_declarations_list non_retentive_var_decls
  4388 | io_OR_function_var_declarations_list non_retentive_var_decls
  5125 	{$$ = $1;
  4389 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected non-retentive variable(s) declaration in function declaration."); yynerrs++;}
  5126 	 yynerrs++;
       
  5127 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected non-retentive variable(s) declaration in function declaration.");
       
  5128 	}
       
  5129 /*| io_OR_function_var_declarations_list access_declarations
  4390 /*| io_OR_function_var_declarations_list access_declarations
  5130 	{$$ = $1;
  4391 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function declaration."); yynerrs++;}*/
  5131 	 yynerrs++;
       
  5132 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected access variable(s) declaration in function declaration.");
       
  5133 	}*/
       
  5134 | io_OR_function_var_declarations_list instance_specific_initializations
  4392 | io_OR_function_var_declarations_list instance_specific_initializations
  5135 	{$$ = $1;
  4393 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function declaration."); yynerrs++;}
  5136 	 yynerrs++;
       
  5137 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected instance specific initialization(s) in function declaration.");
       
  5138 	}
       
  5139 /* ERROR_CHECK_END */
  4394 /* ERROR_CHECK_END */
  5140 ;
  4395 ;
  5141 
  4396 
  5142 
  4397 
  5143 io_var_declarations:
  4398 io_var_declarations:
  5151   VAR CONSTANT var2_init_decl_list END_VAR
  4406   VAR CONSTANT var2_init_decl_list END_VAR
  5152 	{$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  4407 	{$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));}
  5153 | VAR var2_init_decl_list END_VAR
  4408 | VAR var2_init_decl_list END_VAR
  5154 	{$$ = new function_var_decls_c(NULL, $2, locloc(@$));}
  4409 	{$$ = new function_var_decls_c(NULL, $2, locloc(@$));}
  5155 /* ERROR_CHECK_BEGIN */
  4410 /* ERROR_CHECK_BEGIN */
  5156 | VAR error var_init_decl_list END_VAR
  4411 | VAR error var2_init_decl_list END_VAR
  5157 	{$$ = NULL;
  4412 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in function variable(s) declaration."); yyerrok;}
  5158 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR' in function variable(s) declaration.");
  4413 | VAR CONSTANT error var2_init_decl_list END_VAR
  5159 	 yyerrok;
  4414 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant function variable(s) declaration."); yyerrok;}
  5160 	}
  4415 | VAR var2_init_decl_list error END_OF_INPUT
  5161 | VAR CONSTANT error var_init_decl_list END_VAR
  4416 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed function variable(s) declaration."); yyerrok;}
  5162 	{$$ = NULL;
  4417 | VAR CONSTANT var2_init_decl_list error END_OF_INPUT
  5163 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant function variable(s) declaration.");
  4418 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant function variable(s) declaration."); yyerrok;}
  5164 	 yyerrok;
       
  5165 	}
       
  5166 /* ERROR_CHECK_END */
  4419 /* ERROR_CHECK_END */
  5167 ;
  4420 ;
  5168 
  4421 
  5169 /* intermediate helper symbol for function_var_decls */
  4422 /* intermediate helper symbol for function_var_decls */
  5170 var2_init_decl_list:
  4423 var2_init_decl_list:
  5172 	{$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);}
  4425 	{$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);}
  5173 | var2_init_decl_list var2_init_decl ';'
  4426 | var2_init_decl_list var2_init_decl ';'
  5174 	{$$ = $1; $$->add_element($2);}
  4427 	{$$ = $1; $$->add_element($2);}
  5175 /* ERROR_CHECK_BEGIN */
  4428 /* ERROR_CHECK_BEGIN */
  5176 | var2_init_decl error
  4429 | var2_init_decl error
  5177 	{$$ = new var2_init_decl_list_c(locloc(@$));
  4430 	{$$ = new var2_init_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of function variable(s) declaration."); yyerrok;}
  5178 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of function variable(s) declaration.");
       
  5179 	 yyerrok;
       
  5180 	}
       
  5181 | var2_init_decl_list var2_init_decl error
  4431 | var2_init_decl_list var2_init_decl error
  5182 	{$$ = $1;
  4432 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of function variable(s) declaration."); yyerrok;}
  5183 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of function variable(s) declaration.");
       
  5184 	 yyerrok;
       
  5185 	}
       
  5186 | var2_init_decl_list error ';'
  4433 | var2_init_decl_list error ';'
  5187 	{$$ = $1;
  4434 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid function variable(s) declaration."); yyerrok;}
  5188 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function variable(s) declaration.");
       
  5189 	 yyerrok;
       
  5190 	}
       
  5191 | var2_init_decl_list ';'
  4435 | var2_init_decl_list ';'
  5192 	{$$ = $1;
  4436 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after function variable(s) declaration."); yynerrs++;}
  5193 	 yynerrs++;
       
  5194 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after function variable(s) declaration.");
       
  5195 	}
       
  5196 /* ERROR_CHECK_END */
  4437 /* ERROR_CHECK_END */
  5197 ;
  4438 ;
  5198 
  4439 
  5199 
  4440 
  5200 function_body:
  4441 function_body:
  5241 	  */
  4482 	  */
  5242 	 variable_name_symtable.pop();
  4483 	 variable_name_symtable.pop();
  5243 	}
  4484 	}
  5244 /* ERROR_CHECK_BEGIN */
  4485 /* ERROR_CHECK_BEGIN */
  5245 | FUNCTION_BLOCK io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
  4486 | FUNCTION_BLOCK io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
  5246   {$$ = NULL;
  4487   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in function block declaration."); yynerrs++;}
  5247 	 yynerrs++;
       
  5248 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function block name defined in function block declaration.");
       
  5249 	}
       
  5250 | FUNCTION_BLOCK error io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
  4488 | FUNCTION_BLOCK error io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK
  5251 	{$$ = NULL;
  4489 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name in function block declaration."); yyerrok;}
  5252 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function block name in function block declaration.");
       
  5253 	 yyerrok;
       
  5254 	}
       
  5255 | FUNCTION_BLOCK derived_function_block_name function_block_body END_FUNCTION_BLOCK
  4490 | FUNCTION_BLOCK derived_function_block_name function_block_body END_FUNCTION_BLOCK
  5256 	{$$ = NULL;
  4491 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared in function declaration."); yynerrs++;}
  5257 	 yynerrs++;
       
  5258 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable(s) declared in function declaration.");
       
  5259 	}
       
  5260 | FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list END_FUNCTION_BLOCK
  4492 | FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list END_FUNCTION_BLOCK
  5261 	{$$ = NULL;
  4493 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in function block declaration."); yynerrs++;}
  5262 	 yynerrs++;
       
  5263 	 print_err_msg(current_filename, locl(@3), locf(@4), "no body defined in function block declaration.");
       
  5264 	}
       
  5265 | FUNCTION_BLOCK derived_function_block_name END_FUNCTION_BLOCK
  4494 | FUNCTION_BLOCK derived_function_block_name END_FUNCTION_BLOCK
  5266 	{$$ = NULL;
  4495 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared and body defined in function block declaration."); yynerrs++;}
  5267 	 yynerrs++;
  4496 | FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list function_block_body END_OF_INPUT
  5268 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable(s) declared and body defined in function block declaration.");
  4497 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "no variable(s) declared and body defined in function block declaration."); yynerrs++;}	
  5269 	}
       
  5270 | FUNCTION_BLOCK error END_FUNCTION_BLOCK
  4498 | FUNCTION_BLOCK error END_FUNCTION_BLOCK
  5271 	{$$ = NULL;
  4499 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in function block declaration."); yyerrok;}
  5272 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in function block declaration.");
       
  5273 	 yyerrok;
       
  5274 	}
       
  5275 /* ERROR_CHECK_END */
  4500 /* ERROR_CHECK_END */
  5276 ;
  4501 ;
  5277 
  4502 
  5278 
  4503 
  5279 
  4504 
  5291 	{$$ = $1; $$->add_element($2);}
  4516 	{$$ = $1; $$->add_element($2);}
  5292 | io_OR_other_var_declarations_list other_var_declarations
  4517 | io_OR_other_var_declarations_list other_var_declarations
  5293 	{$$ = $1; $$->add_element($2);}
  4518 	{$$ = $1; $$->add_element($2);}
  5294 /* ERROR_CHECK_BEGIN */
  4519 /* ERROR_CHECK_BEGIN */
  5295 | io_OR_other_var_declarations_list located_var_declarations
  4520 | io_OR_other_var_declarations_list located_var_declarations
  5296 	{$$ = $1;
  4521 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected located variable(s) declaration in function block declaration."); yynerrs++;}
  5297 	 yynerrs++;
       
  5298 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected located variable(s) declaration in function block declaration.");
       
  5299 	}
       
  5300 | io_OR_other_var_declarations_list global_var_declarations
  4522 | io_OR_other_var_declarations_list global_var_declarations
  5301 	{$$ = $1;
  4523 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration."); yynerrs++;}
  5302 	 yynerrs++;
       
  5303 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration.");
       
  5304 	}
       
  5305 /*| io_OR_other_var_declarations_list access_declarations
  4524 /*| io_OR_other_var_declarations_list access_declarations
  5306 	{$$ = $1;
  4525 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration."); yynerrs++;}*/
  5307 	 yynerrs++;
       
  5308 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration.");
       
  5309 	}*/
       
  5310 | io_OR_other_var_declarations_list instance_specific_initializations
  4526 | io_OR_other_var_declarations_list instance_specific_initializations
  5311 	{$$ = $1;
  4527 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration."); yynerrs++;}
  5312 	 yynerrs++;
       
  5313 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration.");
       
  5314 	}
       
  5315 /* ERROR_CHECK_END */
  4528 /* ERROR_CHECK_END */
  5316 ;
  4529 ;
  5317 
  4530 
  5318 /* NOTE:
  4531 /* NOTE:
  5319  *  The IEC specification gives the following definition:
  4532  *  The IEC specification gives the following definition:
  5344 temp_var_decls:
  4557 temp_var_decls:
  5345   VAR_TEMP temp_var_decls_list END_VAR
  4558   VAR_TEMP temp_var_decls_list END_VAR
  5346 	{$$ = new temp_var_decls_c($2, locloc(@$));}
  4559 	{$$ = new temp_var_decls_c($2, locloc(@$));}
  5347 /* ERROR_CHECK_BEGIN */
  4560 /* ERROR_CHECK_BEGIN */
  5348 | VAR_TEMP END_VAR
  4561 | VAR_TEMP END_VAR
  5349 	{$$ = NULL;
  4562 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in temporary variable(s) declaration."); yynerrs++;}
  5350 	 yynerrs++;
  4563 | VAR_TEMP temp_var_decls_list error END_OF_INPUT
  5351 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in temporary variable(s) declaration.");
  4564 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "unclosed temporary variable(s) declaration."); yyerrok;}
  5352 	}
       
  5353 | VAR_TEMP error temp_var_decls_list END_VAR
  4565 | VAR_TEMP error temp_var_decls_list END_VAR
  5354 	{$$ = NULL;
  4566 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_TEMP' in function variable(s) declaration."); yyerrok;}
  5355 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_TEMP' in function variable(s) declaration.");
       
  5356 	 yyerrok;
       
  5357 	}
       
  5358 /* ERROR_CHECK_END */
  4567 /* ERROR_CHECK_END */
  5359 ;
  4568 ;
  5360 
  4569 
  5361 
  4570 
  5362 /* intermediate helper symbol for temp_var_decls */
  4571 /* intermediate helper symbol for temp_var_decls */
  5365 	{$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);}
  4574 	{$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);}
  5366 | temp_var_decls_list temp_var_decl ';'
  4575 | temp_var_decls_list temp_var_decl ';'
  5367 	{$$ = $1; $$->add_element($2);}
  4576 	{$$ = $1; $$->add_element($2);}
  5368 /* ERROR_CHECK_BEGIN */
  4577 /* ERROR_CHECK_BEGIN */
  5369 | error ';'
  4578 | error ';'
  5370 	{$$ = new temp_var_decls_list_c(locloc(@$));
  4579 	{$$ = new temp_var_decls_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid temporary variable(s) declaration."); yyerrok;}
  5371 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid temporary variable(s) declaration.");
       
  5372 	 yyerrok;
       
  5373 	}
       
  5374 | temp_var_decl error
  4580 | temp_var_decl error
  5375 	{$$ = new temp_var_decls_list_c(locloc(@$));
  4581 	{$$ = new temp_var_decls_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of temporary variable(s) declaration."); yyerrok;}
  5376 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at end of temporary variable(s) declaration.");
       
  5377 	 yyerrok;
       
  5378 	}
       
  5379 | temp_var_decls_list temp_var_decl error
  4582 | temp_var_decls_list temp_var_decl error
  5380 	{$$ = $1;
  4583 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of temporary variable(s) declaration."); yyerrok;}
  5381 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of temporary variable(s) declaration.");
       
  5382 	 yyerrok;
       
  5383 	}
       
  5384 | temp_var_decls_list error ';'
  4584 | temp_var_decls_list error ';'
  5385 	{$$ = $1;
  4585 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid temporary variable(s) declaration."); yyerrok;}
  5386 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid temporary variable(s) declaration.");
       
  5387 	 yyerrok;
       
  5388 	}
       
  5389 | temp_var_decls_list ';'
  4586 | temp_var_decls_list ';'
  5390 	{$$ = $1;
  4587 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after temporary variable(s) declaration."); yynerrs++;}
  5391 	 yynerrs++;
       
  5392 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after temporary variable(s) declaration.");
       
  5393 	}
       
  5394 /* ERROR_CHECK_END */
  4588 /* ERROR_CHECK_END */
  5395 ;
  4589 ;
  5396 
  4590 
  5397 
  4591 
  5398 non_retentive_var_decls:
  4592 non_retentive_var_decls:
  5399   VAR NON_RETAIN var_init_decl_list END_VAR
  4593   VAR NON_RETAIN var_init_decl_list END_VAR
  5400 	{$$ = new non_retentive_var_decls_c($3, locloc(@$));}
  4594 	{$$ = new non_retentive_var_decls_c($3, locloc(@$));}
  5401 /* ERROR_CHECK_BEGIN */
  4595 /* ERROR_CHECK_BEGIN */
       
  4596 | VAR NON_RETAIN var_init_decl_list error END_OF_INPUT
       
  4597 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unclosed non-retentive temporary variable(s) declaration."); yyerrok;}
  5402 | VAR NON_RETAIN error var_init_decl_list END_VAR
  4598 | VAR NON_RETAIN error var_init_decl_list END_VAR
  5403 	{$$ = NULL;
  4599 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive temporary variable(s) declaration."); yyerrok;}
  5404 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive temporary variable(s) declaration.");
       
  5405 	 yyerrok;
       
  5406 	}
       
  5407 /* ERROR_CHECK_END */
  4600 /* ERROR_CHECK_END */
  5408 ;
  4601 ;
  5409 
  4602 
  5410 
  4603 
  5411 
  4604 
  5440 	  */
  4633 	  */
  5441 	 variable_name_symtable.pop();
  4634 	 variable_name_symtable.pop();
  5442 	}
  4635 	}
  5443 /* ERROR_CHECK_BEGIN */
  4636 /* ERROR_CHECK_BEGIN */
  5444 | PROGRAM program_var_declarations_list function_block_body END_PROGRAM
  4637 | PROGRAM program_var_declarations_list function_block_body END_PROGRAM
  5445   {$$ = NULL;
  4638   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no program name defined in program declaration.");}
  5446 	 yynerrs++;
       
  5447 	 print_err_msg(current_filename, locl(@1), locf(@2), "no program name defined in program declaration.");
       
  5448 	}
       
  5449 | PROGRAM error program_var_declarations_list function_block_body END_PROGRAM
  4639 | PROGRAM error program_var_declarations_list function_block_body END_PROGRAM
  5450 	{$$ = NULL;
  4640 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program name in program declaration."); yyerrok;}
  5451 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid program name in program declaration.");
       
  5452 	 yyerrok;
       
  5453 	}
       
  5454 | PROGRAM program_type_name function_block_body END_PROGRAM
  4641 | PROGRAM program_type_name function_block_body END_PROGRAM
  5455 	{$$ = NULL;
  4642 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared in program declaration."); yynerrs++;}
  5456 	 yynerrs++;
       
  5457 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable(s) declared in program declaration.");
       
  5458 	}
       
  5459 | PROGRAM program_type_name program_var_declarations_list END_PROGRAM
  4643 | PROGRAM program_type_name program_var_declarations_list END_PROGRAM
  5460 	{$$ = NULL;
  4644 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in program declaration."); yynerrs++;}
  5461 	 yynerrs++;
       
  5462 	 print_err_msg(current_filename, locl(@3), locf(@4), "no body defined in program declaration.");
       
  5463 	}
       
  5464 | PROGRAM program_type_name END_PROGRAM
  4645 | PROGRAM program_type_name END_PROGRAM
  5465 	{$$ = NULL;
  4646 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared and body defined in program declaration."); yynerrs++;}
  5466 	 yynerrs++;
  4647 | PROGRAM program_type_name program_var_declarations_list function_block_body END_OF_INPUT
  5467 	 print_err_msg(current_filename, locl(@2), locf(@3), "no variable(s) declared and body defined in program declaration.");
  4648 	{$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed program declaration."); yynerrs++;}
  5468 	}
       
  5469 | PROGRAM error END_PROGRAM
  4649 | PROGRAM error END_PROGRAM
  5470 	{$$ = NULL;
  4650 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in program declaration."); yyerrok;}
  5471 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in program declaration.");
       
  5472 	 yyerrok;
       
  5473 	}
       
  5474 /* ERROR_CHECK_END */
  4651 /* ERROR_CHECK_END */
  5475 ;
  4652 ;
  5476 
  4653 
  5477 
  4654 
  5478 /* helper symbol for program_declaration */
  4655 /* helper symbol for program_declaration */
  5496 | program_var_declarations_list program_access_decls
  4673 | program_var_declarations_list program_access_decls
  5497 	{$$ = $1; $$->add_element($2);}
  4674 	{$$ = $1; $$->add_element($2);}
  5498 */
  4675 */
  5499 /* ERROR_CHECK_BEGIN */
  4676 /* ERROR_CHECK_BEGIN */
  5500 | program_var_declarations_list global_var_declarations
  4677 | program_var_declarations_list global_var_declarations
  5501 	{$$ = $1;
  4678 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration."); yynerrs++;}
  5502 	 yynerrs++;
       
  5503 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration.");
       
  5504 	}
       
  5505 /*| program_var_declarations_list access_declarations
  4679 /*| program_var_declarations_list access_declarations
  5506 	{$$ = $1;
  4680 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration."); yynerrs++;}*/
  5507 	 yynerrs++;
       
  5508 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration.");
       
  5509 	}*/
       
  5510 | program_var_declarations_list instance_specific_initializations
  4681 | program_var_declarations_list instance_specific_initializations
  5511 	{$$ = $1;
  4682 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration."); yynerrs++;
  5512 	 yynerrs++;
       
  5513 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration.");
       
  5514 	}
  4683 	}
  5515 /* ERROR_CHECK_END */
  4684 /* ERROR_CHECK_END */
  5516 ;
  4685 ;
  5517 
  4686 
  5518 
  4687 
  5560 	{$$ = $1; $$->add_element($2);}
  4729 	{$$ = $1; $$->add_element($2);}
  5561 | sfc_network action
  4730 | sfc_network action
  5562 	{$$ = $1; $$->add_element($2);}
  4731 	{$$ = $1; $$->add_element($2);}
  5563 /* ERROR_CHECK_BEGIN */
  4732 /* ERROR_CHECK_BEGIN */
  5564 | sfc_network error 
  4733 | sfc_network error 
  5565 	{$$ = NULL;
  4734 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "unexpected token after SFC network in sequencial function chart."); yyerrok;}
  5566 	 print_err_msg(current_filename, locl(@1), locf(@2), "unexpected token after SFC network in sequencial function chart.");
       
  5567 	 yyerrok;
       
  5568 	}
       
  5569 /* ERROR_CHECK_END */
  4735 /* ERROR_CHECK_END */
  5570 ;
  4736 ;
  5571 
  4737 
  5572 initial_step:
  4738 initial_step:
  5573   INITIAL_STEP step_name ':' action_association_list END_STEP
  4739   INITIAL_STEP step_name ':' action_association_list END_STEP
  5574 //  INITIAL_STEP identifier ':' action_association_list END_STEP
  4740 //  INITIAL_STEP identifier ':' action_association_list END_STEP
  5575 	{$$ = new initial_step_c($2, $4, locloc(@$));}
  4741 	{$$ = new initial_step_c($2, $4, locloc(@$));}
  5576 /* ERROR_CHECK_BEGIN */
  4742 /* ERROR_CHECK_BEGIN */
  5577 | INITIAL_STEP ':' action_association_list END_STEP
  4743 | INITIAL_STEP ':' action_association_list END_STEP
  5578   {$$ = NULL;
  4744   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "no step name defined in initial step declaration."); yynerrs++;}
  5579 	 yynerrs++;
       
  5580 	 print_err_msg(current_filename, locf(@1), locl(@2), "no step name defined in initial step declaration.");
       
  5581 	}
       
  5582 | INITIAL_STEP error ':' action_association_list END_STEP
  4745 | INITIAL_STEP error ':' action_association_list END_STEP
  5583 	{$$ = NULL;
  4746 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step name defined in initial step declaration."); yyerrok;}
  5584 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid step name defined in initial step declaration.");
       
  5585 	 yyerrok;
       
  5586 	}
       
  5587 | INITIAL_STEP step_name action_association_list END_STEP
  4747 | INITIAL_STEP step_name action_association_list END_STEP
  5588 	{$$ = NULL;
  4748 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "':' missing after step name in initial step declaration."); yynerrs++;}
  5589 	 yynerrs++;
       
  5590 	 print_err_msg(current_filename, locl(@2), locf(@3), "':' missing after step name in initial step declaration.");
       
  5591 	}
       
  5592 | INITIAL_STEP step_name error action_association_list END_STEP
       
  5593 	{$$ = NULL;
       
  5594 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ':' after step name in initial step declaration.");
       
  5595 	 yyerrok;
       
  5596 	}
       
  5597 | INITIAL_STEP step_name ':' error END_STEP
  4749 | INITIAL_STEP step_name ':' error END_STEP
  5598 	{$$ = NULL;
  4750 	{$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid action association list in initial step declaration."); yyerrok;}
  5599 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid action association list in initial step declaration.");
  4751 | INITIAL_STEP step_name ':' action_association_list END_OF_INPUT
  5600 	 yyerrok;
  4752 	{$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed initial step declaration."); yynerrs++;}
  5601 	}
       
  5602 | INITIAL_STEP error END_STEP
  4753 | INITIAL_STEP error END_STEP
  5603 	{$$ = NULL;
  4754 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in initial step declaration."); yyerrok;}
  5604 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in initial step declaration.");
       
  5605 	 yyerrok;
       
  5606 	}
       
  5607 /* ERROR_CHECK_END */
  4755 /* ERROR_CHECK_END */
  5608 ;
  4756 ;
  5609 
  4757 
  5610 step:
  4758 step:
  5611   STEP step_name ':' action_association_list END_STEP
  4759   STEP step_name ':' action_association_list END_STEP
  5612 //  STEP identifier ':' action_association_list END_STEP
  4760 //  STEP identifier ':' action_association_list END_STEP
  5613 	{$$ = new step_c($2, $4, locloc(@$));}
  4761 	{$$ = new step_c($2, $4, locloc(@$));}
  5614 /* ERROR_CHECK_BEGIN */
  4762 /* ERROR_CHECK_BEGIN */
  5615 | STEP ':' action_association_list END_STEP
  4763 | STEP ':' action_association_list END_STEP
  5616   {$$ = NULL;
  4764   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no step name defined in step declaration."); yynerrs++;}
  5617 	 yynerrs++;
       
  5618 	 print_err_msg(current_filename, locl(@1), locf(@2), "no step name defined in step declaration.");
       
  5619 	}
       
  5620 | STEP error ':' action_association_list END_STEP
  4765 | STEP error ':' action_association_list END_STEP
  5621 	{$$ = NULL;
  4766 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step name defined in step declaration."); yyerrok;}
  5622 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid step name defined in step declaration.");
       
  5623 	 yyerrok;
       
  5624 	}
       
  5625 | STEP step_name action_association_list END_STEP
  4767 | STEP step_name action_association_list END_STEP
  5626 	{$$ = NULL;
  4768 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "':' missing after step name in step declaration."); yynerrs++;}
  5627 	 yynerrs++;
       
  5628 	 print_err_msg(current_filename, locl(@2), locf(@3), "':' missing after step name in step declaration.");
       
  5629 	}
       
  5630 | STEP step_name error action_association_list END_STEP
       
  5631 	{$$ = NULL;
       
  5632 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ':' after step name in step declaration.");
       
  5633 	 yyerrok;
       
  5634 	}
       
  5635 | STEP step_name ':' error END_STEP
  4769 | STEP step_name ':' error END_STEP
  5636 	{$$ = NULL;
  4770 	{$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid action association list in step declaration."); yyerrok;}
  5637 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid action association list in step declaration.");
  4771 | STEP step_name ':' action_association_list END_OF_INPUT
  5638 	 yyerrok;
  4772 	{$$ = NULL; print_err_msg(locf(@1), locl(@3), "invalid action association list in step declaration."); yynerrs++;}
  5639 	}
       
  5640 | STEP error END_STEP
  4773 | STEP error END_STEP
  5641 	{$$ = NULL;
  4774 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in step declaration."); yyerrok;}
  5642 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in step declaration.");
       
  5643 	 yyerrok;
       
  5644 	}
       
  5645 /* ERROR_CHECK_END */
  4775 /* ERROR_CHECK_END */
  5646 ;
  4776 ;
  5647 
  4777 
  5648 /* helper symbol for:
  4778 /* helper symbol for:
  5649  *  - initial_step
  4779  *  - initial_step
  5654 	{$$ = new action_association_list_c(locloc(@$));}
  4784 	{$$ = new action_association_list_c(locloc(@$));}
  5655 | action_association_list action_association ';'
  4785 | action_association_list action_association ';'
  5656 	{$$ = $1; $$->add_element($2);}
  4786 	{$$ = $1; $$->add_element($2);}
  5657 /* ERROR_CHECK_BEGIN */
  4787 /* ERROR_CHECK_BEGIN */
  5658 | action_association_list action_association error
  4788 | action_association_list action_association error
  5659 	{$$ = $1;
  4789 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of action association declaration."); yyerrok;}
  5660 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at end of action association declaration.");
       
  5661 	 yyerrok;
       
  5662 	}
       
  5663 | action_association_list ';'
  4790 | action_association_list ';'
  5664 	{$$ = $1;
  4791 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after action association declaration."); yynerrs++;}
  5665 	 yynerrs++;
       
  5666 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after action association declaration.");
       
  5667 	}
       
  5668 /* ERROR_CHECK_END */
  4792 /* ERROR_CHECK_END */
  5669 ;
  4793 ;
  5670 
  4794 
  5671 
  4795 
  5672 // step_name: identifier;
  4796 // step_name: identifier;
  5674 
  4798 
  5675 action_association:
  4799 action_association:
  5676   action_name '(' {cmd_goto_sfc_qualifier_state()} action_qualifier {cmd_pop_state()} indicator_name_list ')'
  4800   action_name '(' {cmd_goto_sfc_qualifier_state()} action_qualifier {cmd_pop_state()} indicator_name_list ')'
  5677 	{$$ = new action_association_c($1, $4, $6, locloc(@$));}
  4801 	{$$ = new action_association_c($1, $4, $6, locloc(@$));}
  5678 /* ERROR_CHECK_BEGIN */
  4802 /* ERROR_CHECK_BEGIN */
  5679 /*| action_name '(' error indicator_name_list ')'
  4803 /*| action_name '(' error ')'
  5680   {$$ = NULL;
  4804   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid qualifier defined in action association."); yyerrok;}*/
  5681 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid qualifier defined in action association.");
       
  5682 	 yyerrok;
       
  5683 	}*/
       
  5684 /* ERROR_CHECK_END */
  4805 /* ERROR_CHECK_END */
  5685 ;
  4806 ;
  5686 
  4807 
  5687 /* helper symbol for action_association */
  4808 /* helper symbol for action_association */
  5688 indicator_name_list:
  4809 indicator_name_list:
  5690 	{$$ = new indicator_name_list_c(locloc(@$));}
  4811 	{$$ = new indicator_name_list_c(locloc(@$));}
  5691 | indicator_name_list ',' indicator_name
  4812 | indicator_name_list ',' indicator_name
  5692 	{$$ = $1; $$->add_element($3);}
  4813 	{$$ = $1; $$->add_element($3);}
  5693 /* ERROR_CHECK_BEGIN */
  4814 /* ERROR_CHECK_BEGIN */
  5694 | indicator_name_list indicator_name
  4815 | indicator_name_list indicator_name
  5695 	{$$ = $1;
  4816 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing at end of action association declaration."); yynerrs++;}
  5696 	 yynerrs++;
       
  5697 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing at end of action association declaration.");
       
  5698 	}
       
  5699 | indicator_name_list ',' error
  4817 | indicator_name_list ',' error
  5700 	{$$ = $1;
  4818 	{$$ = $1;
  5701 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after ',' in indicator list.");
  4819 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no indicator defined in indicator list.");}
       
  4820 	 else {print_err_msg(locf(@3), locl(@3), "invalid indicator in indicator list."); yyclearin;}
  5702 	 yyerrok;
  4821 	 yyerrok;
  5703 	}
  4822 	}
  5704 /* ERROR_CHECK_END */
  4823 /* ERROR_CHECK_END */
  5705 ;
  4824 ;
  5706 
  4825 
  5714 	{$$ = new action_qualifier_c($1, NULL, locloc(@$));}
  4833 	{$$ = new action_qualifier_c($1, NULL, locloc(@$));}
  5715 | timed_qualifier ',' action_time
  4834 | timed_qualifier ',' action_time
  5716 	{$$ = new action_qualifier_c($1, $3, locloc(@$));}
  4835 	{$$ = new action_qualifier_c($1, $3, locloc(@$));}
  5717 /* ERROR_CHECK_BEGIN */
  4836 /* ERROR_CHECK_BEGIN */
  5718 | timed_qualifier action_time
  4837 | timed_qualifier action_time
  5719 	{$$ = NULL;
  4838 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "',' missing between timed qualifier and action time in action qualifier."); yynerrs++;}
  5720 	 yynerrs++;
       
  5721 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing between timed qualifier and action time in action qualifier.");
       
  5722 	}
       
  5723 | timed_qualifier ',' error
  4839 | timed_qualifier ',' error
  5724 	{$$ = NULL;
  4840 	{$$ = NULL;
  5725 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after ',' in action qualifier.");
  4841 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no action time defined in action qualifier.");}
       
  4842 	 else {print_err_msg(locf(@3), locl(@3), "invalid action time in action qualifier."); yyclearin;}
  5726 	 yyerrok;
  4843 	 yyerrok;
  5727 	}
  4844 	}
  5728 /* ERROR_CHECK_END */
  4845 /* ERROR_CHECK_END */
  5729 ;
  4846 ;
  5730 
  4847 
  5759 	{$$ = new steps_c($1, NULL, locloc(@$));}
  4876 	{$$ = new steps_c($1, NULL, locloc(@$));}
  5760 | '(' step_name_list ')'
  4877 | '(' step_name_list ')'
  5761 	{$$ = new steps_c(NULL, $2, locloc(@$));}
  4878 	{$$ = new steps_c(NULL, $2, locloc(@$));}
  5762 /* ERROR_CHECK_BEGIN */
  4879 /* ERROR_CHECK_BEGIN */
  5763 | '(' step_name_list error
  4880 | '(' step_name_list error
  5764 	{$$ = NULL;
  4881 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ')' at the end of step list in transition declaration."); yyerrok;}
  5765 	 print_err_msg(current_filename, locl(@2), locf(@3), "expecting ')' at the end of step list in transition declaration.");
       
  5766 	 yyerrok;
       
  5767 	}
       
  5768 | '(' error ')'
  4882 | '(' error ')'
  5769 	{$$ = NULL;
  4883 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step list in transition declaration."); yyerrok;}
  5770 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid step list in transition declaration.");
       
  5771 	 yyerrok;
       
  5772 	}
       
  5773 /* ERROR_CHECK_END */
  4884 /* ERROR_CHECK_END */
  5774 ;
  4885 ;
  5775 
  4886 
  5776 step_name_list:
  4887 step_name_list:
  5777   step_name ',' step_name
  4888   step_name ',' step_name
  5778 	{$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
  4889 	{$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
  5779 | step_name_list ',' step_name
  4890 | step_name_list ',' step_name
  5780 	{$$ = $1; $$->add_element($3);}
  4891 	{$$ = $1; $$->add_element($3);}
  5781 /* ERROR_CHECK_BEGIN */
  4892 /* ERROR_CHECK_BEGIN */
  5782 | step_name_list step_name
  4893 | step_name_list step_name
  5783 	{$$ = $1;
  4894 	{$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in step list."); yynerrs++;}
  5784 	 yynerrs++;
       
  5785 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in step list.");
       
  5786 	}
       
  5787 | step_name_list ',' error
  4895 | step_name_list ',' error
  5788 	{$$ = $1;
  4896 	{$$ = $1;
  5789 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ',' in step list.");
  4897 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no step name defined in step list.");}
       
  4898 	 else {print_err_msg(locf(@3), locl(@3), "invalid step name in step list."); yyclearin;}
  5790 	 yyerrok;
  4899 	 yyerrok;
  5791 	}
  4900 	}
  5792 /* ERROR_CHECK_END */
  4901 /* ERROR_CHECK_END */
  5793 ;
  4902 ;
  5794 
  4903 
  5809     {cmd_goto_body_state();} transition_condition 
  4918     {cmd_goto_body_state();} transition_condition 
  5810   END_TRANSITION 
  4919   END_TRANSITION 
  5811 	{$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));}
  4920 	{$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));}
  5812 /* ERROR_CHECK_BEGIN */
  4921 /* ERROR_CHECK_BEGIN */
  5813 | TRANSITION error transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4922 | TRANSITION error transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5814 	{$$ = NULL;
  4923 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid transition name defined in transition declaration."); yyerrok;}
  5815 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid transition name defined in transition declaration.");
       
  5816 	 yyerrok;
       
  5817 	} 
       
  5818 | TRANSITION transition_name error FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4924 | TRANSITION transition_name error FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5819 	{$$ = NULL;
  4925 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid transition priority defined in transition declaration."); yyerrok;}
  5820 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid transition priority defined in transition declaration.");
       
  5821 	 yyerrok;
       
  5822 	}
       
  5823 | TRANSITION transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4926 | TRANSITION transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5824 	{$$ = NULL;
  4927 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no origin step(s) defined in transition declaration."); yynerrs++;}
  5825 	 yynerrs++;
       
  5826 	 print_err_msg(current_filename, locl(@3), locf(@4), "no origin step(s) defined in transition declaration.");
       
  5827 	}
       
  5828 | TRANSITION transition_name transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4928 | TRANSITION transition_name transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5829 	{$$ = NULL;
  4929 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "no origin step(s) defined in transition declaration."); yynerrs++;}
  5830 	 yynerrs++;
       
  5831 	 print_err_msg(current_filename, locl(@4), locf(@5), "no origin step(s) defined in transition declaration.");
       
  5832 	}
       
  5833 | TRANSITION transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4930 | TRANSITION transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5834 	{$$ = NULL;
  4931 	{$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid origin step(s) defined in transition declaration."); yyerrok;}
  5835 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid origin step(s) defined in transition declaration.");
       
  5836 	 yyerrok;
       
  5837 	}
       
  5838 | TRANSITION transition_name transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4932 | TRANSITION transition_name transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5839 	{$$ = NULL;
  4933 	{$$ = NULL; print_err_msg(locf(@5), locl(@5), "invalid origin step(s) defined in transition declaration."); yyerrok;}
  5840 	 print_err_msg(current_filename, locf(@5), locl(@5), "invalid origin step(s) defined in transition declaration.");
       
  5841 	 yyerrok;
       
  5842 	}
       
  5843 | TRANSITION transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4934 | TRANSITION transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5844 	{$$ = NULL;
  4935 	{$$ = NULL; print_err_msg(locl(@4), locf(@5), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); yynerrs++;}
  5845 	 yynerrs++;
       
  5846 	 print_err_msg(current_filename, locl(@4), locf(@5), "'TO' missing between origin step(s) and destination step(s) in transition declaration.");
       
  5847 	}
       
  5848 | TRANSITION transition_name transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  4936 | TRANSITION transition_name transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION
  5849 	{$$ = NULL;
  4937 	{$$ = NULL; print_err_msg(locl(@5), locf(@6), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); yynerrs++;}
  5850 	 yynerrs++;
       
  5851 	 print_err_msg(current_filename, locl(@5), locf(@6), "'TO' missing between origin step(s) and destination step(s) in transition declaration.");
       
  5852 	}
       
  5853 | TRANSITION transition_priority FROM steps error steps {cmd_goto_body_state();} transition_condition END_TRANSITION
       
  5854 	{$$ = NULL;
       
  5855 	 print_err_msg(current_filename, locf(@5), locl(@5), "expecting 'TO' between origin step(s) and destination step(s) in transition declaration.");
       
  5856 	 yyerrok;
       
  5857 	}
       
  5858 | TRANSITION transition_name transition_priority FROM steps error steps {cmd_goto_body_state();} transition_condition END_TRANSITION
       
  5859 	{$$ = NULL;
       
  5860 	 print_err_msg(current_filename, locf(@6), locl(@6), "expecting 'TO' between origin step(s) and destination step(s) in transition declaration.");
       
  5861 	 yyerrok;
       
  5862 	}
       
  5863 | TRANSITION transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION
  4938 | TRANSITION transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION
  5864 	{$$ = NULL;
  4939 	{$$ = NULL; print_err_msg(locl(@5), locf(@7), "no destination step(s) defined in transition declaration."); yynerrs++;}
  5865 	 yynerrs++;
       
  5866 	 print_err_msg(current_filename, locl(@5), locf(@7), "no destination step(s) defined in transition declaration.");
       
  5867 	}
       
  5868 | TRANSITION transition_name transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION
  4940 | TRANSITION transition_name transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION
  5869 	{$$ = NULL;
  4941 	{$$ = NULL; print_err_msg(locl(@6), locf(@8), "no destination step(s) defined in transition declaration."); yynerrs++;}
  5870 	 yynerrs++;
       
  5871 	 print_err_msg(current_filename, locl(@6), locf(@8), "no destination step(s) defined in transition declaration.");
       
  5872 	}
       
  5873 | TRANSITION transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION
  4942 | TRANSITION transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION
  5874 	{$$ = NULL;
  4943 	{$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid destination step(s) defined in transition declaration."); yyerrok;}
  5875 	 print_err_msg(current_filename, locf(@6), locl(@6), "invalid destination step(s) defined in transition declaration.");
       
  5876 	 yyerrok;
       
  5877 	}
       
  5878 | TRANSITION transition_name transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION
  4944 | TRANSITION transition_name transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION
  5879 	{$$ = NULL;
  4945 	{$$ = NULL; print_err_msg(locf(@7), locl(@7), "invalid destination step(s) defined in transition declaration."); yyerrok;}
  5880 	 print_err_msg(current_filename, locf(@7), locl(@7), "invalid destination step(s) defined in transition declaration.");
       
  5881 	 yyerrok;
       
  5882 	}
       
  5883 | TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
  4946 | TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
  5884 	{$$ = NULL;
  4947 	{$$ = NULL; print_err_msg(locl(@2), locf(@4), "no origin and destination step(s) defined in transition declaration."); yynerrs++;}
  5885 	 yynerrs++;
       
  5886 	 print_err_msg(current_filename, locl(@2), locf(@4), "no origin and destination step(s) defined in transition declaration.");
       
  5887 	}
       
  5888 | TRANSITION transition_name transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
  4948 | TRANSITION transition_name transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION
  5889 	{$$ = NULL;
  4949 	{$$ = NULL; print_err_msg(locl(@3), locf(@5), "no origin and destination step(s) defined in transition declaration."); yynerrs++;}
  5890 	 yynerrs++;
  4950 /*| TRANSITION transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition error END_OF_INPUT
  5891 	 print_err_msg(current_filename, locl(@3), locf(@5), "no origin and destination step(s) defined in transition declaration.");
  4951   {$$ = NULL; print_err_msg(locf(@1), locl(@6), "unclosed transition declaration."); yyerrok;}
  5892 	}
  4952 | TRANSITION transition_name transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition error END_OF_INPUT
       
  4953   {$$ = NULL; print_err_msg(locf(@1), locl(@7), "unclosed transition declaration."); yyerrok;}*/
  5893 | TRANSITION error END_TRANSITION
  4954 | TRANSITION error END_TRANSITION
  5894 	{$$ = NULL;
  4955 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in transition declaration."); yyerrok;}
  5895 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in transition declaration.");
       
  5896 	 yyerrok;
       
  5897 	}
       
  5898 /* ERROR_CHECK_END */
  4956 /* ERROR_CHECK_END */
  5899 ;
  4957 ;
  5900 
  4958 
  5901 transition_priority:
  4959 transition_priority:
  5902   /* empty */
  4960   /* empty */
  5903   {$$ = NULL;}
  4961   {$$ = NULL;}
  5904 | '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')'
  4962 | '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')'
  5905 	{$$ = $6;}
  4963 	{$$ = $6;}
  5906 /* ERROR_CHECK_BEGIN */
  4964 /* ERROR_CHECK_BEGIN */
  5907 | '(' ASSIGN integer ')'
  4965 | '(' ASSIGN integer ')'
  5908 	{$$ = NULL;
  4966 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'PRIORITY' missing between '(' and ':=' in transition declaration with priority."); yynerrs++;}
  5909 	 yynerrs++;
       
  5910 	 print_err_msg(current_filename, locl(@1), locf(@2), "'PRIORITY' missing between '(' and ':=' in transition declaration with priority.");
       
  5911 	}
       
  5912 | '(' error ASSIGN integer ')'
  4967 | '(' error ASSIGN integer ')'
  5913 	{$$ = NULL;
  4968 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "expecting 'PRIORITY' between '(' and ':=' in transition declaration with priority."); yyerrok;}
  5914 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting 'PRIORITY' between '(' and ':=' in transition declaration with priority.");
  4969 /* ERROR_CHECK_END */
  5915 	 yyerrok;
       
  5916 	}
       
  5917 //* ERROR_CHECK_END */
       
  5918 ;
  4970 ;
  5919 
  4971 
  5920 
  4972 
  5921 transition_condition:
  4973 transition_condition:
  5922   ':' eol_list simple_instr_list
  4974   ':' eol_list simple_instr_list
  5923 	{$$ = new transition_condition_c($3, NULL, locloc(@$));}
  4975 	{$$ = new transition_condition_c($3, NULL, locloc(@$));}
  5924 | ASSIGN expression ';'
  4976 | ASSIGN expression ';'
  5925 	{$$ = new transition_condition_c(NULL, $2, locloc(@$));}
  4977 	{$$ = new transition_condition_c(NULL, $2, locloc(@$));}
  5926 /* ERROR_CHECK_BEGIN */
  4978 /* ERROR_CHECK_BEGIN */
  5927 | eol_list simple_instr_list
  4979 | eol_list simple_instr_list
  5928 	{$$ = NULL;
  4980 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing before IL condition in transition declaration."); yynerrs++;}
  5929 	 yynerrs++;
       
  5930 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing before IL condition in transition declaration.");
       
  5931 	}
       
  5932 | ':' eol_list error
  4981 | ':' eol_list error
  5933 	{$$ = NULL;
  4982 	{$$ = NULL;
  5934 	 print_err_msg(current_filename, locl(@2), locf(@3), "no instructions defined in IL condition of transition declaration.");
  4983 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no instructions defined in IL condition of transition declaration.");}
       
  4984 	 else {print_err_msg(locf(@3), locl(@3), "invalid instructions in IL condition of transition declaration."); yyclearin;}
  5935 	 yyerrok;
  4985 	 yyerrok;
  5936 	}
  4986 	}
  5937 | ASSIGN ';'
  4987 | ASSIGN ';'
  5938 	{$$ = NULL;
  4988 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no expression defined in ST condition of transition declaration."); yynerrs++;}
  5939 	 yynerrs++;
       
  5940 	 print_err_msg(current_filename, locl(@1), locf(@2), "no expression defined in ST condition of transition declaration.");
       
  5941 	}
       
  5942 | ASSIGN error ';'
  4989 | ASSIGN error ';'
  5943 	{$$ = NULL;
  4990 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid expression defined in ST condition of transition declaration."); yyerrok;}
  5944 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression defined in ST condition of transition declaration.");
       
  5945 	 yyerrok;
       
  5946 	}
       
  5947 | ASSIGN expression error
  4991 | ASSIGN expression error
  5948 	{$$ = NULL;
  4992 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ';' after expression defined in ST condition of transition declaration."); yyerrok;}
  5949 	 print_err_msg(current_filename, locl(@2), locf(@3), "expecting ';' after expression defined in ST condition of transition declaration.");
       
  5950 	 yyerrok;
       
  5951 	}
       
  5952 /* ERROR_CHECK_END */
  4993 /* ERROR_CHECK_END */
  5953 ;
  4994 ;
  5954 
  4995 
  5955 
  4996 
  5956 
  4997 
  5958 //  ACTION identifier ':' ... 
  4999 //  ACTION identifier ':' ... 
  5959   ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5000   ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5960 	{$$ = new action_c($2, $5, locloc(@$));}
  5001 	{$$ = new action_c($2, $5, locloc(@$));}
  5961 /* ERROR_CHECK_BEGIN */
  5002 /* ERROR_CHECK_BEGIN */
  5962 | ACTION ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5003 | ACTION ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5963   {$$ = NULL;
  5004   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no action name defined in action declaration."); yynerrs++;}
  5964 	 yynerrs++;
       
  5965 	 print_err_msg(current_filename, locl(@1), locf(@2), "no action name defined in action declaration.");
       
  5966 	}
       
  5967 | ACTION error ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5005 | ACTION error ':' {cmd_goto_body_state();} function_block_body END_ACTION
  5968 	{$$ = NULL;
  5006 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid action name defined in action declaration."); yyerrok;}
  5969 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid action name defined in action declaration.");
       
  5970 	 yyerrok;
       
  5971 	}
       
  5972 | ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION
  5007 | ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION
  5973 	{$$ = NULL;
  5008 	{$$ = NULL; print_err_msg(locl(@2), locf(@4), "':' missing after action name in action declaration."); yynerrs++;}
  5974 	 yynerrs++;
       
  5975 	 print_err_msg(current_filename, locl(@2), locf(@4), "':' missing after action name in action declaration.");
       
  5976 	}
       
  5977 | ACTION action_name ':' END_ACTION
  5009 | ACTION action_name ':' END_ACTION
  5978 	{$$ = NULL;
  5010 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in action declaration."); yynerrs++;}
  5979 	 yynerrs++;
  5011 /*| ACTION action_name ':' {cmd_goto_body_state();} function_block_body END_OF_INPUT
  5980 	 print_err_msg(current_filename, locl(@3), locf(@4), "no body defined in action declaration.");
  5012 	{$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed action declaration."); yyerrok;}*/
  5981 	}
       
  5982 | ACTION error END_ACTION
  5013 | ACTION error END_ACTION
  5983 	{$$ = NULL;
  5014 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in action declaration."); yyerrok;}
  5984 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in action declaration.");
       
  5985 	 yyerrok;
       
  5986 	}
       
  5987 /* ERROR_CHECK_END */
  5015 /* ERROR_CHECK_END */
  5988 ;
  5016 ;
  5989 
  5017 
  5990 
  5018 
  5991 /********************************/
  5019 /********************************/
  6080    single_resource_declaration
  5108    single_resource_declaration
  6081    {variable_name_symtable.pop();}
  5109    {variable_name_symtable.pop();}
  6082    optional_access_declarations
  5110    optional_access_declarations
  6083    optional_instance_specific_initializations
  5111    optional_instance_specific_initializations
  6084   END_CONFIGURATION
  5112   END_CONFIGURATION
  6085   {$$ = NULL;
  5113   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no configuration name defined in configuration declaration."); yynerrs++;}
  6086 	 yynerrs++;
       
  6087 	 print_err_msg(current_filename, locl(@1), locf(@2), "no configuration name defined in configuration declaration.");
       
  6088 	}
       
  6089 | CONFIGURATION
  5114 | CONFIGURATION
  6090    optional_global_var_declarations
  5115    optional_global_var_declarations
  6091    resource_declaration_list
  5116    resource_declaration_list
  6092    optional_access_declarations
  5117    optional_access_declarations
  6093    optional_instance_specific_initializations
  5118    optional_instance_specific_initializations
  6094   END_CONFIGURATION
  5119   END_CONFIGURATION
  6095   {$$ = NULL;
  5120   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no configuration name defined in configuration declaration."); yynerrs++;}
  6096 	 yynerrs++;
       
  6097 	 print_err_msg(current_filename, locl(@1), locf(@2), "no configuration name defined in configuration declaration.");
       
  6098 	}
       
  6099 | CONFIGURATION error
  5121 | CONFIGURATION error
  6100    optional_global_var_declarations
  5122    optional_global_var_declarations
  6101    single_resource_declaration
  5123    single_resource_declaration
  6102    {variable_name_symtable.pop();}
  5124    {variable_name_symtable.pop();}
  6103    optional_access_declarations
  5125    optional_access_declarations
  6104    optional_instance_specific_initializations
  5126    optional_instance_specific_initializations
  6105   END_CONFIGURATION
  5127   END_CONFIGURATION
  6106   {$$ = NULL;
  5128   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid configuration name defined in configuration declaration."); yyerrok;}
  6107 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid configuration name defined in configuration declaration.");
       
  6108 	 yyerrok;
       
  6109 	}
       
  6110 | CONFIGURATION error
  5129 | CONFIGURATION error
  6111    optional_global_var_declarations
  5130    optional_global_var_declarations
  6112    resource_declaration_list
  5131    resource_declaration_list
  6113    optional_access_declarations
  5132    optional_access_declarations
  6114    optional_instance_specific_initializations
  5133    optional_instance_specific_initializations
  6115   END_CONFIGURATION
  5134   END_CONFIGURATION
  6116   {$$ = NULL;
  5135   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid configuration name defined in configuration declaration."); yyerrok;}
  6117 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid configuration name defined in configuration declaration.");
       
  6118 	 yyerrok;
       
  6119 	}
       
  6120 | CONFIGURATION configuration_name
  5136 | CONFIGURATION configuration_name
  6121    optional_global_var_declarations
  5137    optional_global_var_declarations
  6122    optional_access_declarations
  5138    optional_access_declarations
  6123    optional_instance_specific_initializations
  5139    optional_instance_specific_initializations
  6124   END_CONFIGURATION
  5140   END_CONFIGURATION
  6125   {$$ = NULL;
  5141   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no resource(s) defined in configuration declaration."); yynerrs++;}
  6126 	 yynerrs++;
       
  6127 	 print_err_msg(current_filename, locl(@3), locf(@4), "no resource(s) defined in configuration declaration.");
       
  6128 	}
       
  6129 | CONFIGURATION configuration_name
  5142 | CONFIGURATION configuration_name
  6130    optional_global_var_declarations
  5143    optional_global_var_declarations
  6131    error
  5144    error
  6132    optional_access_declarations
  5145    optional_access_declarations
  6133    optional_instance_specific_initializations
  5146    optional_instance_specific_initializations
  6134   END_CONFIGURATION
  5147   END_CONFIGURATION
  6135   {$$ = NULL;
  5148   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid resource(s) defined in configuration declaration."); yyerrok;}
  6136 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid resource(s) defined in configuration declaration.");
  5149 /*| CONFIGURATION configuration_name
  6137 	 yyerrok;
  5150    optional_global_var_declarations
  6138 	}
  5151    single_resource_declaration
       
  5152    {variable_name_symtable.pop();}
       
  5153    optional_access_declarations
       
  5154    optional_instance_specific_initializations
       
  5155   END_OF_INPUT
       
  5156   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed configuration declaration."); yyerrok;}*/
       
  5157 | CONFIGURATION configuration_name
       
  5158    optional_global_var_declarations
       
  5159    resource_declaration_list
       
  5160    optional_access_declarations
       
  5161    optional_instance_specific_initializations
       
  5162   END_OF_INPUT
       
  5163   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed configuration declaration."); yyerrok;}
  6139 | CONFIGURATION error END_CONFIGURATION
  5164 | CONFIGURATION error END_CONFIGURATION
  6140 	{$$ = NULL;
  5165 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in configuration declaration."); yyerrok;}
  6141 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in configuration declaration.");
       
  6142 	 yyerrok;
       
  6143 	}
       
  6144 /* ERROR_CHECK_END */
  5166 /* ERROR_CHECK_END */
  6145 ;
  5167 ;
  6146 
  5168 
  6147 // helper symbol for
  5169 // helper symbol for
  6148 //  - configuration_declaration
  5170 //  - configuration_declaration
  6175 	{$$ = new resource_declaration_list_c(locloc(@$)); $$->add_element($1);}
  5197 	{$$ = new resource_declaration_list_c(locloc(@$)); $$->add_element($1);}
  6176 | resource_declaration_list resource_declaration
  5198 | resource_declaration_list resource_declaration
  6177 	{$$ = $1; $$->add_element($2);}
  5199 	{$$ = $1; $$->add_element($2);}
  6178 /* ERROR_CHECK_BEGIN */
  5200 /* ERROR_CHECK_BEGIN */
  6179 | resource_declaration_list error
  5201 | resource_declaration_list error
  6180 	{$$ = $1;
  5202 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected token after resource declaration."); yyerrok;}
  6181 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after resource declaration.");
       
  6182 	 yyerrok;
       
  6183 	}
       
  6184 /* ERROR_CHECK_END */
  5203 /* ERROR_CHECK_END */
  6185 ;
  5204 ;
  6186 
  5205 
  6187 
  5206 
  6188 resource_declaration:
  5207 resource_declaration:
  6197 /* ERROR_CHECK_BEGIN */
  5216 /* ERROR_CHECK_BEGIN */
  6198 | RESOURCE {variable_name_symtable.push();} ON resource_type_name
  5217 | RESOURCE {variable_name_symtable.push();} ON resource_type_name
  6199    optional_global_var_declarations
  5218    optional_global_var_declarations
  6200    single_resource_declaration
  5219    single_resource_declaration
  6201   END_RESOURCE
  5220   END_RESOURCE
  6202   {$$ = NULL;
  5221   {$$ = NULL; print_err_msg(locl(@1), locf(@3), "no resource name defined in resource declaration."); yynerrs++;}
  6203 	 yynerrs++;
  5222 /*|	RESOURCE {variable_name_symtable.push();} resource_name ON resource_type_name
  6204 	 print_err_msg(current_filename, locl(@1), locf(@3), "no resource name defined in resource declaration.");
  5223    optional_global_var_declarations
  6205 	}
  5224    single_resource_declaration
       
  5225   END_OF_INPUT
       
  5226 	{$$ = NULL; print_err_msg(locf(@1), locl(@5), "unclosed resource declaration."); yyerrok;}*/
  6206 | RESOURCE error END_RESOURCE
  5227 | RESOURCE error END_RESOURCE
  6207 	{$$ = NULL;
  5228 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in resource declaration."); yyerrok;}
  6208 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in resource declaration.");
       
  6209 	 yyerrok;
       
  6210 	}
       
  6211 /* ERROR_CHECK_END */
  5229 /* ERROR_CHECK_END */
  6212 ;
  5230 ;
  6213 
  5231 
  6214 
  5232 
  6215 single_resource_declaration:
  5233 single_resource_declaration:
  6224 	{$$ = new task_configuration_list_c(locloc(@$));}
  5242 	{$$ = new task_configuration_list_c(locloc(@$));}
  6225 | task_configuration_list task_configuration ';'
  5243 | task_configuration_list task_configuration ';'
  6226 	{$$ = $1; $$->add_element($2);}
  5244 	{$$ = $1; $$->add_element($2);}
  6227 /* ERROR_CHECK_BEGIN */
  5245 /* ERROR_CHECK_BEGIN */
  6228 | task_configuration_list task_configuration error
  5246 | task_configuration_list task_configuration error
  6229   {$$ = $1;
  5247   {$$ = $1; print_err_msg(locl(@1), locf(@2), "';' missing at the end of task configuration in resource declaration."); yyerrok;}
  6230 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at the end of task configuration in resource declaration.");
       
  6231 	 yyerrok;
       
  6232 	}
       
  6233 | task_configuration_list ';'
  5248 | task_configuration_list ';'
  6234   {$$ = $1;
  5249   {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after task configuration in resource declaration."); yynerrs++;}
  6235 	 yynerrs++;
       
  6236 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after task configuration in resource declaration.");
       
  6237 	}
       
  6238 /* ERROR_CHECK_END */
  5250 /* ERROR_CHECK_END */
  6239 ;
  5251 ;
  6240 
  5252 
  6241 
  5253 
  6242 // helper symbol for single_resource_declaration //
  5254 // helper symbol for single_resource_declaration //
  6245 	{$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);}
  5257 	{$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);}
  6246 | program_configuration_list program_configuration ';'
  5258 | program_configuration_list program_configuration ';'
  6247 	{$$ = $1; $$->add_element($2);}
  5259 	{$$ = $1; $$->add_element($2);}
  6248 /* ERROR_CHECK_BEGIN */
  5260 /* ERROR_CHECK_BEGIN */
  6249 | program_configuration error
  5261 | program_configuration error
  6250   {$$ = new program_configuration_list_c(locloc(@$));
  5262   {$$ = new program_configuration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of program configuration in resource declaration."); yyerrok;}
  6251 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at the end of program configuration in resource declaration.");
       
  6252 	 yyerrok;
       
  6253 	}
       
  6254 | program_configuration_list program_configuration error
  5263 | program_configuration_list program_configuration error
  6255   {$$ = $1;
  5264   {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of program configuration in resource declaration."); yyerrok;}
  6256 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at the end of program configuration in resource declaration.");
       
  6257 	 yyerrok;
       
  6258 	}
       
  6259 | program_configuration_list error ';'
  5265 | program_configuration_list error ';'
  6260   {$$ = $1;
  5266   {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid program configuration in resource declaration."); yyerrok;}
  6261 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid program configuration in resource declaration.");
       
  6262 	 yyerrok;
       
  6263 	}
       
  6264 | program_configuration_list ';'
  5267 | program_configuration_list ';'
  6265   {$$ = $1;
  5268   {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after program configuration in resource declaration."); yynerrs++;}
  6266 	 yynerrs++;
       
  6267 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after program configuration in resource declaration.");
       
  6268 	}
       
  6269 /* ERROR_CHECK_END */
  5269 /* ERROR_CHECK_END */
  6270 ;
  5270 ;
  6271 
  5271 
  6272 
  5272 
  6273 resource_name: identifier;
  5273 resource_name: identifier;
  6276 access_declarations:
  5276 access_declarations:
  6277  VAR_ACCESS access_declaration_list END_VAR
  5277  VAR_ACCESS access_declaration_list END_VAR
  6278 	{$$ = NULL;}
  5278 	{$$ = NULL;}
  6279 // ERROR_CHECK_BEGIN //
  5279 // ERROR_CHECK_BEGIN //
  6280 | VAR_ACCESS END_VAR
  5280 | VAR_ACCESS END_VAR
  6281 	{$$ = NULL;
  5281 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in access variable(s) declaration."); yynerrs++;}
  6282 	 yynerrs++;
       
  6283 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in access variable(s) declaration.");
       
  6284 	}
       
  6285 | VAR_ACCESS error access_declaration_list END_VAR
  5282 | VAR_ACCESS error access_declaration_list END_VAR
  6286 	{$$ = NULL;
  5283 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_ACCESS' in access variable(s) declaration."); yyerrok;}
  6287 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_ACCESS' in access variable(s) declaration.");
  5284 | VAR_ACCESS access_declaration_list error END_VAR
  6288 	 yyerrok;
  5285 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed access variable(s) declaration."); yyerrok;}
  6289 	}
       
  6290 | VAR_ACCESS error END_VAR
  5286 | VAR_ACCESS error END_VAR
  6291 	{$$ = NULL;
  5287 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in access variable(s) declaration."); yyerrok;}
  6292 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in access variable(s) declaration.");
       
  6293 	 yyerrok;
       
  6294 	}
       
  6295 // ERROR_CHECK_END //
  5288 // ERROR_CHECK_END //
  6296 ;
  5289 ;
  6297 
  5290 
  6298 // helper symbol for access_declarations //
  5291 // helper symbol for access_declarations //
  6299 access_declaration_list:
  5292 access_declaration_list:
  6300   access_declaration ';'
  5293   access_declaration ';'
  6301 | access_declaration_list access_declaration ';'
  5294 | access_declaration_list access_declaration ';'
  6302 // ERROR_CHECK_BEGIN //
  5295 // ERROR_CHECK_BEGIN //
  6303 | error ';'
  5296 | error ';'
  6304   {$$ = // create a new list //;
  5297   {$$ = // create a new list //;
  6305 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid access variable declaration.");
  5298 	 print_err_msg(locf(@1), locl(@1), "invalid access variable declaration."); yyerrok;}
  6306 	 yyerrok;
       
  6307 	}
       
  6308 | access_declaration error
  5299 | access_declaration error
  6309   {$$ = // create a new list //;
  5300   {$$ = // create a new list //;
  6310 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at the end of access variable declaration.");
  5301 	 print_err_msg(locl(@1), locf(@2), "';' missing at the end of access variable declaration."); yyerrok;}
  6311 	 yyerrok;
       
  6312 	}
       
  6313 | access_declaration_list access_declaration error
  5302 | access_declaration_list access_declaration error
  6314   {$$ = $1;
  5303   {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of access variable declaration."); yyerrok;}
  6315 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at the end of access variable declaration.");
       
  6316 	 yyerrok;
       
  6317 	}
       
  6318 | access_declaration_list error ';'
  5304 | access_declaration_list error ';'
  6319   {$$ = $1;
  5305   {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid access variable declaration."); yyerrok;}
  6320 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid access variable declaration.");
       
  6321 	 yyerrok;
       
  6322 	}
       
  6323 | access_declaration_list ';'
  5306 | access_declaration_list ';'
  6324   {$$ = $1;
  5307   {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after access variable declaration."); yynerrs++;}
  6325 	 yynerrs++;
       
  6326 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after access variable declaration.");
       
  6327 	}
       
  6328 // ERROR_CHECK_END //
  5308 // ERROR_CHECK_END //
  6329 ;
  5309 ;
  6330 
  5310 
  6331 
  5311 
  6332 access_declaration:
  5312 access_declaration:
  6417 task_configuration:
  5397 task_configuration:
  6418   TASK task_name task_initialization
  5398   TASK task_name task_initialization
  6419 	{$$ = new task_configuration_c($2, $3, locloc(@$));}
  5399 	{$$ = new task_configuration_c($2, $3, locloc(@$));}
  6420 /* ERROR_CHECK_BEGIN */
  5400 /* ERROR_CHECK_BEGIN */
  6421 | TASK task_initialization
  5401 | TASK task_initialization
  6422   {$$ = NULL;
  5402   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no task name defined in task declaration."); yynerrs++;}
  6423 	 yynerrs++;
       
  6424 	 print_err_msg(current_filename, locl(@1), locf(@2), "no task name defined in task declaration.");
       
  6425 	}
       
  6426 | TASK error task_initialization
  5403 | TASK error task_initialization
  6427   {$$ = NULL;
  5404   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid task name defined in task declaration."); yyerrok;}
  6428 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid task name defined in task declaration.");
       
  6429 	 yyerrok;
       
  6430 	}
       
  6431 | TASK task_name error
  5405 | TASK task_name error
  6432   {$$ = NULL;
  5406   {$$ = NULL;
  6433 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid task initialization in task declaration.");
  5407 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no task initialization defined in task declaration.");}
       
  5408 	 else {print_err_msg(locf(@3), locl(@3), "invalid task initialization in task declaration."); yyclearin;}
  6434 	 yyerrok;
  5409 	 yyerrok;
  6435 	}
  5410 	}
  6436 /* ERROR_CHECK_END */
  5411 /* ERROR_CHECK_END */
  6437 ;
  5412 ;
  6438 
  5413 
  6459 	{$$ = NULL;}
  5434 	{$$ = NULL;}
  6460 | SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} 
  5435 | SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} 
  6461 	{$$ = $4;}
  5436 	{$$ = $4;}
  6462 /* ERROR_CHECK_BEGIN */
  5437 /* ERROR_CHECK_BEGIN */
  6463 | SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  5438 | SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  6464   {$$ = NULL;
  5439   {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'SINGLE' in task initialization."); yynerrs++;}
  6465 	 yynerrs++;
       
  6466 	 print_err_msg(current_filename, locl(@1), locf(@3), "':=' missing after 'SINGLE' in task initialization.");
       
  6467 	}
       
  6468 | SINGLE error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
       
  6469   {$$ = NULL;
       
  6470 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':=' after 'SINGLE' in task initialization.");
       
  6471 	 yyerrok;
       
  6472 	}
       
  6473 | SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
  5440 | SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
  6474   {$$ = NULL;
  5441   {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no data source defined in 'SINGLE' statement of task initialization."); yynerrs++;}
  6475 	 yynerrs++;
       
  6476 	 print_err_msg(current_filename, locl(@2), locf(@4), "no data source defined in 'SINGLE' statement of task initialization.");
       
  6477 	}
       
  6478 | SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
  5442 | SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
  6479   {$$ = NULL;
  5443   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid data source defined in 'SINGLE' statement of task initialization."); yyerrok;}
  6480 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid data source defined in 'SINGLE' statement of task initialization.");
       
  6481 	 yyerrok;
       
  6482 	}
       
  6483 /* ERROR_CHECK_END */
  5444 /* ERROR_CHECK_END */
  6484 ;
  5445 ;
  6485 
  5446 
  6486 
  5447 
  6487 task_initialization_interval:
  5448 task_initialization_interval:
  6490 	{$$ = NULL;}
  5451 	{$$ = NULL;}
  6491 | INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  5452 | INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  6492 	{$$ = $4;}
  5453 	{$$ = $4;}
  6493 /* ERROR_CHECK_BEGIN */
  5454 /* ERROR_CHECK_BEGIN */
  6494 | INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  5455 | INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
  6495   {$$ = NULL;
  5456   {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'INTERVAL' in task initialization.");}
  6496 	 yynerrs++;
       
  6497 	 print_err_msg(current_filename, locl(@1), locf(@3), "':=' missing after 'INTERVAL' in task initialization.");
       
  6498 	}
       
  6499 | INTERVAL error {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();}
       
  6500   {$$ = NULL;
       
  6501 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':=' after 'INTERVAL' in task initialization.");
       
  6502 	 yyerrok;
       
  6503 	}
       
  6504 | INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
  5457 | INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();}
  6505   {$$ = NULL;
  5458   {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no data source defined in 'INTERVAL' statement of task initialization."); yynerrs++;}
  6506 	 yynerrs++;
       
  6507 	 print_err_msg(current_filename, locl(@2), locf(@4), "no data source defined in 'INTERVAL' statement of task initialization.");
       
  6508 	}
       
  6509 | INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
  5459 | INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();}
  6510   {$$ = NULL;
  5460   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid data source defined in 'INTERVAL' statement of task initialization."); yyerrok;}
  6511 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid data source defined in 'INTERVAL' statement of task initialization.");
       
  6512 	 yyerrok;
       
  6513 	}
       
  6514 /* ERROR_CHECK_END */
  5461 /* ERROR_CHECK_END */
  6515 ;
  5462 ;
  6516 
  5463 
  6517 
  5464 
  6518 
  5465 
  6520 // PRIORITY ASSIGN integer
  5467 // PRIORITY ASSIGN integer
  6521   PRIORITY ASSIGN {cmd_pop_state();} integer 
  5468   PRIORITY ASSIGN {cmd_pop_state();} integer 
  6522 	{$$ = $4;}
  5469 	{$$ = $4;}
  6523 /* ERROR_CHECK_BEGIN */
  5470 /* ERROR_CHECK_BEGIN */
  6524 | PRIORITY {cmd_pop_state();} integer
  5471 | PRIORITY {cmd_pop_state();} integer
  6525   {$$ = NULL;
  5472   {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'PRIORITY' in task initialization."); yynerrs++;}
  6526 	 yynerrs++;
       
  6527 	 print_err_msg(current_filename, locl(@1), locf(@3), "':=' missing after 'PRIORITY' in task initialization.");
       
  6528 	}
       
  6529 | PRIORITY error {cmd_pop_state();} integer 
       
  6530   {$$ = NULL;
       
  6531 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':=' after 'PRIORITY' in task initialization.");
       
  6532 	 yyerrok;
       
  6533 	}
       
  6534 | PRIORITY ASSIGN {cmd_pop_state();} error
  5473 | PRIORITY ASSIGN {cmd_pop_state();} error
  6535   {$$ = NULL;
  5474   {$$ = NULL;
  6536 	 print_err_msg(current_filename, locl(@2), locf(@4), "no priority number defined in 'PRIORITY' statement of task initialization.");
  5475 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@4), "no priority number defined in 'PRIORITY' statement of task initialization.");}
       
  5476 	 else {print_err_msg(locf(@4), locl(@4), "invalid priority number in 'PRIORITY' statement of task initialization."); yyclearin;}
  6537 	 yyerrok;
  5477 	 yyerrok;
  6538 	}
  5478 	}
  6539 /* ERROR_CHECK_END */
  5479 /* ERROR_CHECK_END */
  6540 ;
  5480 ;
  6541 
  5481 
  6562 	{$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$));
  5502 	{$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$));
  6563 	 variable_name_symtable.insert($3, prev_declared_program_name_token);
  5503 	 variable_name_symtable.insert($3, prev_declared_program_name_token);
  6564 	}
  5504 	}
  6565 /* ERROR_CHECK_BEGIN */
  5505 /* ERROR_CHECK_BEGIN */
  6566 | PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements
  5506 | PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements
  6567   {$$ = NULL;
  5507   {$$ = NULL; print_err_msg(locf(@5), locl(@5), "invalid program type name after ':' in program configuration."); yynerrs++;}
  6568 	 yynerrs++;
       
  6569 	 print_err_msg(current_filename, locf(@5), locl(@5), "unknown program type name after ':' in program configuration.");
       
  6570 	}
       
  6571 | PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
  5508 | PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
  6572   {$$ = NULL;
  5509   {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid program type name after ':' in program configuration."); yynerrs++;}
  6573 	 yynerrs++;
       
  6574 	 print_err_msg(current_filename, locf(@6), locl(@6), "unknown program type name after ':' in program configuration.");
       
  6575 	}
       
  6576 | PROGRAM NON_RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
  5510 | PROGRAM NON_RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements
  6577   {$$ = NULL;
  5511   {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid program type name after ':' in program configuration."); yynerrs++;}
  6578 	 yynerrs++;
       
  6579 	 print_err_msg(current_filename, locf(@6), locl(@6), "unknown program type name after ':' in program configuration.");
       
  6580 	}
       
  6581 | PROGRAM error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5512 | PROGRAM error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6582   {$$ = NULL;
  5513   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'PROGRAM' in program configuration."); yyerrok;}
  6583 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'PROGRAM' in program configuration.");
       
  6584 	 yyerrok;
       
  6585 	}
       
  6586 | PROGRAM RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5514 | PROGRAM RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6587   {$$ = NULL;
  5515   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive program configuration."); yyerrok;}
  6588 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive program configuration.");
       
  6589 	 yyerrok;
       
  6590 	}
       
  6591 | PROGRAM NON_RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5516 | PROGRAM NON_RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6592   {$$ = NULL;
  5517   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive program configuration."); yyerrok;}
  6593 	 print_err_msg(current_filename, locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive program configuration.");
       
  6594 	 yyerrok;
       
  6595 	}
       
  6596 | PROGRAM optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5518 | PROGRAM optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6597   {$$ = NULL;
  5519   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no program name defined in program configuration."); yynerrs++;}
  6598 	 yynerrs++;
       
  6599 	 print_err_msg(current_filename, locl(@1), locf(@2), "no program name defined in program configuration.");
       
  6600 	}
       
  6601 | PROGRAM RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5520 | PROGRAM RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6602   {$$ = NULL;
  5521   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no program name defined in retentive program configuration."); yynerrs++;}
  6603 	 yynerrs++;
       
  6604 	 print_err_msg(current_filename, locl(@2), locf(@3), "no program name defined in retentive program configuration.");
       
  6605 	}
       
  6606 | PROGRAM NON_RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5522 | PROGRAM NON_RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6607   {$$ = NULL;
  5523   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no program name defined in non-retentive program configuration."); yynerrs++;}
  6608 	 yynerrs++;
       
  6609 	 print_err_msg(current_filename, locl(@2), locf(@3), "no program name defined in non-retentive program configuration.");
       
  6610 	}
       
  6611 | PROGRAM error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5524 | PROGRAM error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6612   {$$ = NULL;
  5525   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program name defined in program configuration."); yyerrok;}
  6613 	 print_err_msg(current_filename, locf(@2), locl(@2), "no program name defined in program configuration.");
       
  6614 	 yyerrok;
       
  6615 	}
       
  6616 | PROGRAM RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5526 | PROGRAM RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6617   {$$ = NULL;
  5527   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid program name defined in retentive program configuration."); yyerrok;}
  6618 	 print_err_msg(current_filename, locf(@3), locl(@3), "no program name defined in retentive program configuration.");
       
  6619 	 yyerrok;
       
  6620 	}
       
  6621 | PROGRAM NON_RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  5528 | PROGRAM NON_RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements
  6622   {$$ = NULL;
  5529   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid program name defined in non-retentive program configuration."); yyerrok;}
  6623 	 print_err_msg(current_filename, locf(@3), locl(@3), "no program name defined in non-retentive program configuration.");
       
  6624 	 yyerrok;
       
  6625 	}
       
  6626 | PROGRAM program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
  5530 | PROGRAM program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
  6627   {$$ = NULL;
  5531   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "':' missing after program name or optional task name in program configuration."); yynerrs++;}
  6628 	 yynerrs++;
       
  6629 	 print_err_msg(current_filename, locl(@3), locf(@4), "':' missing after program name or optional task name in program configuration.");
       
  6630 	}
       
  6631 | PROGRAM RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
  5532 | PROGRAM RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
  6632   {$$ = NULL;
  5533   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':' missing after program name or optional task name in retentive program configuration."); yynerrs++;}
  6633 	 yynerrs++;
       
  6634 	 print_err_msg(current_filename, locl(@4), locf(@5), "':' missing after program name or optional task name in program configuration.");
       
  6635 	}
       
  6636 | PROGRAM NON_RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
  5534 | PROGRAM NON_RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements
  6637   {$$ = NULL;
  5535   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':' missing after program name or optional task name in non-retentive program configuration."); yynerrs++;}
  6638 	 yynerrs++;
       
  6639 	 print_err_msg(current_filename, locl(@4), locf(@5), "':' missing after program name or optional task name in program configuration.");
       
  6640 	}
       
  6641 | PROGRAM program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements
       
  6642   {$$ = NULL;
       
  6643 	 print_err_msg(current_filename, locf(@4), locl(@4), "expecting ':' after program name or optional task name in program configuration.");
       
  6644 	 yyerrok;
       
  6645 	}
       
  6646 | PROGRAM RETAIN program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements
       
  6647   {$$ = NULL;
       
  6648 	 print_err_msg(current_filename, locf(@5), locl(@5), "expecting ':' after program name or optional task name in program configuration.");
       
  6649 	 yyerrok;
       
  6650 	}
       
  6651 | PROGRAM NON_RETAIN program_name optional_task_name error prev_declared_program_type_name optional_prog_conf_elements
       
  6652   {$$ = NULL;
       
  6653 	 print_err_msg(current_filename, locf(@5), locl(@5), "expecting ':' after program name or optional task name in program configuration.");
       
  6654 	 yyerrok;
       
  6655 	}
       
  6656 | PROGRAM program_name optional_task_name ':' optional_prog_conf_elements
  5536 | PROGRAM program_name optional_task_name ':' optional_prog_conf_elements
  6657   {$$ = NULL;
  5537   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no program type defined in program configuration."); yynerrs++;}
  6658 	 yynerrs++;
       
  6659 	 print_err_msg(current_filename, locl(@4), locf(@5), "no program type defined in program configuration.");
       
  6660 	}
       
  6661 | PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements
  5538 | PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements
  6662   {$$ = NULL;
  5539   {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no program type defined in retentive program configuration."); yynerrs++;}
  6663 	 yynerrs++;
       
  6664 	 print_err_msg(current_filename, locl(@5), locf(@6), "no program type defined in program configuration.");
       
  6665 	}
       
  6666 | PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements
  5540 | PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements
  6667   {$$ = NULL;
  5541   {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no program type defined in non-retentive program configuration."); yynerrs++;}
  6668 	 yynerrs++;
       
  6669 	 print_err_msg(current_filename, locl(@5), locf(@6), "no program type defined in program configuration.");
       
  6670   }
       
  6671 /* ERROR_CHECK_END */
  5542 /* ERROR_CHECK_END */
  6672 ;
  5543 ;
  6673 
  5544 
  6674 // helper symbol for program_configuration //
  5545 // helper symbol for program_configuration //
  6675 optional_task_name:
  5546 optional_task_name:
  6678 | WITH task_name
  5549 | WITH task_name
  6679 	{$$ = $2;}
  5550 	{$$ = $2;}
  6680 /* ERROR_CHECK_BEGIN */
  5551 /* ERROR_CHECK_BEGIN */
  6681 | WITH error
  5552 | WITH error
  6682   {$$ = NULL;
  5553   {$$ = NULL;
  6683 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid tack name in optional task name of program configuration.");
  5554 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no task name defined in optional task name of program configuration.");}
       
  5555 	 else {print_err_msg(locf(@2), locl(@2), "invalid task name in optional task name of program configuration."); yyclearin;}
  6684 	 yyerrok;
  5556 	 yyerrok;
  6685 	}
  5557 	}
  6686 /* ERROR_CHECK_END */
  5558 /* ERROR_CHECK_END */
  6687 ;
  5559 ;
  6688 
  5560 
  6692 	{$$ = NULL;}
  5564 	{$$ = NULL;}
  6693 | '(' prog_conf_elements ')'
  5565 | '(' prog_conf_elements ')'
  6694 	{$$ = $2;}
  5566 	{$$ = $2;}
  6695 /* ERROR_CHECK_BEGIN */
  5567 /* ERROR_CHECK_BEGIN */
  6696 | '(' error ')'
  5568 | '(' error ')'
  6697   {$$ = NULL;
  5569   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program configuration elements in program configuration."); yyerrok;}
  6698 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid program configuration elements in program configuration.");
       
  6699 	 yyerrok;
       
  6700 	}
       
  6701 | '(' prog_conf_elements error
  5570 | '(' prog_conf_elements error
  6702   {$$ = NULL;
  5571   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of program configuration elements in program configuration."); yyerrok;}
  6703 	 print_err_msg(current_filename, locl(@2), locf(@3), "')' missing at the end of program configuration elements in program configuration.");
       
  6704 	 yyerrok;
       
  6705 	}
       
  6706 /* ERROR_CHECK_END */
  5572 /* ERROR_CHECK_END */
  6707 ;
  5573 ;
  6708 
  5574 
  6709 
  5575 
  6710 prog_conf_elements:
  5576 prog_conf_elements:
  6712 	{$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);}
  5578 	{$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);}
  6713 | prog_conf_elements ',' prog_conf_element
  5579 | prog_conf_elements ',' prog_conf_element
  6714 	{$$ = $1; $$->add_element($3);}
  5580 	{$$ = $1; $$->add_element($3);}
  6715 /* ERROR_CHECK_BEGIN */
  5581 /* ERROR_CHECK_BEGIN */
  6716 | prog_conf_elements prog_conf_element
  5582 | prog_conf_elements prog_conf_element
  6717   {$$ = NULL;
  5583   {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in program configuration elements list."); yynerrs++;}
  6718 	 yynerrs++;
       
  6719 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in program configuration elements list.");
       
  6720 	}
       
  6721 | prog_conf_elements ',' error
  5584 | prog_conf_elements ',' error
  6722   {$$ = NULL;
  5585   {$$ = $1;
  6723 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value for program configuration element in program configuration list.");
  5586 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for program configuration element in program configuration list.");}
       
  5587 	 else {print_err_msg(locf(@3), locl(@3), "invalid value for program configuration element in program configuration list."); yyclearin;}
  6724 	 yyerrok;
  5588 	 yyerrok;
  6725 	}
  5589 	}
  6726 /* ERROR_CHECK_END */
  5590 /* ERROR_CHECK_END */
  6727 ;
  5591 ;
  6728 
  5592 
  6742   any_identifier WITH task_name
  5606   any_identifier WITH task_name
  6743 	{$$ = new fb_task_c($1, $3, locloc(@$));}
  5607 	{$$ = new fb_task_c($1, $3, locloc(@$));}
  6744 /* ERROR_CHECK_BEGIN */
  5608 /* ERROR_CHECK_BEGIN */
  6745 | any_identifier WITH error
  5609 | any_identifier WITH error
  6746   {$$ = NULL;
  5610   {$$ = NULL;
  6747 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid task name in function block configuration.");
  5611 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no task name defined in function block configuration.");}
       
  5612 	 else {print_err_msg(locf(@3), locl(@3), "invalid task name in function block configuration."); yyclearin;}
  6748 	 yyerrok;
  5613 	 yyerrok;
  6749 	}
  5614 	}
  6750 /* ERROR_CHECK_END */
  5615 /* ERROR_CHECK_END */
  6751 ;
  5616 ;
  6752 
  5617 
  6786 	{$$ = new prog_cnxn_assign_c($1, $3, locloc(@$));}
  5651 	{$$ = new prog_cnxn_assign_c($1, $3, locloc(@$));}
  6787 | any_symbolic_variable SENDTO data_sink
  5652 | any_symbolic_variable SENDTO data_sink
  6788 	{$$ = new prog_cnxn_sendto_c($1, $3, locloc(@$));}
  5653 	{$$ = new prog_cnxn_sendto_c($1, $3, locloc(@$));}
  6789 /* ERROR_CHECK_BEGIN */
  5654 /* ERROR_CHECK_BEGIN */
  6790 | any_symbolic_variable constant
  5655 | any_symbolic_variable constant
  6791   {$$ = NULL;
  5656   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element."); yynerrs++;}
  6792 	 yynerrs++;
       
  6793 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element.");
       
  6794 	}
       
  6795 | any_symbolic_variable enumerated_value
  5657 | any_symbolic_variable enumerated_value
  6796   {$$ = NULL;
  5658   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element."); yynerrs++;}
  6797 	 yynerrs++;
       
  6798 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element.");
       
  6799 	}
       
  6800 | any_symbolic_variable data_sink
  5659 | any_symbolic_variable data_sink
  6801   {$$ = NULL;
  5660   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' or '=>' missing between parameter and variable in program configuration element."); yynerrs++;}
  6802 	 yynerrs++;
       
  6803 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' or '=>' missing between parameter and variable in program configuration element.");
       
  6804 	}
       
  6805 | any_symbolic_variable error prog_data_source
       
  6806   {$$ = NULL;
       
  6807 	 print_err_msg(current_filename, locl(@1), locf(@2), "expecting ':=' or '=>' after parameter in program configuration element.");
       
  6808 	 yyerrok;
       
  6809 	}
       
  6810 | any_symbolic_variable ASSIGN error
  5661 | any_symbolic_variable ASSIGN error
  6811   {$$ = NULL;
  5662   {$$ = NULL;
  6812 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid value or variable in program configuration assignment element.");
  5663 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value or variable defined in program configuration assignment element.");}
       
  5664 	 else {print_err_msg(locf(@3), locl(@3), "invalid value or variable in program configuration assignment element."); yyclearin;}
  6813 	 yyerrok;
  5665 	 yyerrok;
  6814 	}
  5666 	}
  6815 | any_symbolic_variable SENDTO error
  5667 | any_symbolic_variable SENDTO error
  6816   {$$ = NULL;
  5668   {$$ = NULL;
  6817 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid variable in program configuration sendto element.");
  5669 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable defined in program configuration sendto element.");}
       
  5670 	 else {print_err_msg(locf(@3), locl(@3), "invalid variable in program configuration sendto element."); yyclearin;}
  6818 	 yyerrok;
  5671 	 yyerrok;
  6819 	}
  5672 	}
  6820 /* ERROR_CHECK_END */
  5673 /* ERROR_CHECK_END */
  6821 ;
  5674 ;
  6822 
  5675 
  6835 instance_specific_initializations:
  5688 instance_specific_initializations:
  6836  VAR_CONFIG instance_specific_init_list END_VAR
  5689  VAR_CONFIG instance_specific_init_list END_VAR
  6837 	{$$ = new instance_specific_initializations_c($2, locloc(@$));}
  5690 	{$$ = new instance_specific_initializations_c($2, locloc(@$));}
  6838 /* ERROR_CHECK_BEGIN */
  5691 /* ERROR_CHECK_BEGIN */
  6839 | VAR_CONFIG END_VAR
  5692 | VAR_CONFIG END_VAR
  6840 	{$$ = NULL;
  5693 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in configuration variable(s) initialization."); yynerrs++;}
  6841 	 yynerrs++;
       
  6842 	 print_err_msg(current_filename, locl(@1), locf(@2), "no variable declared in configuration variable(s) initialization.");
       
  6843 	}
       
  6844 | VAR_CONFIG error instance_specific_init_list END_VAR
  5694 | VAR_CONFIG error instance_specific_init_list END_VAR
  6845 	{$$ = NULL;
  5695 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_CONFIG' in configuration variable(s) initialization."); yyerrok;}
  6846 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected token after 'VAR_CONFIG' in configuration variable(s) initialization.");
  5696 | VAR_CONFIG instance_specific_init_list error END_OF_INPUT
  6847 	 yyerrok;
  5697 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed configuration variable(s) initialization."); yyerrok;}
  6848 	}
       
  6849 | VAR_CONFIG error END_VAR
  5698 | VAR_CONFIG error END_VAR
  6850 	{$$ = NULL;
  5699 	{$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in configuration variable(s) initialization."); yyerrok;}
  6851 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in configuration variable(s) initialization.");
       
  6852 	 yyerrok;
       
  6853 	}
       
  6854 /* ERROR_CHECK_END */
  5700 /* ERROR_CHECK_END */
  6855 ;
  5701 ;
  6856 
  5702 
  6857 // helper symbol for instance_specific_initializations //
  5703 // helper symbol for instance_specific_initializations //
  6858 instance_specific_init_list:
  5704 instance_specific_init_list:
  6860 	{$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);}
  5706 	{$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);}
  6861 | instance_specific_init_list instance_specific_init ';'
  5707 | instance_specific_init_list instance_specific_init ';'
  6862 	{$$ = $1; $$->add_element($2);}
  5708 	{$$ = $1; $$->add_element($2);}
  6863 /* ERROR_CHECK_BEGIN */
  5709 /* ERROR_CHECK_BEGIN */
  6864 | error ';'
  5710 | error ';'
  6865   {$$ = new instance_specific_init_list_c(locloc(@$));
  5711   {$$ = new instance_specific_init_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid configuration variable initialization."); yyerrok;}
  6866 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid configuration variable initialization.");
       
  6867 	 yyerrok;
       
  6868 	}
       
  6869 | instance_specific_init error
  5712 | instance_specific_init error
  6870   {$$ = new instance_specific_init_list_c(locloc(@$));
  5713   {$$ = new instance_specific_init_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of configuration variable initialization."); yyerrok;}
  6871 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at the end of configuration variable initialization.");
       
  6872 	 yyerrok;
       
  6873 	}
       
  6874 | instance_specific_init_list instance_specific_init error
  5714 | instance_specific_init_list instance_specific_init error
  6875   {$$ = $1;
  5715   {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of configuration variable initialization."); yyerrok;}
  6876 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at the end of configuration variable initialization.");
       
  6877 	 yyerrok;
       
  6878 	}
       
  6879 | instance_specific_init_list error ';'
  5716 | instance_specific_init_list error ';'
  6880   {$$ = $1;
  5717   {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid configuration variable initialization."); yyerrok;}
  6881 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid configuration variable initialization.");
       
  6882 	 yyerrok;
       
  6883 	}
       
  6884 | instance_specific_init_list ';'
  5718 | instance_specific_init_list ';'
  6885   {$$ = $1;
  5719   {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after configuration variable initialization."); yynerrs++;}
  6886 	 yynerrs++;
       
  6887 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after configuration variable initialization.");
       
  6888 	}
       
  6889 /* ERROR_CHECK_END */
  5720 /* ERROR_CHECK_END */
  6890 ;
  5721 ;
  6891 
  5722 
  6892 
  5723 
  6893 instance_specific_init:
  5724 instance_specific_init:
  6916 fb_initialization:
  5747 fb_initialization:
  6917   function_block_type_name ASSIGN structure_initialization
  5748   function_block_type_name ASSIGN structure_initialization
  6918 	{$$ = new fb_initialization_c($1, $3, locloc(@$));}
  5749 	{$$ = new fb_initialization_c($1, $3, locloc(@$));}
  6919 /* ERROR_CHECK_BEGIN */
  5750 /* ERROR_CHECK_BEGIN */
  6920 | function_block_type_name structure_initialization
  5751 | function_block_type_name structure_initialization
       
  5752   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between function block name and initialization in function block initialization."); yynerrs++;}
       
  5753 | function_block_type_name ASSIGN error
  6921   {$$ = NULL;
  5754   {$$ = NULL;
  6922 	 yynerrs++;
  5755 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in function block initialization.");}
  6923 	 print_err_msg(current_filename, locl(@1), locf(@2), "':=' missing between function block name and initialization in function block initialization.");
  5756 	 else {print_err_msg(locf(@3), locl(@3), "invalid initial value in function block initialization."); yyclearin;}
  6924 	}
       
  6925 | function_block_type_name error structure_initialization
       
  6926   {$$ = NULL;
       
  6927 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':=' after function block name in function block initialization.");
       
  6928 	 yyerrok;
  5757 	 yyerrok;
  6929 	}
  5758 	}
  6930 /* ERROR_CHECK_END */
  5759 /* ERROR_CHECK_END */
  6931 ;
  5760 ;
  6932 
  5761 
  6952 	{$$ = $1; $$->add_element($2);}
  5781 	{$$ = $1; $$->add_element($2);}
  6953 | instruction_list pragma
  5782 | instruction_list pragma
  6954 	{$$ = $1; $$->add_element($2);}
  5783 	{$$ = $1; $$->add_element($2);}
  6955 /* ERROR_CHECK_BEGIN */
  5784 /* ERROR_CHECK_BEGIN */
  6956 | instruction_list error
  5785 | instruction_list error
  6957   {$$ = $1;
  5786   {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid IL instruction."); yyerrok;}
  6958 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid IL instruction.");
       
  6959 	 yyerrok;
       
  6960 	}
       
  6961 /* ERROR_CHECK_END */
  5787 /* ERROR_CHECK_END */
  6962 ;
  5788 ;
  6963 
  5789 
  6964 
  5790 
  6965 
  5791 
  6968 	{$$ = new il_instruction_c(NULL, $1, locloc(@$));}
  5794 	{$$ = new il_instruction_c(NULL, $1, locloc(@$));}
  6969 | label ':' il_incomplete_instruction eol_list
  5795 | label ':' il_incomplete_instruction eol_list
  6970 	{$$ = new il_instruction_c($1, $3, locloc(@$));}
  5796 	{$$ = new il_instruction_c($1, $3, locloc(@$));}
  6971 /* ERROR_CHECK_BEGIN */
  5797 /* ERROR_CHECK_BEGIN */
  6972 | error eol_list
  5798 | error eol_list
  6973 	{$$ = NULL;
  5799 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid IL instruction."); yyerrok;}
  6974 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid IL instruction.");
       
  6975 	 yyerrok;
       
  6976 	}
       
  6977 | il_incomplete_instruction error
  5800 | il_incomplete_instruction error
  6978 	{$$ = NULL;
  5801 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of IL instruction."); yyerrok;}
  6979 	 print_err_msg(current_filename, locl(@1), locf(@2), "EOL missing at the end of IL instruction.");
       
  6980 	 yyerrok;
       
  6981 	}
       
  6982 | error ':' il_incomplete_instruction eol_list
  5802 | error ':' il_incomplete_instruction eol_list
  6983 	{$$ = NULL;
  5803 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid label in IL instruction."); yyerrok;}
  6984 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid label in IL instruction.");
       
  6985 	 yyerrok;
       
  6986 	}
       
  6987 | label il_incomplete_instruction eol_list
  5804 | label il_incomplete_instruction eol_list
  6988 	{$$ = NULL;
  5805 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after label in IL instruction."); yynerrs++;}
  6989 	 yynerrs++;
       
  6990 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing after label in IL instruction.");
       
  6991 	}
       
  6992 | label error il_incomplete_instruction eol_list
       
  6993 	{$$ = NULL;
       
  6994 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ':' after label in IL instruction.");
       
  6995 	 yyerrok;
       
  6996 	}
       
  6997 | label ':' error eol_list
  5806 | label ':' error eol_list
  6998 	{$$ = NULL;
  5807 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid IL instruction."); yyerrok;}
  6999 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid IL instruction.");
       
  7000 	 yyerrok;
       
  7001 	}
       
  7002 | label ':' il_incomplete_instruction error
  5808 | label ':' il_incomplete_instruction error
  7003 	{$$ = NULL;
  5809 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "EOL missing at the end of IL instruction."); yyerrok;}
  7004 	 print_err_msg(current_filename, locl(@3), locf(@4), "EOL missing at the end of IL instruction.");
       
  7005 	 yyerrok;
       
  7006 	}
       
  7007 /* ERROR_CHECK_END */
  5810 /* ERROR_CHECK_END */
  7008 ;
  5811 ;
  7009 
  5812 
  7010 
  5813 
  7011 /* helper symbol for il_instruction */
  5814 /* helper symbol for il_instruction */
  7120 	{$$ = new il_expression_c($1, $3, $5, locloc(@$));}
  5923 	{$$ = new il_expression_c($1, $3, $5, locloc(@$));}
  7121 | il_expr_operator_clash_eol_list simple_instr_list ')'
  5924 | il_expr_operator_clash_eol_list simple_instr_list ')'
  7122 	{$$ = new il_expression_c($1, NULL, $2, locloc(@$));}
  5925 	{$$ = new il_expression_c($1, NULL, $2, locloc(@$));}
  7123 /* ERROR_CHECK_BEGIN */
  5926 /* ERROR_CHECK_BEGIN */
  7124 | il_expr_operator_noclash '(' eol_list error
  5927 | il_expr_operator_noclash '(' eol_list error
  7125   {$$ = NULL;
  5928   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of IL expression."); yyerrok;}
  7126 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing at the end of IL expression.");
       
  7127 	 yyerrok;
       
  7128 	}
       
  7129 | il_expr_operator_noclash '(' il_operand eol_list error
  5929 | il_expr_operator_noclash '(' il_operand eol_list error
  7130   {$$ = NULL;
  5930   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;}
  7131 	 print_err_msg(current_filename, locl(@4), locf(@5), "')' missing at the end of IL expression.");
       
  7132 	 yyerrok;
       
  7133 	}
       
  7134 | il_expr_operator_noclash '(' eol_list simple_instr_list error
  5931 | il_expr_operator_noclash '(' eol_list simple_instr_list error
  7135   {$$ = NULL;
  5932   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;}
  7136 	 print_err_msg(current_filename, locl(@4), locf(@5), "')' missing at the end of IL expression.");
       
  7137 	 yyerrok;
       
  7138 	}
       
  7139 | il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error
  5933 | il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error
  7140   {$$ = NULL;
  5934   {$$ = NULL; print_err_msg(locl(@5), locf(@6), "')' missing at the end of IL expression."); yyerrok;}
  7141 	 print_err_msg(current_filename, locl(@5), locf(@6), "')' missing at the end of IL expression.");
       
  7142 	 yyerrok;
       
  7143 	}
       
  7144 | il_expr_operator_clash '(' il_operand eol_list error
  5935 | il_expr_operator_clash '(' il_operand eol_list error
  7145   {$$ = NULL;
  5936   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;}
  7146 	 print_err_msg(current_filename, locl(@4), locf(@5), "')' missing at the end of IL expression.");
       
  7147 	 yyerrok;
       
  7148 	}
       
  7149 | il_expr_operator_clash '(' il_operand eol_list simple_instr_list error
  5937 | il_expr_operator_clash '(' il_operand eol_list simple_instr_list error
  7150   {$$ = NULL;
  5938   {$$ = NULL; print_err_msg(locl(@5), locf(@6), "')' missing at the end of IL expression."); yyerrok;}
  7151 	 print_err_msg(current_filename, locl(@5), locf(@6), "')' missing at the end of IL expression.");
       
  7152 	 yyerrok;
       
  7153 	}
       
  7154 | il_expr_operator_clash_eol_list simple_instr_list error
  5939 | il_expr_operator_clash_eol_list simple_instr_list error
  7155   {$$ = NULL;
  5940   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of IL expression."); yyerrok;}
  7156 	 print_err_msg(current_filename, locl(@2), locf(@3), "')' missing at the end of IL expression.");
       
  7157 	 yyerrok;
       
  7158 	}
       
  7159 /* ERROR_CHECK_END */
  5941 /* ERROR_CHECK_END */
  7160 ;
  5942 ;
  7161 
  5943 
  7162 
  5944 
  7163 il_jump_operation:
  5945 il_jump_operation:
  7164   il_jump_operator label
  5946   il_jump_operator label
  7165 	{$$ = new il_jump_operation_c($1, $2, locloc(@$));}
  5947 	{$$ = new il_jump_operation_c($1, $2, locloc(@$));}
  7166 /* ERROR_CHECK_BEGIN */
  5948 /* ERROR_CHECK_BEGIN */
  7167 | il_jump_operator error
  5949 | il_jump_operator error
  7168   {$$ = NULL;
  5950   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid label defined in IL jump operation."); yyerrok;}
  7169 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid label defined in IL jump operation.");
       
  7170 	 yyerrok;
       
  7171 	}
       
  7172 /* ERROR_CHECK_END */
  5951 /* ERROR_CHECK_END */
  7173 ;
  5952 ;
  7174 
  5953 
  7175 
  5954 
  7176 il_fb_call:
  5955 il_fb_call:
  7186 | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
  5965 | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
  7187 	{$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));}
  5966 	{$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));}
  7188 /* ERROR_CHECK_BEGIN */
  5967 /* ERROR_CHECK_BEGIN */
  7189 | il_call_operator error
  5968 | il_call_operator error
  7190   {$$ = NULL;
  5969   {$$ = NULL;
  7191 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function block name defined in IL function block call.");
  5970 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call.");}
       
  5971 	 else {print_err_msg(locf(@2), locl(@2), "invalid function block name in IL function block call."); yyclearin;}
  7192 	 yyerrok;
  5972 	 yyerrok;
  7193 	}
  5973 	}
  7194 | il_call_operator '(' ')'
  5974 | il_call_operator '(' ')'
  7195   {$$ = NULL;
  5975   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;}
  7196 	 yynerrs++;
       
  7197 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function block name defined in IL function block call.");
       
  7198 	}
       
  7199 | il_call_operator '(' eol_list ')'
  5976 | il_call_operator '(' eol_list ')'
  7200   {$$ = NULL;
  5977   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;}
  7201 	 yynerrs++;
       
  7202 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function block name defined in IL function block call.");
       
  7203 	}
       
  7204 | il_call_operator '(' il_operand_list ')'
  5978 | il_call_operator '(' il_operand_list ')'
  7205   {$$ = NULL;
  5979   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;}
  7206 	 yynerrs++;
       
  7207 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function block name defined in IL function block call.");
       
  7208 	}
       
  7209 | il_call_operator '(' eol_list il_param_list ')'
  5980 | il_call_operator '(' eol_list il_param_list ')'
  7210   {$$ = NULL;
  5981   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;}
  7211 	 yynerrs++;
       
  7212 	 print_err_msg(current_filename, locl(@1), locf(@2), "no function block name defined in IL function block call.");
       
  7213 	}
       
  7214 | il_call_operator error '(' ')'
  5982 | il_call_operator error '(' ')'
  7215   {$$ = NULL;
  5983   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;}
  7216 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function block name defined in IL function block call.");
       
  7217 	 yyerrok;
       
  7218 	}
       
  7219 | il_call_operator error '(' eol_list ')'
  5984 | il_call_operator error '(' eol_list ')'
  7220   {$$ = NULL;
  5985   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;}
  7221 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function block name defined in IL function block call.");
       
  7222 	 yyerrok;
       
  7223 	}
       
  7224 | il_call_operator error '(' il_operand_list ')'
  5986 | il_call_operator error '(' il_operand_list ')'
  7225   {$$ = NULL;
  5987   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;}
  7226 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function block name defined in IL function block call.");
       
  7227 	 yyerrok;
       
  7228 	}
       
  7229 | il_call_operator error '(' eol_list il_param_list ')'
  5988 | il_call_operator error '(' eol_list il_param_list ')'
  7230   {$$ = NULL;
  5989   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;}
  7231 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid function block name defined in IL function block call.");
       
  7232 	 yyerrok;
       
  7233 	}
       
  7234 | il_call_operator prev_declared_fb_name ')'
  5990 | il_call_operator prev_declared_fb_name ')'
  7235   {$$ = NULL;
  5991   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call."); yynerrs++;}
  7236 	 yynerrs++;
       
  7237 	 print_err_msg(current_filename, locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call.");
       
  7238 	}
       
  7239 | il_call_operator prev_declared_fb_name il_operand_list ')'
  5992 | il_call_operator prev_declared_fb_name il_operand_list ')'
  7240   {$$ = NULL;
  5993   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call."); yynerrs++;}
  7241 	 yynerrs++;
       
  7242 	 print_err_msg(current_filename, locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call.");
       
  7243 	}
       
  7244 | il_call_operator prev_declared_fb_name '(' error
  5994 | il_call_operator prev_declared_fb_name '(' error
  7245   {$$ = NULL;
  5995   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of IL function block call."); yyerrok;}
  7246 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing at the end of IL function block call.");
       
  7247 	 yyerrok;
       
  7248 	}
       
  7249 | il_call_operator prev_declared_fb_name '(' eol_list error
  5996 | il_call_operator prev_declared_fb_name '(' eol_list error
  7250   {$$ = NULL;
  5997   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL function block call."); yyerrok;}
  7251 	 print_err_msg(current_filename, locl(@4), locf(@5), "')' missing at the end of IL function block call.");
       
  7252 	 yyerrok;
       
  7253 	}
       
  7254 | il_call_operator prev_declared_fb_name '(' il_operand_list error
  5998 | il_call_operator prev_declared_fb_name '(' il_operand_list error
  7255   {$$ = NULL;
  5999   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL function block call."); yyerrok;}
  7256 	 print_err_msg(current_filename, locl(@4), locf(@5), "')' missing at the end of IL function block call.");
       
  7257 	 yyerrok;
       
  7258 	}
       
  7259 /* ERROR_CHECK_END */
  6000 /* ERROR_CHECK_END */
  7260 ;
  6001 ;
  7261 
  6002 
  7262 
  6003 
  7263 /* NOTE: Please read note above the definition of function_name_without_clashes */
  6004 /* NOTE: Please read note above the definition of function_name_without_clashes */
  7323  */
  6064  */
  7324 | il_expr_operator_clash_eol_list il_param_list ')'
  6065 | il_expr_operator_clash_eol_list il_param_list ')'
  7325 	{$$ = new il_formal_funct_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));}
  6066 	{$$ = new il_formal_funct_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));}
  7326 /* ERROR_CHECK_BEGIN */
  6067 /* ERROR_CHECK_BEGIN */
  7327 | function_name_no_clashes '(' eol_list error ')'
  6068 | function_name_no_clashes '(' eol_list error ')'
  7328   {$$ = NULL;
  6069   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid parameter list defined in IL formal function call."); yyerrok;} 
  7329 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid parameter list defined in IL formal function call.");
       
  7330 	 yyerrok;
       
  7331 	} 
       
  7332 | function_name_simpleop_clashes '(' eol_list error ')'
  6070 | function_name_simpleop_clashes '(' eol_list error ')'
  7333   {$$ = NULL;
  6071   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid parameter list defined in IL formal function call."); yyerrok;} 
  7334 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid parameter list defined in IL formal function call.");
       
  7335 	 yyerrok;
       
  7336 	} 
       
  7337 | il_expr_operator_clash_eol_list error ')'
  6072 | il_expr_operator_clash_eol_list error ')'
  7338   {$$ = NULL;
  6073   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter list defined in IL formal function call."); yyerrok;} 
  7339 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter list defined in IL formal function call.");
       
  7340 	 yyerrok;
       
  7341 	} 
       
  7342 /* ERROR_CHECK_END */
  6074 /* ERROR_CHECK_END */
  7343 ;
  6075 ;
  7344 
  6076 
  7345 
  6077 
  7346 il_expr_operator_clash_eol_list:
  6078 il_expr_operator_clash_eol_list:
  7347   il_expr_operator_clash '(' eol_list
  6079   il_expr_operator_clash '(' eol_list
  7348 	{$$ = $1;}
  6080 	{$$ = $1;}
  7349 /* ERROR_CHECK_BEGIN */
  6081 /* ERROR_CHECK_BEGIN */
  7350 | il_expr_operator_clash '(' error
  6082 | il_expr_operator_clash '(' error
  7351   {$$ = NULL;
  6083   {$$ = $1; print_err_msg(locl(@2), locf(@3), "EOL missing after '(' in IL instruction."); yyerrok;}
  7352 	 print_err_msg(current_filename, locl(@2), locf(@3), "EOL missing after '(' in IL instruction.");
       
  7353 	 yyerrok;
       
  7354 	}
       
  7355 /* ERROR_CHECK_END */
  6084 /* ERROR_CHECK_END */
  7356 ;
  6085 ;
  7357 
  6086 
  7358 
  6087 
  7359 il_operand:
  6088 il_operand:
  7376 	{$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
  6105 	{$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);}
  7377 | il_operand_list2 ',' il_operand
  6106 | il_operand_list2 ',' il_operand
  7378 	{$$ = $1; $$->add_element($3);}
  6107 	{$$ = $1; $$->add_element($3);}
  7379 /* ERROR_CHECK_BEGIN */
  6108 /* ERROR_CHECK_BEGIN */
  7380 | il_operand_list2 il_operand
  6109 | il_operand_list2 il_operand
  7381   {$$ = NULL;
  6110   {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in IL operand list."); yynerrs++;}
  7382 	 yynerrs++;
  6111 | il_operand ',' error
  7383 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing in IL operand list.");
  6112   {$$ = new il_operand_list_c(locloc(@$));
  7384 	}
  6113 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no operand defined in IL operand list.");}
  7385 | il_formal_funct_call error il_operand
  6114 	 else {print_err_msg(locf(@3), locl(@3), "invalid operand name in IL operand list."); yyclearin;}
  7386   {$$ = NULL;
       
  7387 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ',' in IL operand list.");
       
  7388 	 yyerrok;
       
  7389 	}
       
  7390 | il_formal_funct_call ',' error
       
  7391   {$$ = NULL;
       
  7392 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid operand in IL operand list.");
       
  7393 	 yyerrok;
  6115 	 yyerrok;
  7394 	}
  6116 	}
  7395 /* ERROR_CHECK_END */
  6117 /* ERROR_CHECK_END */
  7396 ;
  6118 ;
  7397 
  6119 
  7408   il_simple_operation eol_list
  6130   il_simple_operation eol_list
  7409 | il_expression eol_list
  6131 | il_expression eol_list
  7410 | il_formal_funct_call eol_list
  6132 | il_formal_funct_call eol_list
  7411 /* ERROR_CHECK_BEGIN */
  6133 /* ERROR_CHECK_BEGIN */
  7412 | il_expression error
  6134 | il_expression error
  7413   {$$ = NULL;
  6135   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing after expression IL instruction."); yyerrok;}
  7414 	 print_err_msg(current_filename, locl(@1), locf(@2), "EOL missing after expression IL instruction.");
       
  7415 	 yyerrok;
       
  7416 	}
       
  7417 | il_formal_funct_call error
  6136 | il_formal_funct_call error
  7418   {$$ = NULL;
  6137   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing after formal function call IL instruction."); yyerrok;}
  7419 	 print_err_msg(current_filename, locl(@1), locf(@2), "EOL missing after formal function call IL instruction.");
       
  7420 	 yyerrok;
       
  7421 	}
       
  7422 /* ERROR_CHECK_END */
  6138 /* ERROR_CHECK_END */
  7423 ;
  6139 ;
  7424 
  6140 
  7425 
  6141 
  7426 /* NOTE: the correct definition of il_param_list is
  6142 /* NOTE: the correct definition of il_param_list is
  7442 	{$$ = $1; $$->add_element($2);}
  6158 	{$$ = $1; $$->add_element($2);}
  7443 | il_param_last_instruction
  6159 | il_param_last_instruction
  7444 	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
  6160 	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
  7445 /* ERROR_CHECK_BEGIN */
  6161 /* ERROR_CHECK_BEGIN */
  7446 | il_param_instruction_list error
  6162 | il_param_instruction_list error
  7447   {$$ = $1;
  6163   {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid parameter assignment in parameter assignment list."); yyerrok;}
  7448 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter assignment in parameter assignment list.");
       
  7449 	 yyerrok;
       
  7450 	}
       
  7451 | il_param_last_instruction il_param_last_instruction
  6164 | il_param_last_instruction il_param_last_instruction
  7452   {$$ = new il_param_list_c(locloc(@$));
  6165   {$$ = new il_param_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;}
  7453 	 yynerrs++;
       
  7454 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list.");
       
  7455 	}
       
  7456 | il_param_instruction_list il_param_last_instruction il_param_last_instruction
  6166 | il_param_instruction_list il_param_last_instruction il_param_last_instruction
  7457   {$$ = $1;
  6167   {$$ = $1; print_err_msg(locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;}
  7458 	 yynerrs++;
       
  7459 	 print_err_msg(current_filename, locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list.");
       
  7460 	}
       
  7461 /* ERROR_CHECK_END */
  6168 /* ERROR_CHECK_END */
  7462 ;
  6169 ;
  7463 
  6170 
  7464 
  6171 
  7465 /* Helper symbol for il_param_list */
  6172 /* Helper symbol for il_param_list */
  7468 	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
  6175 	{$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);}
  7469 | il_param_instruction_list il_param_instruction
  6176 | il_param_instruction_list il_param_instruction
  7470 	{$$ = $1; $$->add_element($2);}
  6177 	{$$ = $1; $$->add_element($2);}
  7471 /* ERROR_CHECK_BEGIN */
  6178 /* ERROR_CHECK_BEGIN */
  7472 | il_param_last_instruction il_param_instruction
  6179 | il_param_last_instruction il_param_instruction
  7473   {$$ = new il_param_list_c(locloc(@$));
  6180   {$$ = new il_param_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;}
  7474 	 yynerrs++;
       
  7475 	 print_err_msg(current_filename, locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list.");
       
  7476 	}
       
  7477 | il_param_instruction_list il_param_last_instruction il_param_instruction
  6181 | il_param_instruction_list il_param_last_instruction il_param_instruction
  7478   {$$ = $1;
  6182   {$$ = $1; print_err_msg(locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;}
  7479 	 yynerrs++;
       
  7480 	 print_err_msg(current_filename, locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list.");
       
  7481 	}
       
  7482 /* ERROR_CHECK_END */
  6183 /* ERROR_CHECK_END */
  7483 ;
  6184 ;
  7484 
  6185 
  7485 
  6186 
  7486 il_param_instruction:
  6187 il_param_instruction:
  7487   il_param_assignment ',' eol_list
  6188   il_param_assignment ',' eol_list
  7488 | il_param_out_assignment ',' eol_list
  6189 | il_param_out_assignment ',' eol_list
  7489 /* ERROR_CHECK_BEGIN */
  6190 /* ERROR_CHECK_BEGIN */
  7490 | il_param_assignment ',' error
  6191 | il_param_assignment ',' error
  7491   {$$ = NULL;
  6192   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "EOL missing at the end of parameter assignment in parameter assignment list."); yyerrok;}
  7492 	 print_err_msg(current_filename, locl(@2), locf(@3), "EOL missing at the end of parameter assignment in parameter assignment list.");
       
  7493 	 yyerrok;
       
  7494 	}
       
  7495 | il_param_out_assignment ',' error
  6193 | il_param_out_assignment ',' error
  7496   {$$ = NULL;
  6194   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "EOL missing at the end of parameter out assignment in parameter assignment list."); yyerrok;}
  7497 	 print_err_msg(current_filename, locl(@2), locf(@3), "EOL missing at the end of parameter out assignment in parameter assignment list.");
       
  7498 	 yyerrok;
       
  7499 	}
       
  7500 /* ERROR_CHECK_END */
  6195 /* ERROR_CHECK_END */
  7501 ;
  6196 ;
  7502 
  6197 
  7503 
  6198 
  7504 il_param_last_instruction:
  6199 il_param_last_instruction:
  7505   il_param_assignment eol_list
  6200   il_param_assignment eol_list
  7506 | il_param_out_assignment eol_list
  6201 | il_param_out_assignment eol_list
  7507 /* ERROR_CHECK_BEGIN */
  6202 /* ERROR_CHECK_BEGIN */
  7508 | il_param_assignment error
  6203 | il_param_assignment error
  7509   {$$ = NULL;
  6204   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of last parameter assignment in parameter assignment list."); yyerrok;}
  7510 	 print_err_msg(current_filename, locl(@1), locf(@2), "EOL missing at the end of last parameter assignment in parameter assignment list.");
       
  7511 	 yyerrok;
       
  7512 	}
       
  7513 | il_param_out_assignment error
  6205 | il_param_out_assignment error
  7514   {$$ = NULL;
  6206   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of last parameter out assignment in parameter assignment list."); yyerrok;}
  7515 	 print_err_msg(current_filename, locl(@1), locf(@2), "EOL missing at the end of last parameter out assignment in parameter assignment list.");
       
  7516 	 yyerrok;
       
  7517 	}
       
  7518 /* ERROR_CHECK_END */
  6207 /* ERROR_CHECK_END */
  7519 
  6208 
  7520 ;
  6209 ;
  7521 
  6210 
  7522 
  6211 
  7525 	{$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));}
  6214 	{$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));}
  7526 | il_assign_operator '(' eol_list simple_instr_list ')'
  6215 | il_assign_operator '(' eol_list simple_instr_list ')'
  7527 	{$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));}
  6216 	{$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));}
  7528 /* ERROR_CHECK_BEGIN */
  6217 /* ERROR_CHECK_BEGIN */
  7529 | error il_operand
  6218 | error il_operand
  7530   {$$ = NULL;
  6219   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid operator in parameter assignment."); yyerrok;}
  7531 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid operator in parameter assignment.");
       
  7532 	 yyerrok;
       
  7533 	}
       
  7534 | error '(' eol_list simple_instr_list ')'
  6220 | error '(' eol_list simple_instr_list ')'
  7535   {$$ = NULL;
  6221   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid operator in parameter assignment."); yyerrok;}
  7536 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid operator in parameter assignment.");
       
  7537 	 yyerrok;
       
  7538 	}
       
  7539 | il_assign_operator error
  6222 | il_assign_operator error
  7540   {$$ = NULL;
  6223   {$$ = NULL;
  7541 	 print_err_msg(current_filename, locl(@1), locf(@2), "invalid operand defined in parameter assignment.");
  6224 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no operand defined in parameter assignment.");}
       
  6225 	 else {print_err_msg(locf(@2), locl(@2), "invalid operand in parameter assignment."); yyclearin;}
  7542 	 yyerrok;
  6226 	 yyerrok;
  7543 	}
  6227 	}
  7544 | il_assign_operator '(' eol_list ')'
  6228 | il_assign_operator '(' eol_list ')'
  7545   {$$ = NULL;
  6229   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no instruction list defined in parameter assignment."); yynerrs++;}
  7546 	 yynerrs++;
       
  7547 	 print_err_msg(current_filename, locl(@3), locf(@4), "no instruction list defined in parameter assignment.");
       
  7548 	}
       
  7549 | il_assign_operator '(' eol_list error ')'
  6230 | il_assign_operator '(' eol_list error ')'
  7550   {$$ = NULL;
  6231   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid instruction list defined in parameter assignment."); yyerrok;}
  7551 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid instruction list defined in parameter assignment.");
       
  7552 	 yyerrok;
       
  7553 	}
       
  7554 | il_assign_operator '(' eol_list simple_instr_list error
  6232 | il_assign_operator '(' eol_list simple_instr_list error
  7555   {$$ = NULL;
  6233   {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of instruction list defined in parameter assignment."); yyerrok;}
  7556 	 print_err_msg(current_filename, locl(@4), locf(@5), "')' missing at the end of instruction list defined in parameter assignment.");
       
  7557 	 yyerrok;
       
  7558 	}
       
  7559 /* ERROR_CHECK_END */
  6234 /* ERROR_CHECK_END */
  7560 ;
  6235 ;
  7561 
  6236 
  7562 
  6237 
  7563 il_param_out_assignment:
  6238 il_param_out_assignment:
  7564   il_assign_out_operator variable
  6239   il_assign_out_operator variable
  7565 	{$$ = new il_param_out_assignment_c($1, $2, locloc(@$));}
  6240 	{$$ = new il_param_out_assignment_c($1, $2, locloc(@$));}
  7566 /* ERROR_CHECK_BEGIN */
  6241 /* ERROR_CHECK_BEGIN */
  7567 | il_assign_out_operator error
  6242 | il_assign_out_operator error
  7568   {$$ = NULL;
  6243   {$$ = NULL;
  7569 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid variable defined in parameter out assignment.");
  6244 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no variable defined in IL operand list.");}
       
  6245 	 else {print_err_msg(locf(@2), locl(@2), "invalid variable in IL operand list."); yyclearin;}
  7570 	 yyerrok;
  6246 	 yyerrok;
  7571 	}
  6247 	}
  7572 /* ERROR_CHECK_END */
  6248 /* ERROR_CHECK_END */
  7573 ;
  6249 ;
  7574 
  6250 
  7710 il_assign_operator:
  6386 il_assign_operator:
  7711 /*  variable_name ASSIGN */
  6387 /*  variable_name ASSIGN */
  7712   any_identifier ASSIGN
  6388   any_identifier ASSIGN
  7713 /* ERROR_CHECK_BEGIN */
  6389 /* ERROR_CHECK_BEGIN */
  7714 | error ASSIGN
  6390 | error ASSIGN
  7715   {$$ = NULL;
  6391   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid parameter defined in parameter assignment."); yyerrok;}
  7716 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid parameter defined in parameter assignment.");
       
  7717 	 yyerrok;
       
  7718 	}
       
  7719 /* ERROR_CHECK_END */
  6392 /* ERROR_CHECK_END */
  7720 ;
  6393 ;
  7721 
  6394 
  7722 
  6395 
  7723 il_assign_out_operator:
  6396 il_assign_out_operator:
  7728 /*| NOT variable_name SENDTO */
  6401 /*| NOT variable_name SENDTO */
  7729 | NOT sendto_identifier SENDTO
  6402 | NOT sendto_identifier SENDTO
  7730 	{$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));}
  6403 	{$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));}
  7731 /* ERROR_CHECK_BEGIN */
  6404 /* ERROR_CHECK_BEGIN */
  7732 | error SENDTO
  6405 | error SENDTO
  7733   {$$ = NULL;
  6406   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid parameter defined in parameter out assignment."); yyerrok;}
  7734 	 print_err_msg(current_filename, locf(@1), locl(@1), "invalid parameter defined in parameter out assignment.");
       
  7735 	 yyerrok;
       
  7736 	}
       
  7737 | NOT SENDTO
  6407 | NOT SENDTO
  7738   {$$ = NULL;
  6408   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no parameter defined in parameter out assignment."); yynerrs++;}
  7739 	 yynerrs++;
       
  7740 	 print_err_msg(current_filename, locl(@1), locf(@2), "no parameter defined in parameter out assignment.");
       
  7741 	}
       
  7742 | NOT error SENDTO
  6409 | NOT error SENDTO
  7743   {$$ = NULL;
  6410   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter defined in parameter out assignment."); yyerrok;}
  7744 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter defined in parameter out assignment.");
       
  7745 	 yyerrok;
       
  7746 	}
       
  7747 /* ERROR_CHECK_END */
  6411 /* ERROR_CHECK_END */
  7748 ;
  6412 ;
  7749 
  6413 
  7750 
  6414 
  7751 il_call_operator:
  6415 il_call_operator:
  7777 | expression OR xor_expression
  6441 | expression OR xor_expression
  7778 	{$$ = new or_expression_c($1, $3, locloc(@$));}
  6442 	{$$ = new or_expression_c($1, $3, locloc(@$));}
  7779 /* ERROR_CHECK_BEGIN */
  6443 /* ERROR_CHECK_BEGIN */
  7780 | expression OR error
  6444 | expression OR error
  7781   {$$ = NULL;
  6445   {$$ = NULL;
  7782 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after 'OR' in ST expression.");
  6446 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'OR' in ST expression.");}
       
  6447 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'OR' in ST expression."); yyclearin;}
  7783 	 yyerrok;
  6448 	 yyerrok;
  7784 	}
  6449 	}
  7785 /* ERROR_CHECK_END */
  6450 /* ERROR_CHECK_END */
  7786 ;
  6451 ;
  7787 
  6452 
  7790 | xor_expression XOR and_expression
  6455 | xor_expression XOR and_expression
  7791 	{$$ = new xor_expression_c($1, $3, locloc(@$));}
  6456 	{$$ = new xor_expression_c($1, $3, locloc(@$));}
  7792 /* ERROR_CHECK_BEGIN */
  6457 /* ERROR_CHECK_BEGIN */
  7793 | xor_expression XOR error
  6458 | xor_expression XOR error
  7794   {$$ = NULL;
  6459   {$$ = NULL;
  7795 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after 'XOR' in ST expression.");
  6460 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'XOR' in ST expression.");}
       
  6461 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'XOR' in ST expression."); yyclearin;}
  7796 	 yyerrok;
  6462 	 yyerrok;
  7797 	}
  6463 	}
  7798 /* ERROR_CHECK_END */
  6464 /* ERROR_CHECK_END */
  7799 ;
  6465 ;
  7800 
  6466 
  7807 /* NOTE: The lexical parser never returns the token '&'.
  6473 /* NOTE: The lexical parser never returns the token '&'.
  7808  *       The '&' string is interpreted by the lexcial parser as the token
  6474  *       The '&' string is interpreted by the lexcial parser as the token
  7809  *       AND2!
  6475  *       AND2!
  7810  *       This means that the first rule with '&' is actually not required,
  6476  *       This means that the first rule with '&' is actually not required,
  7811  *       but we leave it in nevertheless just in case we later decide
  6477  *       but we leave it in nevertheless just in case we later decide
  7812  *       to remove theh AND2 token...
  6478  *       to remove the AND2 token...
  7813  */
  6479  */
  7814 | and_expression AND2 comparison
  6480 | and_expression AND2 comparison
  7815 	{$$ = new and_expression_c($1, $3, locloc(@$));}
  6481 	{$$ = new and_expression_c($1, $3, locloc(@$));}
  7816 /* ERROR_CHECK_BEGIN */
  6482 /* ERROR_CHECK_BEGIN */
  7817 | and_expression '&' error
  6483 | and_expression '&' error
  7818   {$$ = NULL;
  6484   {$$ = NULL;
  7819 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '&' in ST expression.");
  6485 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '&' in ST expression.");}
       
  6486 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '&' in ST expression."); yyclearin;}
  7820 	 yyerrok;
  6487 	 yyerrok;
  7821 	}
  6488 	}
  7822 | and_expression AND error
  6489 | and_expression AND error
  7823   {$$ = NULL;
  6490   {$$ = NULL;
  7824 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after 'AND' in ST expression.");
  6491 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'AND' in ST expression.");}
       
  6492 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'AND' in ST expression."); yyclearin;}
  7825 	 yyerrok;
  6493 	 yyerrok;
  7826 	}
  6494 	}
  7827 | and_expression AND2 error
  6495 | and_expression AND2 error
  7828   {$$ = NULL;
  6496   {$$ = NULL;
  7829 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '&' in ST expression.");
  6497 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '&' in ST expression.");}
       
  6498 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '&' in ST expression."); yyclearin;}
  7830 	 yyerrok;
  6499 	 yyerrok;
  7831 	}
  6500 	}
  7832 /* ERROR_CHECK_END */
  6501 /* ERROR_CHECK_END */
  7833 ;
  6502 ;
  7834 
  6503 
  7839 | comparison OPER_NE equ_expression
  6508 | comparison OPER_NE equ_expression
  7840 	{$$ = new notequ_expression_c($1, $3, locloc(@$));}
  6509 	{$$ = new notequ_expression_c($1, $3, locloc(@$));}
  7841 /* ERROR_CHECK_BEGIN */
  6510 /* ERROR_CHECK_BEGIN */
  7842 | comparison '=' error
  6511 | comparison '=' error
  7843   {$$ = NULL;
  6512   {$$ = NULL;
  7844 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '=' in ST expression.");
  6513 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '=' in ST expression.");}
       
  6514 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '=' in ST expression."); yyclearin;}
  7845 	 yyerrok;
  6515 	 yyerrok;
  7846 	}
  6516 	}
  7847 | comparison OPER_NE error
  6517 | comparison OPER_NE error
  7848   {$$ = NULL;
  6518   {$$ = NULL;
  7849 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '<>' in ST expression.");
  6519 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<>' in ST expression.");}
       
  6520 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<>' in ST expression."); yyclearin;}
  7850 	 yyerrok;
  6521 	 yyerrok;
  7851 	}
  6522 	}
  7852 /* ERROR_CHECK_END */
  6523 /* ERROR_CHECK_END */
  7853 ;
  6524 ;
  7854 
  6525 
  7863 | equ_expression OPER_GE add_expression
  6534 | equ_expression OPER_GE add_expression
  7864 	{$$ = new ge_expression_c($1, $3, locloc(@$));}
  6535 	{$$ = new ge_expression_c($1, $3, locloc(@$));}
  7865 /* ERROR_CHECK_BEGIN */
  6536 /* ERROR_CHECK_BEGIN */
  7866 | equ_expression '<' error
  6537 | equ_expression '<' error
  7867   {$$ = NULL;
  6538   {$$ = NULL;
  7868 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '<' in ST expression.");
  6539 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<' in ST expression.");}
       
  6540 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<' in ST expression."); yyclearin;}
  7869 	 yyerrok;
  6541 	 yyerrok;
  7870 	}
  6542 	}
  7871 | equ_expression '>' error
  6543 | equ_expression '>' error
  7872   {$$ = NULL;
  6544   {$$ = NULL;
  7873 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '>' in ST expression.");
  6545 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '>' in ST expression.");}
       
  6546 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '>' in ST expression."); yyclearin;}
  7874 	 yyerrok;
  6547 	 yyerrok;
  7875 	}
  6548 	}
  7876 | equ_expression OPER_LE error
  6549 | equ_expression OPER_LE error
  7877   {$$ = NULL;
  6550   {$$ = NULL;
  7878 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '<=' in ST expression.");
  6551 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<=' in ST expression.");}
       
  6552 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<=' in ST expression."); yyclearin;}
  7879 	 yyerrok;
  6553 	 yyerrok;
  7880 	}
  6554 	}
  7881 | equ_expression OPER_GE error
  6555 | equ_expression OPER_GE error
  7882   {$$ = NULL;
  6556   {$$ = NULL;
  7883 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '>=' in ST expression.");
  6557 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '>=' in ST expression.");}
       
  6558 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '>=' in ST expression."); yyclearin;}
  7884 	 yyerrok;
  6559 	 yyerrok;
  7885 	}
  6560 	}
  7886 /* ERROR_CHECK_END */
  6561 /* ERROR_CHECK_END */
  7887 ;
  6562 ;
  7888 
  6563 
  7897 | add_expression '-' term
  6572 | add_expression '-' term
  7898 	{$$ = new sub_expression_c($1, $3, locloc(@$));}
  6573 	{$$ = new sub_expression_c($1, $3, locloc(@$));}
  7899 /* ERROR_CHECK_BEGIN */
  6574 /* ERROR_CHECK_BEGIN */
  7900 | add_expression '+' error
  6575 | add_expression '+' error
  7901   {$$ = NULL;
  6576   {$$ = NULL;
  7902 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '+' in ST expression.");
  6577 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '+' in ST expression.");}
       
  6578 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '+' in ST expression."); yyclearin;}
  7903 	 yyerrok;
  6579 	 yyerrok;
  7904 	}
  6580 	}
  7905 | add_expression '-' error
  6581 | add_expression '-' error
  7906   {$$ = NULL;
  6582   {$$ = NULL;
  7907 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '-' in ST expression.");
  6583 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '-' in ST expression.");}
       
  6584 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '-' in ST expression."); yyclearin;}
  7908 	 yyerrok;
  6585 	 yyerrok;
  7909 	}
  6586 	}
  7910 /* ERROR_CHECK_END */
  6587 /* ERROR_CHECK_END */
  7911 ;
  6588 ;
  7912 
  6589 
  7923 | term MOD power_expression
  6600 | term MOD power_expression
  7924 	{$$ = new mod_expression_c($1, $3, locloc(@$));}
  6601 	{$$ = new mod_expression_c($1, $3, locloc(@$));}
  7925 /* ERROR_CHECK_BEGIN */
  6602 /* ERROR_CHECK_BEGIN */
  7926 | term '*' error
  6603 | term '*' error
  7927   {$$ = NULL;
  6604   {$$ = NULL;
  7928 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '*' in ST expression.");
  6605 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '*' in ST expression.");}
       
  6606 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '*' in ST expression."); yyclearin;}
  7929 	 yyerrok;
  6607 	 yyerrok;
  7930 	}
  6608 	}
  7931 | term '/' error
  6609 | term '/' error
  7932   {$$ = NULL;
  6610   {$$ = NULL;
  7933 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '/' in ST expression.");
  6611 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '/' in ST expression.");}
       
  6612 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '/' in ST expression."); yyclearin;}
  7934 	 yyerrok;
  6613 	 yyerrok;
  7935 	}
  6614 	}
  7936 | term MOD error
  6615 | term MOD error
  7937   {$$ = NULL;
  6616   {$$ = NULL;
  7938 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after 'MOD' in ST expression.");
  6617 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'MOD' in ST expression.");}
       
  6618 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'MOD' in ST expression."); yyclearin;}
  7939 	 yyerrok;
  6619 	 yyerrok;
  7940 	}
  6620 	}
  7941 /* ERROR_CHECK_END */
  6621 /* ERROR_CHECK_END */
  7942 ;
  6622 ;
  7943 
  6623 
  7950 | power_expression OPER_EXP unary_expression
  6630 | power_expression OPER_EXP unary_expression
  7951 	{$$ = new power_expression_c($1, $3, locloc(@$));}
  6631 	{$$ = new power_expression_c($1, $3, locloc(@$));}
  7952 /* ERROR_CHECK_BEGIN */
  6632 /* ERROR_CHECK_BEGIN */
  7953 | power_expression OPER_EXP error
  6633 | power_expression OPER_EXP error
  7954   {$$ = NULL;
  6634   {$$ = NULL;
  7955 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after '**' in ST expression.");
  6635 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '**' in ST expression.");}
       
  6636 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after '**' in ST expression."); yyclearin;}
  7956 	 yyerrok;
  6637 	 yyerrok;
  7957 	}
  6638 	}
  7958 /* ERROR_CHECK_END */
  6639 /* ERROR_CHECK_END */
  7959 ;
  6640 ;
  7960 
  6641 
  7966 | NOT primary_expression
  6647 | NOT primary_expression
  7967 	{$$ = new not_expression_c($2, locloc(@$));}
  6648 	{$$ = new not_expression_c($2, locloc(@$));}
  7968 /* ERROR_CHECK_BEGIN */
  6649 /* ERROR_CHECK_BEGIN */
  7969 | '-' error
  6650 | '-' error
  7970   {$$ = NULL;
  6651   {$$ = NULL;
  7971 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after '-' in ST expression.");
  6652 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no expression defined after '-' in ST expression.");}
       
  6653 	 else {print_err_msg(locf(@2), locl(@2), "invalid expression after '-' in ST expression."); yyclearin;}
  7972 	 yyerrok;
  6654 	 yyerrok;
  7973 	}
  6655 	}
  7974 | NOT error
  6656 | NOT error
  7975   {$$ = NULL;
  6657   {$$ = NULL;
  7976 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid expression after 'NOT' in ST expression.");
  6658 	 if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no expression defined after 'NOT' in ST expression.");}
       
  6659 	 else {print_err_msg(locf(@2), locl(@2), "invalid expression after 'NOT' in ST expression."); yyclearin;}
  7977 	 yyerrok;
  6660 	 yyerrok;
  7978 	}
  6661 	}
  7979 /* ERROR_CHECK_END */
  6662 /* ERROR_CHECK_END */
  7980 ;
  6663 ;
  7981 
  6664 
  8016 | '(' expression ')'
  6699 | '(' expression ')'
  8017 	{$$ = $2;}
  6700 	{$$ = $2;}
  8018 |  function_invocation
  6701 |  function_invocation
  8019 /* ERROR_CHECK_BEGIN */
  6702 /* ERROR_CHECK_BEGIN */
  8020 | '(' expression error
  6703 | '(' expression error
  8021   {$$ = NULL;
  6704   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of expression in ST expression."); yyerrok;}
  8022 	 print_err_msg(current_filename, locl(@2), locf(@3), "')' missing at the end of expression in ST expression.");
       
  8023 	 yyerrok;
       
  8024 	}
       
  8025 /* ERROR_CHECK_END */
  6705 /* ERROR_CHECK_END */
  8026 ;
  6706 ;
  8027 
  6707 
  8028 
  6708 
  8029 /* intermediate helper symbol for primary_expression */
  6709 /* intermediate helper symbol for primary_expression */
  8058 	{$$ = new function_invocation_c($1, $3, locloc(@$));}
  6738 	{$$ = new function_invocation_c($1, $3, locloc(@$));}
  8059 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')'
  6739 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')'
  8060 	{$$ = new function_invocation_c($1, $3, locloc(@$));}
  6740 	{$$ = new function_invocation_c($1, $3, locloc(@$));}
  8061 /* ERROR_CHECK_BEGIN */ 
  6741 /* ERROR_CHECK_BEGIN */ 
  8062 | function_name_no_NOT_clashes param_assignment_formal_list ')'
  6742 | function_name_no_NOT_clashes param_assignment_formal_list ')'
  8063   {$$ = NULL;
  6743   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function name in ST expression."); yynerrs++;}
  8064 	 yynerrs++;
       
  8065 	 print_err_msg(current_filename, locl(@1), locf(@2), "'(' missing after function name in ST expression.");
       
  8066 	}
       
  8067 | function_name_no_NOT_clashes error param_assignment_formal_list ')'
       
  8068   {$$ = NULL;
       
  8069 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '(' after function name in ST expression.");
       
  8070 	 yyerrok;
       
  8071 	}
       
  8072 | function_name_no_NOT_clashes error param_assignment_nonformal_list ')'
       
  8073   {$$ = NULL;
       
  8074 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '(' after function name in ST expression.");
       
  8075 	 yyerrok;
       
  8076 	}
       
  8077 | function_name_no_NOT_clashes '(' ')'
  6744 | function_name_no_NOT_clashes '(' ')'
  8078   {$$ = NULL;
  6745   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no parameter defined in function invocation of ST expression."); yynerrs++;}
  8079 	 yynerrs++;
       
  8080 	 print_err_msg(current_filename, locl(@2), locf(@3), "no parameter defined in function invocation of ST expression.");
       
  8081 	}
       
  8082 | function_name_no_NOT_clashes '(' error ')'
  6746 | function_name_no_NOT_clashes '(' error ')'
  8083   {$$ = NULL;
  6747   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid parameter(s) defined in function invocation of ST expression."); yyerrok;}
  8084 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid parameter(s) defined in function invocation of ST expression.");
       
  8085 	 yyerrok;
       
  8086 	}
       
  8087 | function_name_no_NOT_clashes '(' param_assignment_formal_list error
  6748 | function_name_no_NOT_clashes '(' param_assignment_formal_list error
  8088   {$$ = NULL;
  6749   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression."); yyerrok;}
  8089 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression.");
       
  8090 	 yyerrok;
       
  8091 	}
       
  8092 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list error
  6750 | function_name_no_NOT_clashes '(' param_assignment_nonformal_list error
  8093   {$$ = NULL;
  6751   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression."); yyerrok;}
  8094 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression.");
       
  8095 	 yyerrok;
       
  8096 	}
       
  8097 /* ERROR_CHECK_END */
  6752 /* ERROR_CHECK_END */
  8098 ;
  6753 ;
  8099 
  6754 
  8100 
  6755 
  8101 /********************/
  6756 /********************/
  8110 	{$$ = $1; $$->add_element($2);}
  6765 	{$$ = $1; $$->add_element($2);}
  8111 | statement_list pragma
  6766 | statement_list pragma
  8112 	{$$ = $1; $$->add_element($2);}
  6767 	{$$ = $1; $$->add_element($2);}
  8113 /* ERROR_CHECK_BEGIN */
  6768 /* ERROR_CHECK_BEGIN */
  8114 | statement error
  6769 | statement error
  8115 	{$$ = new statement_list_c(locloc(@$));
  6770 	{$$ = new statement_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of statement in ST statement."); yyerrok;}
  8116 	 print_err_msg(current_filename, locl(@1), locf(@2), "';' missing at the end of statement in ST statement.");
       
  8117 	 yyerrok;
       
  8118 	}
       
  8119 | statement_list statement error
  6771 | statement_list statement error
  8120 	{$$ = $1;
  6772 	{$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of statement in ST statement."); yyerrok;}
  8121 	 print_err_msg(current_filename, locl(@2), locf(@3), "';' missing at the end of statement in ST statement.");
       
  8122 	 yyerrok;
       
  8123 	}
       
  8124 | statement_list error ';'
  6773 | statement_list error ';'
  8125 	{$$ = $1;
  6774 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid statement in ST statement."); yyerrok;}
  8126 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid statement in ST statement.");
       
  8127 	 yyerrok;
       
  8128 	}
       
  8129 | statement_list ';'
  6775 | statement_list ';'
  8130 	{$$ = $1;
  6776 	{$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after statement in ST statement."); yynerrs++;}
  8131 	 yynerrs++;
       
  8132 	 print_err_msg(current_filename, locf(@2), locl(@2), "unexpected ';' after statement in ST statement.");
       
  8133 	}
       
  8134 /* ERROR_CHECK_END */
  6777 /* ERROR_CHECK_END */
  8135 ;
  6778 ;
  8136 
  6779 
  8137 
  6780 
  8138 statement:
  6781 statement:
  8148 /*********************************/
  6791 /*********************************/
  8149 assignment_statement:
  6792 assignment_statement:
  8150   variable ASSIGN expression
  6793   variable ASSIGN expression
  8151 	{$$ = new assignment_statement_c($1, $3, locloc(@$));}
  6794 	{$$ = new assignment_statement_c($1, $3, locloc(@$));}
  8152 /* ERROR_CHECK_BEGIN */
  6795 /* ERROR_CHECK_BEGIN */
       
  6796 | error ASSIGN expression
       
  6797   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid variable before ':=' in ST assignment statement."); yyerrok;}
  8153 | variable ASSIGN error
  6798 | variable ASSIGN error
  8154 	{$$ = NULL;
  6799 	{$$ = NULL;
  8155 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression after ':=' in ST assignment statement.");
  6800 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after ':=' in ST assignment statement.");}
       
  6801 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression after ':=' in ST assignment statement."); yyclearin;}
  8156 	 yyerrok;
  6802 	 yyerrok;
  8157 	}
  6803 	}
  8158 /* ERROR_CHECK_END */
  6804 /* ERROR_CHECK_END */
  8159 ;
  6805 ;
  8160 
  6806 
  8183 	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
  6829 	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
  8184 | prev_declared_fb_name '(' param_assignment_nonformal_list ')'
  6830 | prev_declared_fb_name '(' param_assignment_nonformal_list ')'
  8185 	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
  6831 	{$$ = new fb_invocation_c($1, $3, locloc(@$));}
  8186 /* ERROR_CHECK_BEGIN */
  6832 /* ERROR_CHECK_BEGIN */
  8187 | prev_declared_fb_name ')'
  6833 | prev_declared_fb_name ')'
  8188 	{$$ = NULL;
  6834 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function block name in ST statement."); yynerrs++;}
  8189 	 yynerrs++;
       
  8190 	 print_err_msg(current_filename, locl(@1), locf(@2), "'(' missing after function block name in ST statement.");
       
  8191 	}
       
  8192 | prev_declared_fb_name param_assignment_formal_list ')'
  6835 | prev_declared_fb_name param_assignment_formal_list ')'
  8193 	{$$ = NULL;
  6836 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function block name in ST statement."); yynerrs++;}
  8194 	 yynerrs++;
       
  8195 	 print_err_msg(current_filename, locl(@1), locf(@2), "'(' missing after function block name in ST statement.");
       
  8196 	}
       
  8197 | prev_declared_fb_name error ')'
       
  8198 	{$$ = NULL;
       
  8199 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '(' after function block name in ST statement.");
       
  8200 	 yyerrok;
       
  8201 	}
       
  8202 | prev_declared_fb_name error param_assignment_formal_list ')'
       
  8203 	{$$ = NULL;
       
  8204 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '(' after function block name in ST statement.");
       
  8205 	 yyerrok;
       
  8206 	}
       
  8207 | prev_declared_fb_name error param_assignment_nonformal_list ')'
       
  8208 	{$$ = NULL;
       
  8209 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting '(' after function block name in ST statement.");
       
  8210 	 yyerrok;
       
  8211 	}
       
  8212 | prev_declared_fb_name '(' error ')'
  6837 | prev_declared_fb_name '(' error ')'
  8213 	{$$ = NULL;
  6838 	{$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid parameter list in function block invocation in ST statement."); yyerrok;}
  8214 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid parameter list in function block invocation in ST statement.");
       
  8215 	 yyerrok;
       
  8216 	}
       
  8217 | prev_declared_fb_name '(' error
  6839 | prev_declared_fb_name '(' error
  8218 	{$$ = NULL;
  6840 	{$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;}
  8219 	 print_err_msg(current_filename, locl(@2), locf(@3), "')' missing after parameter list of function block invocation in ST statement.");
       
  8220 	 yyerrok;
       
  8221 	}
       
  8222 | prev_declared_fb_name '(' param_assignment_formal_list error
  6841 | prev_declared_fb_name '(' param_assignment_formal_list error
  8223 	{$$ = NULL;
  6842 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;}
  8224 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement.");
       
  8225 	 yyerrok;
       
  8226 	}
       
  8227 | prev_declared_fb_name '(' param_assignment_nonformal_list error
  6843 | prev_declared_fb_name '(' param_assignment_nonformal_list error
  8228 	{$$ = NULL;
  6844 	{$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;}
  8229 	 print_err_msg(current_filename, locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement.");
       
  8230 	 yyerrok;
       
  8231 	}
       
  8232 /* ERROR_CHECK_END */
  6845 /* ERROR_CHECK_END */
  8233 ;
  6846 ;
  8234 
  6847 
  8235 
  6848 
  8236 /* helper symbol for
  6849 /* helper symbol for
  8241   param_assignment_formal
  6854   param_assignment_formal
  8242 	{$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);}
  6855 	{$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);}
  8243 | param_assignment_formal_list ',' param_assignment_formal
  6856 | param_assignment_formal_list ',' param_assignment_formal
  8244 	{$$ = $1; $$->add_element($3);}
  6857 	{$$ = $1; $$->add_element($3);}
  8245 /* ERROR_CHECK_BEGIN */
  6858 /* ERROR_CHECK_BEGIN */
  8246 | param_assignment_formal_list error param_assignment_formal
       
  8247   {$$ = $1;
       
  8248 	 print_err_msg(current_filename, locf(@2), locl(@2), "expecting ',' in ST parameter assignment list.");
       
  8249 	 yyerrok;
       
  8250 	}
       
  8251 | param_assignment_formal_list ',' error
  6859 | param_assignment_formal_list ',' error
  8252   {$$ = $1;
  6860   {$$ = $1;
  8253 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list.");
  6861 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no parameter assignment defined in ST parameter assignment list.");}
       
  6862 	 else {print_err_msg(locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list."); yyclearin;}
  8254 	 yyerrok;
  6863 	 yyerrok;
  8255 	}
  6864 	}
  8256 /* ERROR_CHECK_END */
  6865 /* ERROR_CHECK_END */
  8257 ;
  6866 ;
  8258 
  6867 
  8266 | param_assignment_nonformal_list ',' param_assignment_nonformal
  6875 | param_assignment_nonformal_list ',' param_assignment_nonformal
  8267 	{$$ = $1; $$->add_element($3);}
  6876 	{$$ = $1; $$->add_element($3);}
  8268 /* ERROR_CHECK_BEGIN */
  6877 /* ERROR_CHECK_BEGIN */
  8269 | param_assignment_nonformal_list ',' error
  6878 | param_assignment_nonformal_list ',' error
  8270   {$$ = $1;
  6879   {$$ = $1;
  8271 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list.");
  6880 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no parameter assignment defined in ST parameter assignment list.");}
       
  6881 	 else {print_err_msg(locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list."); yyclearin;}
  8272 	 yyerrok;
  6882 	 yyerrok;
  8273 	}
  6883 	}
  8274 /* ERROR_CHECK_END */
  6884 /* ERROR_CHECK_END */
  8275 ;
  6885 ;
  8276 
  6886 
  8319 | NOT sendto_identifier SENDTO variable
  6929 | NOT sendto_identifier SENDTO variable
  8320 	{$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)),$2, $4, locloc(@$));}
  6930 	{$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)),$2, $4, locloc(@$));}
  8321 /* ERROR_CHECK_BEGIN */
  6931 /* ERROR_CHECK_BEGIN */
  8322 | any_identifier ASSIGN error
  6932 | any_identifier ASSIGN error
  8323   {$$ = NULL;
  6933   {$$ = NULL;
  8324 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression in ST formal parameter assignment.");
  6934 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter assignment.");}
  8325 	 yyerrok;
  6935 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter assignment."); yyclearin;}
  8326 	} 
  6936 	 yyerrok;
       
  6937 	}
  8327 | sendto_identifier SENDTO error
  6938 | sendto_identifier SENDTO error
  8328   {$$ = NULL;
  6939   {$$ = NULL;
  8329 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid expression in ST formal parameter out assignment.");
  6940 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter out assignment.");}
       
  6941 	 else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter out assignment."); yyclearin;}
  8330 	 yyerrok;
  6942 	 yyerrok;
  8331 	}
  6943 	}
  8332 | NOT SENDTO variable
  6944 | NOT SENDTO variable
  8333   {$$ = NULL;
  6945   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no parameter name defined in ST formal parameter out negated assignment."); yynerrs++;}
  8334 	 yynerrs++;
       
  8335 	 print_err_msg(current_filename, locl(@1), locf(@2), "no parameter name defined in ST formal parameter out negated assignment.");
       
  8336 	}
       
  8337 | NOT error SENDTO variable
  6946 | NOT error SENDTO variable
  8338   {$$ = NULL;
  6947   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter name defined in ST formal parameter out negated assignment."); yyerrok;}
  8339 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid parameter name defined in ST formal parameter out negated assignment.");
       
  8340 	 yyerrok;
       
  8341 	}
       
  8342 | NOT sendto_identifier SENDTO error
  6948 | NOT sendto_identifier SENDTO error
  8343   {$$ = NULL;
  6949   {$$ = NULL;
  8344 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid expression in ST formal parameter out negated assignment.");
  6950 	 if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no expression defined in ST formal parameter out negated assignment.");}
       
  6951 	 else {print_err_msg(locf(@4), locl(@4), "invalid expression in ST formal parameter out negated assignment."); yyclearin;}
  8345 	 yyerrok;
  6952 	 yyerrok;
  8346 	}
  6953 	}
  8347 /* ERROR_CHECK_END */
  6954 /* ERROR_CHECK_END */
  8348 ;
  6955 ;
  8349 
  6956 
  8365 	{$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));}
  6972 	{$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));}
  8366 | IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF
  6973 | IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF
  8367 	{$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));}
  6974 	{$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));}
  8368 /* ERROR_CHECK_BEGIN */
  6975 /* ERROR_CHECK_BEGIN */
  8369 | IF THEN statement_list elseif_statement_list END_IF
  6976 | IF THEN statement_list elseif_statement_list END_IF
  8370   {$$ = NULL;
  6977   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'IF' statement."); yynerrs++;}
  8371 	 yynerrs++;
       
  8372 	 print_err_msg(current_filename, locl(@1), locf(@2), "no test expression defined in ST 'IF' statement.");
       
  8373 	}
       
  8374 | IF THEN statement_list elseif_statement_list ELSE statement_list END_IF
  6978 | IF THEN statement_list elseif_statement_list ELSE statement_list END_IF
  8375   {$$ = NULL;
  6979   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'IF' statement."); yynerrs++;}
  8376 	 yynerrs++;
       
  8377 	 print_err_msg(current_filename, locl(@1), locf(@2), "no test expression defined in ST 'IF' statement.");
       
  8378 	}
       
  8379 | IF error THEN statement_list elseif_statement_list END_IF
  6980 | IF error THEN statement_list elseif_statement_list END_IF
  8380   {$$ = NULL;
  6981   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement."); yyerrok;}
  8381 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement.");
       
  8382 	 yyerrok;
       
  8383 	}
       
  8384 | IF error THEN statement_list elseif_statement_list ELSE statement_list END_IF
  6982 | IF error THEN statement_list elseif_statement_list ELSE statement_list END_IF
  8385   {$$ = NULL;
  6983   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement."); yyerrok;}
  8386 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement.");
       
  8387 	 yyerrok;
       
  8388 	}
       
  8389 | IF expression error statement_list elseif_statement_list END_IF
  6984 | IF expression error statement_list elseif_statement_list END_IF
  8390   {$$ = NULL;
  6985   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement."); yyerrok;}
  8391 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement.");
       
  8392 	 yyerrok;
       
  8393 	}
       
  8394 | IF expression error statement_list elseif_statement_list ELSE statement_list END_IF
  6986 | IF expression error statement_list elseif_statement_list ELSE statement_list END_IF
  8395   {$$ = NULL;
  6987   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement."); yyerrok;}
  8396 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement.");
       
  8397 	 yyerrok;
       
  8398 	}
       
  8399 | IF expression THEN elseif_statement_list END_IF
  6988 | IF expression THEN elseif_statement_list END_IF
  8400   {$$ = NULL;
  6989   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement."); yynerrs++;}
  8401 	 yynerrs++;
       
  8402 	 print_err_msg(current_filename, locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement.");
       
  8403 	}
       
  8404 | IF expression THEN elseif_statement_list ELSE statement_list END_IF
  6990 | IF expression THEN elseif_statement_list ELSE statement_list END_IF
  8405   {$$ = NULL;
  6991   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement."); yynerrs++;}
  8406 	 yynerrs++;
       
  8407 	 print_err_msg(current_filename, locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement.");
       
  8408 	}
       
  8409 | IF expression THEN statement_list elseif_statement_list ELSE END_IF
  6992 | IF expression THEN statement_list elseif_statement_list ELSE END_IF
  8410   {$$ = NULL;
  6993   {$$ = NULL; print_err_msg(locl(@6), locf(@7), "no statement defined after 'ELSE' in ST 'IF' statement."); yynerrs++;}
  8411 	 yynerrs++;
       
  8412 	 print_err_msg(current_filename, locl(@6), locf(@7), "no statement defined after 'ELSE' in ST 'IF' statement.");
       
  8413 	}
       
  8414 | IF expression THEN statement_list elseif_statement_list ELSE error END_IF
  6994 | IF expression THEN statement_list elseif_statement_list ELSE error END_IF
  8415   {$$ = NULL;
  6995   {$$ = NULL; print_err_msg(locf(@7), locl(@7), "invalid statement defined after 'ELSE' in ST 'IF' statement."); yynerrs++; yyerrok;}
  8416 	 print_err_msg(current_filename, locf(@7), locl(@7), "invalid statement defined after 'ELSE' in ST 'IF' statement.");
  6996 | IF expression error END_OF_INPUT
  8417 	 yyerrok;
  6997   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed 'IF' statement in ST."); yyerrok;}
  8418 	}
  6998 | IF expression THEN statement_list elseif_statement_list END_OF_INPUT
       
  6999   {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'IF' statement in ST."); yynerrs++;}
       
  7000 | IF expression THEN statement_list elseif_statement_list ELSE statement_list END_OF_INPUT
       
  7001   {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'IF' statement in ST."); yynerrs++;}
  8419 | IF error END_IF
  7002 | IF error END_IF
  8420   {$$ = NULL;
  7003   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'IF' statement."); yyerrok;}
  8421 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in ST 'IF' statement.");
       
  8422 	 yyerrok;
       
  8423 	}
       
  8424 /* ERROR_CHECK_END */
  7004 /* ERROR_CHECK_END */
  8425 ;
  7005 ;
  8426 
  7006 
  8427 /* helper symbol for if_statement */
  7007 /* helper symbol for if_statement */
  8428 elseif_statement_list:
  7008 elseif_statement_list:
  8436 elseif_statement:
  7016 elseif_statement:
  8437   ELSIF expression THEN statement_list
  7017   ELSIF expression THEN statement_list
  8438 	{$$ = new elseif_statement_c($2, $4, locloc(@$));}
  7018 	{$$ = new elseif_statement_c($2, $4, locloc(@$));}
  8439 /* ERROR_CHECK_BEGIN */
  7019 /* ERROR_CHECK_BEGIN */
  8440 | ELSIF THEN statement_list
  7020 | ELSIF THEN statement_list
  8441   {$$ = NULL;
  7021   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined for 'ELSEIF' statement in ST 'IF' statement."); yynerrs++;}
  8442 	 yynerrs++;
       
  8443 	 print_err_msg(current_filename, locl(@1), locf(@2), "no test expression defined for 'ELSEIF' statement in ST 'IF' statement.");
       
  8444 	}
       
  8445 | ELSIF error THEN statement_list
  7022 | ELSIF error THEN statement_list
  8446   {$$ = NULL;
  7023   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for 'ELSEIF' statement in ST 'IF' statement."); yyerrok;}
  8447 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid test expression defined for 'ELSEIF' statement in ST 'IF' statement.");
       
  8448 	 yyerrok;
       
  8449 	}
       
  8450 | ELSIF expression error statement_list
  7024 | ELSIF expression error statement_list
  8451   {$$ = NULL;
  7025   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in 'ELSEIF' statement of ST 'IF' statement."); yyerrok;}
  8452 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting 'THEN' after test expression in 'ELSEIF' statement of ST 'IF' statement.");
       
  8453 	 yyerrok;
       
  8454 	}
       
  8455 | ELSIF expression THEN error
  7026 | ELSIF expression THEN error
  8456   {$$ = NULL;
  7027   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid statement list in 'ELSEIF' statement of ST 'IF' statement."); yyerrok;}
  8457 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid statement list in 'ELSEIF' statement of ST 'IF' statement.");
       
  8458 	 yyerrok;
       
  8459 	}
       
  8460 /* ERROR_CHECK_END */
  7028 /* ERROR_CHECK_END */
  8461 ;
  7029 ;
  8462 
  7030 
  8463 
  7031 
  8464 case_statement:
  7032 case_statement:
  8466 	{$$ = new case_statement_c($2, $4, NULL, locloc(@$));}
  7034 	{$$ = new case_statement_c($2, $4, NULL, locloc(@$));}
  8467 | CASE expression OF case_element_list ELSE statement_list END_CASE
  7035 | CASE expression OF case_element_list ELSE statement_list END_CASE
  8468 	{$$ = new case_statement_c($2, $4, $6, locloc(@$));}
  7036 	{$$ = new case_statement_c($2, $4, $6, locloc(@$));}
  8469 /* ERROR_CHECK_BEGIN */
  7037 /* ERROR_CHECK_BEGIN */
  8470 | CASE OF case_element_list END_CASE
  7038 | CASE OF case_element_list END_CASE
  8471   {$$ = NULL;
  7039   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement."); yynerrs++;}
  8472 	 yynerrs++;
       
  8473 	 print_err_msg(current_filename, locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement.");
       
  8474 	}
       
  8475 | CASE OF case_element_list ELSE statement_list END_CASE
  7040 | CASE OF case_element_list ELSE statement_list END_CASE
  8476   {$$ = NULL;
  7041   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement."); yynerrs++;}
  8477 	 yynerrs++;
       
  8478 	 print_err_msg(current_filename, locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement.");
       
  8479 	}
       
  8480 | CASE error OF case_element_list END_CASE
  7042 | CASE error OF case_element_list END_CASE
  8481   {$$ = NULL;
  7043   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement."); yyerrok;}
  8482 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement.");
       
  8483 	 yyerrok;
       
  8484 	}
       
  8485 | CASE error OF case_element_list ELSE statement_list END_CASE
  7044 | CASE error OF case_element_list ELSE statement_list END_CASE
  8486   {$$ = NULL;
  7045   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement."); yyerrok;}
  8487 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement.");
       
  8488 	 yyerrok;
       
  8489 	}
       
  8490 | CASE expression error case_element_list END_CASE
  7046 | CASE expression error case_element_list END_CASE
  8491   {$$ = NULL;
  7047   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement."); yyerrok;}
  8492 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement.");
       
  8493 	 yyerrok;
       
  8494 	}
       
  8495 | CASE expression error case_element_list ELSE statement_list END_CASE
  7048 | CASE expression error case_element_list ELSE statement_list END_CASE
  8496   {$$ = NULL;
  7049   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement."); yyerrok;}
  8497 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement.");
       
  8498 	 yyerrok;
       
  8499 	}
       
  8500 | CASE expression OF END_CASE
  7050 | CASE expression OF END_CASE
  8501   {$$ = NULL;
  7051   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); yynerrs++;}
  8502 	 yynerrs++;
       
  8503 	 print_err_msg(current_filename, locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement.");
       
  8504 	}
       
  8505 | CASE expression OF ELSE statement_list END_CASE
  7052 | CASE expression OF ELSE statement_list END_CASE
  8506   {$$ = NULL;
  7053   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); yynerrs++;}
  8507 	 yynerrs++;
       
  8508 	 print_err_msg(current_filename, locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement.");
       
  8509 	}
       
  8510 | CASE expression OF error END_CASE
  7054 | CASE expression OF error END_CASE
  8511   {$$ = NULL;
  7055   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); yyerrok;}
  8512 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement.");
       
  8513 	 yyerrok;
       
  8514 	}
       
  8515 | CASE expression OF error ELSE statement_list END_CASE
  7056 | CASE expression OF error ELSE statement_list END_CASE
  8516   {$$ = NULL;
  7057   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); yyerrok;}
  8517 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement.");
       
  8518 	 yyerrok;
       
  8519 	}
       
  8520 | CASE expression OF case_element_list ELSE END_CASE
  7058 | CASE expression OF case_element_list ELSE END_CASE
  8521   {$$ = NULL;
  7059   {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no statement defined after 'ELSE' in ST 'CASE' statement."); yynerrs++;}
  8522 	 yynerrs++;
       
  8523 	 print_err_msg(current_filename, locl(@5), locf(@6), "no statement defined after 'ELSE' in ST 'CASE' statement.");
       
  8524 	}
       
  8525 | CASE expression OF case_element_list ELSE error END_CASE
  7060 | CASE expression OF case_element_list ELSE error END_CASE
  8526   {$$ = NULL;
  7061   {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid statement defined after 'ELSE' in ST 'CASE' statement."); yyerrok;}
  8527 	 print_err_msg(current_filename, locf(@6), locl(@6), "invalid statement defined after 'ELSE' in ST 'CASE' statement.");
  7062 | CASE expression error END_OF_INPUT
  8528 	 yyerrok;
  7063   {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed 'CASE' statement in ST."); yyerrok;}
  8529 	}
  7064 | CASE expression OF case_element_list END_OF_INPUT
       
  7065   {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'CASE' statement in ST."); yynerrs++;}
       
  7066 | CASE expression OF case_element_list ELSE statement_list END_OF_INPUT
       
  7067   {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'CASE' statement in ST."); yynerrs++;}
  8530 | CASE error END_CASE
  7068 | CASE error END_CASE
  8531   {$$ = NULL;
  7069   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'CASE' statement."); yyerrok;}
  8532 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in ST 'CASE' statement.");
       
  8533 	 yyerrok;
       
  8534 	}
       
  8535 /* ERROR_CHECK_END */
  7070 /* ERROR_CHECK_END */
  8536 ;
  7071 ;
  8537 
  7072 
  8538 
  7073 
  8539 /* helper symbol for case_statement */
  7074 /* helper symbol for case_statement */
  8548 case_element:
  7083 case_element:
  8549   case_list ':' statement_list
  7084   case_list ':' statement_list
  8550 	{$$ = new case_element_c($1, $3, locloc(@$));}
  7085 	{$$ = new case_element_c($1, $3, locloc(@$));}
  8551 /* ERROR_CHECK_BEGIN */
  7086 /* ERROR_CHECK_BEGIN */
  8552 | case_list statement_list
  7087 | case_list statement_list
  8553   {$$ = NULL;
  7088   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after case list in ST 'CASE' statement."); yynerrs++;}
  8554 	 yynerrs++;
       
  8555 	 print_err_msg(current_filename, locl(@1), locf(@2), "':' missing after case list in ST 'CASE' statement.");
       
  8556 	}
       
  8557 | case_list ':' error
  7089 | case_list ':' error
  8558   {$$ = NULL;
  7090   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid statement in case element of ST 'CASE' statement."); yyerrok;}
  8559 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid statement in case element of ST 'CASE' statement.");
       
  8560 	 yyerrok;
       
  8561 	}
       
  8562 /* ERROR_CHECK_END */
  7091 /* ERROR_CHECK_END */
  8563 ;
  7092 ;
  8564 
  7093 
  8565 
  7094 
  8566 case_list:
  7095 case_list:
  8569 | case_list ',' case_list_element
  7098 | case_list ',' case_list_element
  8570 	{$$ = $1; $$->add_element($3);}
  7099 	{$$ = $1; $$->add_element($3);}
  8571 /* ERROR_CHECK_BEGIN */
  7100 /* ERROR_CHECK_BEGIN */
  8572 | case_list ',' error
  7101 | case_list ',' error
  8573   {$$ = $1;
  7102   {$$ = $1;
  8574 	 print_err_msg(current_filename, locf(@3), locl(@3), "invalid case in case list of ST parameter assignment list.");
  7103 	 if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no case defined in case list of ST parameter assignment list.");}
       
  7104 	 else {print_err_msg(locf(@3), locl(@3), "invalid case in case list of ST parameter assignment list."); yyclearin;}
  8575 	 yyerrok;
  7105 	 yyerrok;
  8576 	}
  7106 	}
  8577 /* ERROR_CHECK_END */
  7107 /* ERROR_CHECK_END */
  8578 ;
  7108 ;
  8579 
  7109 
  8604 	{$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));}
  7134 	{$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));}
  8605 | FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR
  7135 | FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR
  8606 	{$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));}
  7136 	{$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));}
  8607 /* ERROR_CHECK_BEGIN */
  7137 /* ERROR_CHECK_BEGIN */
  8608 | FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR
  7138 | FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR
  8609   {$$ = NULL;
  7139   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement."); yynerrs++;}
  8610 	 yynerrs++;
       
  8611 	 print_err_msg(current_filename, locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement.");
       
  8612 	}
       
  8613 | FOR ASSIGN expression TO expression DO statement_list END_FOR
  7140 | FOR ASSIGN expression TO expression DO statement_list END_FOR
  8614   {$$ = NULL;
  7141   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement."); yynerrs++;}
  8615 	 yynerrs++;
       
  8616 	 print_err_msg(current_filename, locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement.");
       
  8617 	}
       
  8618 | FOR error ASSIGN expression TO expression BY expression DO statement_list END_FOR
  7142 | FOR error ASSIGN expression TO expression BY expression DO statement_list END_FOR
  8619   {$$ = NULL;
  7143   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement."); yyerrok;}
  8620 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement.");
       
  8621 	 yyerrok;
       
  8622 	}
       
  8623 | FOR error ASSIGN expression TO expression DO statement_list END_FOR
  7144 | FOR error ASSIGN expression TO expression DO statement_list END_FOR
  8624   {$$ = NULL;
  7145   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement."); yyerrok;}
  8625 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement.");
       
  8626 	 yyerrok;
       
  8627 	}
       
  8628 | FOR control_variable expression TO expression BY expression DO statement_list END_FOR
  7146 | FOR control_variable expression TO expression BY expression DO statement_list END_FOR
  8629   {$$ = NULL;
  7147   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); yynerrs++;}
  8630 	 yynerrs++;
       
  8631 	 print_err_msg(current_filename, locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement.");
       
  8632 	}
       
  8633 | FOR control_variable expression TO expression DO statement_list END_FOR
  7148 | FOR control_variable expression TO expression DO statement_list END_FOR
  8634   {$$ = NULL;
  7149   {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); yynerrs++;}
  8635 	 yynerrs++;
       
  8636 	 print_err_msg(current_filename, locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement.");
       
  8637 	}
       
  8638 | FOR control_variable error expression TO expression BY expression DO statement_list END_FOR
  7150 | FOR control_variable error expression TO expression BY expression DO statement_list END_FOR
  8639   {$$ = NULL;
  7151   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); yyerrok;}
  8640 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement.");
       
  8641 	 yyerrok;
       
  8642 	}
       
  8643 | FOR control_variable error expression TO expression DO statement_list END_FOR
  7152 | FOR control_variable error expression TO expression DO statement_list END_FOR
  8644   {$$ = NULL;
  7153   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); yyerrok;}
  8645 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement.");
       
  8646 	 yyerrok;
       
  8647 	}
       
  8648 | FOR control_variable ASSIGN TO expression BY expression DO statement_list END_FOR
  7154 | FOR control_variable ASSIGN TO expression BY expression DO statement_list END_FOR
  8649   {$$ = NULL;
  7155   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement."); yynerrs++;}
  8650 	 yynerrs++;
       
  8651 	 print_err_msg(current_filename, locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement.");
       
  8652 	}
       
  8653 | FOR control_variable ASSIGN TO expression DO statement_list END_FOR
  7156 | FOR control_variable ASSIGN TO expression DO statement_list END_FOR
  8654   {$$ = NULL;
  7157   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement."); yynerrs++;}
  8655 	 yynerrs++;
       
  8656 	 print_err_msg(current_filename, locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement.");
       
  8657 	}
       
  8658 | FOR control_variable ASSIGN error TO expression BY expression DO statement_list END_FOR
  7158 | FOR control_variable ASSIGN error TO expression BY expression DO statement_list END_FOR
  8659   {$$ = NULL;
  7159   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid start expression defined in ST 'FOR' statement."); yyerrok;}
  8660 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid start expression defined in ST 'FOR' statement.");
       
  8661 	 yyerrok;
       
  8662 	}
       
  8663 | FOR control_variable ASSIGN error TO expression DO statement_list END_FOR
  7160 | FOR control_variable ASSIGN error TO expression DO statement_list END_FOR
  8664   {$$ = NULL;
  7161   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid start expression in ST 'FOR' statement."); yyerrok;}
  8665 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid start expression in ST 'FOR' statement.");
       
  8666 	 yyerrok;
       
  8667 	}
       
  8668 | FOR control_variable ASSIGN expression error expression BY expression DO statement_list END_FOR
  7162 | FOR control_variable ASSIGN expression error expression BY expression DO statement_list END_FOR
  8669   {$$ = NULL;
  7163   {$$ = NULL; print_err_msg(locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); yyerrok;}
  8670 	 print_err_msg(current_filename, locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement.");
       
  8671 	 yyerrok;
       
  8672 	}
       
  8673 | FOR control_variable ASSIGN expression error expression DO statement_list END_FOR
  7164 | FOR control_variable ASSIGN expression error expression DO statement_list END_FOR
  8674   {$$ = NULL;
  7165   {$$ = NULL; print_err_msg(locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); yyerrok;}
  8675 	 print_err_msg(current_filename, locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement.");
       
  8676 	 yyerrok;
       
  8677 	}
       
  8678 | FOR control_variable ASSIGN expression TO expression error expression DO statement_list END_FOR
  7166 | FOR control_variable ASSIGN expression TO expression error expression DO statement_list END_FOR
  8679   {$$ = NULL;
  7167   {$$ = NULL; print_err_msg(locf(@7), locl(@7), "expecting 'BY' between end expression and step expression in ST 'FOR' statement."); yyerrok;}
  8680 	 print_err_msg(current_filename, locf(@7), locl(@7), "expecting 'BY' between end expression and step expression in ST 'FOR' statement.");
       
  8681 	 yyerrok;
       
  8682 	}
       
  8683 | FOR control_variable ASSIGN expression TO expression BY expression error statement_list END_FOR
  7168 | FOR control_variable ASSIGN expression TO expression BY expression error statement_list END_FOR
  8684   {$$ = NULL;
  7169   {$$ = NULL; print_err_msg(locf(@9), locl(@9), "expecting 'DO' after step expression in ST 'FOR' statement."); yyerrok;}
  8685 	 print_err_msg(current_filename, locf(@9), locl(@9), "expecting 'DO' after step expression in ST 'FOR' statement.");
       
  8686 	 yyerrok;
       
  8687 	}
       
  8688 | FOR control_variable ASSIGN expression TO expression error statement_list END_FOR
  7170 | FOR control_variable ASSIGN expression TO expression error statement_list END_FOR
  8689   {$$ = NULL;
  7171   {$$ = NULL; print_err_msg(locf(@7), locl(@7), "expecting 'DO' after end expression in ST 'FOR' statement."); yyerrok;}
  8690 	 print_err_msg(current_filename, locf(@7), locl(@7), "expecting 'DO' after end expression in ST 'FOR' statement.");
       
  8691 	 yyerrok;
       
  8692 	}
       
  8693 | FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR
  7172 | FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR
  8694   {$$ = NULL;
  7173   {$$ = NULL; print_err_msg(locl(@9), locf(@10), "no statement(s) defined after 'DO' in ST 'FOR' statement."); yynerrs++;}
  8695 	 yynerrs++;
       
  8696 	 print_err_msg(current_filename, locl(@9), locf(@10), "no statement(s) defined after 'DO' in ST 'FOR' statement.");
       
  8697 	}
       
  8698 | FOR control_variable ASSIGN expression TO expression DO END_FOR
  7174 | FOR control_variable ASSIGN expression TO expression DO END_FOR
  8699   {$$ = NULL;
  7175   {$$ = NULL; print_err_msg(locl(@7), locf(@8), "no statement(s) defined after 'DO' in ST 'FOR' statement."); yynerrs++;}
  8700 	 yynerrs++;
       
  8701 	 print_err_msg(current_filename, locl(@7), locf(@8), "no statement(s) defined after 'DO' in ST 'FOR' statement.");
       
  8702 	}
       
  8703 | FOR control_variable ASSIGN expression TO expression BY expression DO error END_FOR
  7176 | FOR control_variable ASSIGN expression TO expression BY expression DO error END_FOR
  8704   {$$ = NULL;
  7177   {$$ = NULL; print_err_msg(locf(@10), locl(@10), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); yyerrok;}
  8705 	 print_err_msg(current_filename, locf(@10), locl(@10), "invalid statement(s) defined after 'DO' in ST 'FOR' statement.");
       
  8706 	 yyerrok;
       
  8707 	}
       
  8708 | FOR control_variable ASSIGN expression TO expression DO error END_FOR
  7178 | FOR control_variable ASSIGN expression TO expression DO error END_FOR
  8709   {$$ = NULL;
  7179   {$$ = NULL; print_err_msg(locf(@8), locl(@8), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); yyerrok;}
  8710 	 print_err_msg(current_filename, locf(@8), locl(@8), "invalid statement(s) defined after 'DO' in ST 'FOR' statement.");
  7180 | FOR control_variable error END_OF_INPUT
  8711 	 yyerrok;
  7181   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;}
  8712 	}
  7182 | FOR control_variable ASSIGN expression error END_OF_INPUT
       
  7183   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;}
       
  7184 | FOR control_variable ASSIGN expression TO expression DO statement_list END_OF_INPUT
       
  7185   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yynerrs++;}
       
  7186 | FOR control_variable ASSIGN expression TO expression BY expression error END_OF_INPUT
       
  7187   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;}
       
  7188 | FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_OF_INPUT
       
  7189   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yynerrs++;}
  8713 | FOR error END_FOR
  7190 | FOR error END_FOR
  8714   {$$ = NULL;
  7191   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'FOR' statement."); yyerrok;}
  8715 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in ST 'FOR' statement.");
       
  8716 	 yyerrok;
       
  8717 	}
       
  8718 /* ERROR_CHECK_END */
  7192 /* ERROR_CHECK_END */
  8719 ;
  7193 ;
  8720 
  7194 
  8721 /* The spec has the syntax
  7195 /* The spec has the syntax
  8722  * control_variable: identifier;
  7196  * control_variable: identifier;
  8746 while_statement:
  7220 while_statement:
  8747   WHILE expression DO statement_list END_WHILE
  7221   WHILE expression DO statement_list END_WHILE
  8748 	{$$ = new while_statement_c($2, $4, locloc(@$));}
  7222 	{$$ = new while_statement_c($2, $4, locloc(@$));}
  8749 /* ERROR_CHECK_BEGIN */
  7223 /* ERROR_CHECK_BEGIN */
  8750 | WHILE DO statement_list END_WHILE
  7224 | WHILE DO statement_list END_WHILE
  8751   {$$ = NULL;
  7225   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'WHILE' statement."); yynerrs++;}
  8752 	 yynerrs++;
       
  8753 	 print_err_msg(current_filename, locl(@1), locf(@2), "no test expression defined in ST 'WHILE' statement.");
       
  8754 	}
       
  8755 | WHILE error DO statement_list END_WHILE
  7226 | WHILE error DO statement_list END_WHILE
  8756   {$$ = NULL;
  7227   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'WHILE' statement."); yyerrok;}
  8757 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid test expression defined for ST 'WHILE' statement.");
       
  8758 	 yyerrok;
       
  8759 	}
       
  8760 | WHILE expression error statement_list END_WHILE
  7228 | WHILE expression error statement_list END_WHILE
  8761   {$$ = NULL;
  7229   {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'DO' after test expression in ST 'WHILE' statement."); yyerrok;}
  8762 	 print_err_msg(current_filename, locf(@3), locl(@3), "expecting 'DO' after test expression in ST 'WHILE' statement.");
       
  8763 	 yyerrok;
       
  8764 	}
       
  8765 | WHILE expression DO END_WHILE
  7230 | WHILE expression DO END_WHILE
  8766   {$$ = NULL;
  7231   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement(s) defined after 'DO' in ST 'WHILE' statement."); yynerrs++;}
  8767 	 yynerrs++;
       
  8768 	 print_err_msg(current_filename, locl(@3), locf(@4), "no statement(s) defined after 'DO' in ST 'WHILE' statement.");
       
  8769 	}
       
  8770 | WHILE expression DO error END_WHILE
  7232 | WHILE expression DO error END_WHILE
  8771   {$$ = NULL;
  7233   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid statement(s) defined after 'DO' in ST 'WHILE' statement."); yyerrok;}
  8772 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid statement(s) defined after 'DO' in ST 'WHILE' statement.");
  7234 | WHILE expression error END_OF_INPUT
  8773 	 yyerrok;
  7235   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'WHILE' statement in ST."); yyerrok;}
  8774 	}
  7236 | WHILE expression DO statement_list END_OF_INPUT
       
  7237   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'WHILE' statement in ST."); yynerrs++;}
  8775 | WHILE error END_WHILE
  7238 | WHILE error END_WHILE
  8776   {$$ = NULL;
  7239   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'WHILE' statement."); yyerrok;}
  8777 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in ST 'WHILE' statement.");
       
  8778 	 yyerrok;
       
  8779 	}
       
  8780 /* ERROR_CHECK_END */
  7240 /* ERROR_CHECK_END */
  8781 ;
  7241 ;
  8782 
  7242 
  8783 
  7243 
  8784 repeat_statement:
  7244 repeat_statement:
  8785   REPEAT statement_list UNTIL expression END_REPEAT
  7245   REPEAT statement_list UNTIL expression END_REPEAT
  8786 	{$$ = new repeat_statement_c($2, $4, locloc(@$));}
  7246 	{$$ = new repeat_statement_c($2, $4, locloc(@$));}
  8787 /* ERROR_CHECK_BEGIN */
  7247 /* ERROR_CHECK_BEGIN */
  8788 | REPEAT UNTIL expression END_REPEAT
  7248 | REPEAT UNTIL expression END_REPEAT
  8789   {$$ = NULL;
  7249   {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no statement(s) defined after 'REPEAT' in ST 'REPEAT' statement."); yynerrs++;}
  8790 	 yynerrs++;
       
  8791 	 print_err_msg(current_filename, locl(@1), locf(@2), "no statement(s) defined after 'REPEAT' in ST 'REPEAT' statement.");
       
  8792 	}
       
  8793 | REPEAT error UNTIL expression END_REPEAT
  7250 | REPEAT error UNTIL expression END_REPEAT
  8794   {$$ = NULL;
  7251   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid statement(s) defined after 'REPEAT' for ST 'REPEAT' statement."); yyerrok;}
  8795 	 print_err_msg(current_filename, locf(@2), locl(@2), "invalid statement(s) defined after 'REPEAT' for ST 'REPEAT' statement.");
       
  8796 	 yyerrok;
       
  8797 	}
       
  8798 | REPEAT statement_list UNTIL END_REPEAT
  7252 | REPEAT statement_list UNTIL END_REPEAT
  8799   {$$ = NULL;
  7253   {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no test expression defined after 'UNTIL' in ST 'REPEAT' statement.");}
  8800 	 yynerrs++;
       
  8801 	 print_err_msg(current_filename, locl(@3), locf(@4), "no test expression defined after 'UNTIL' in ST 'REPEAT' statement.");
       
  8802 	}
       
  8803 | REPEAT statement_list UNTIL error END_REPEAT
  7254 | REPEAT statement_list UNTIL error END_REPEAT
  8804   {$$ = NULL;
  7255   {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid test expression defined after 'UNTIL' in ST 'REPEAT' statement."); yyerrok;}
  8805 	 print_err_msg(current_filename, locf(@4), locl(@4), "invalid test expression defined after 'UNTIL' in ST 'REPEAT' statement.");
  7256 | REPEAT statement_list END_OF_INPUT
  8806 	 yyerrok;
  7257   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'REPEAT' statement in ST."); yynerrs++;}
  8807 	}
  7258 | REPEAT statement_list UNTIL expression error END_OF_INPUT
       
  7259   {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'REPEAT' statement in ST."); yyerrok;}
  8808 | REPEAT error END_REPEAT
  7260 | REPEAT error END_REPEAT
  8809   {$$ = NULL;
  7261   {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'REPEAT' statement."); yyerrok;}
  8810 	 print_err_msg(current_filename, locf(@2), locl(@2), "unknown error in ST 'REPEAT' statement.");
       
  8811 	 yyerrok;
       
  8812 	}
       
  8813 /* ERROR_CHECK_END */
  7262 /* ERROR_CHECK_END */
  8814 ;
  7263 ;
  8815 
  7264 
  8816 
  7265 
  8817 exit_statement:
  7266 exit_statement:
  8829 #include "../util/symtable.hh"
  7278 #include "../util/symtable.hh"
  8830 
  7279 
  8831 /* variables defined in code generated by flex... */
  7280 /* variables defined in code generated by flex... */
  8832 extern FILE *yyin;
  7281 extern FILE *yyin;
  8833 extern int yylineno;
  7282 extern int yylineno;
  8834 
  7283 extern tracking_t* current_tracking;
  8835 
  7284 
  8836 
  7285 
  8837 /* A global flag used to tell the parser if overloaded funtions should be allowed.
  7286 /* A global flag used to tell the parser if overloaded funtions should be allowed.
  8838  * The IEC 61131-3 standard allows overloaded funtions in the standard library,
  7287  * The IEC 61131-3 standard allows overloaded funtions in the standard library,
  8839  * but disallows them in user code...
  7288  * but disallows them in user code...
  8860   current_error_msg = error_msg;
  7309   current_error_msg = error_msg;
  8861 /* fprintf(stderr, "error %d: %s\n", yynerrs // global variable //, error_msg); */
  7310 /* fprintf(stderr, "error %d: %s\n", yynerrs // global variable //, error_msg); */
  8862 /*  print_include_stack(); */
  7311 /*  print_include_stack(); */
  8863 }
  7312 }
  8864 
  7313 
  8865 
  7314 bool full_error;
  8866 void print_err_msg(const char *filename,
  7315 
  8867                    int first_line,
  7316 bool is_current_syntax_token() {
       
  7317 	switch (yychar) {
       
  7318   	case ';':
       
  7319   	case ',':
       
  7320   	case ')':
       
  7321   	case ']':
       
  7322   	case '+':
       
  7323   	case '*':
       
  7324   	case '-':
       
  7325   	case '/':
       
  7326   	case '<':
       
  7327   	case '>':
       
  7328   	case '=':
       
  7329   	case '&':
       
  7330   	case OR:
       
  7331   	case XOR:
       
  7332   	case AND:
       
  7333   	case AND2:
       
  7334   	case OPER_NE:
       
  7335   	case OPER_LE:
       
  7336   	case OPER_GE:
       
  7337   	case MOD:
       
  7338   	case OPER_EXP:
       
  7339   	case NOT:
       
  7340   		return true;
       
  7341  		default:
       
  7342  			return false;
       
  7343  	}
       
  7344 }
       
  7345 
       
  7346 void print_err_msg(int first_line,
  8868                    int first_column,
  7347                    int first_column,
  8869                    int last_line,
  7348                    int last_line,
  8870                    int last_column,
  7349                    int last_column,
  8871                    const char *additional_error_msg) {
  7350                    const char *additional_error_msg) {
  8872   fprintf(stderr, "%s:%d: error : %s\n", filename, first_line, additional_error_msg);
  7351   if (full_error)
       
  7352   	fprintf(stderr, "%s:%d-%d..%d-%d: error : %s\n", current_filename, first_line, first_column, last_line, last_column, additional_error_msg);
       
  7353   else
       
  7354   	fprintf(stderr, "%s:%d: error : %s\n", current_filename, first_line, additional_error_msg);
  8873   //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
  7355   //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
  8874   print_include_stack();
  7356   print_include_stack();
  8875   //fprintf(stderr, "%s(%d-%d): %s\n", filename, first_line, last_line, current_error_msg);
  7357   //fprintf(stderr, "%s(%d-%d): %s\n", current_filename, first_line, last_line, current_error_msg);
  8876 }
  7358 }
  8877 
  7359 
  8878 
  7360 
  8879 
  7361 
  8880 /* convert between an il_operator to a function name */
  7362 /* convert between an il_operator to a function name */
  8993 #define LIBFILE "ieclib.txt"
  7475 #define LIBFILE "ieclib.txt"
  8994 #define DEF_LIBFILENAME LIBDIRECTORY "/" LIBFILE
  7476 #define DEF_LIBFILENAME LIBDIRECTORY "/" LIBFILE
  8995 
  7477 
  8996 extern const char *INCLUDE_DIRECTORIES[];
  7478 extern const char *INCLUDE_DIRECTORIES[];
  8997 
  7479 
  8998 int stage1_2__(const char *filename, const char *includedir, symbol_c **tree_root_ref) {
  7480 int stage1_2__(const char *filename, const char *includedir, symbol_c **tree_root_ref, bool full) {
  8999   FILE *in_file = NULL, *lib_file = NULL;
  7481   FILE *in_file = NULL, *lib_file = NULL;
  9000   char *libfilename = NULL;
  7482   char *libfilename = NULL;
  9001 
  7483 	
       
  7484 	full_error = full;
       
  7485 	
  9002   if((in_file = fopen(filename, "r")) == NULL) {
  7486   if((in_file = fopen(filename, "r")) == NULL) {
  9003     char *errmsg = strdup2("Error opening main file ", filename);
  7487     char *errmsg = strdup2("Error opening main file ", filename);
  9004     perror(errmsg);
  7488     perror(errmsg);
  9005     free(errmsg);
  7489     free(errmsg);
  9006     return -1;
  7490     return -1;
  9027     return -1;
  7511     return -1;
  9028   }
  7512   }
  9029 
  7513 
  9030   /* first parse the standard library file... */
  7514   /* first parse the standard library file... */
  9031   yyin = lib_file;
  7515   yyin = lib_file;
  9032   yylineno = 1;
       
  9033   allow_function_overloading = true;
  7516   allow_function_overloading = true;
  9034   current_filename = libfilename;
  7517   current_filename = libfilename;
       
  7518   current_tracking = GetNewTracking(yyin);
  9035   if (yyparse() != 0)
  7519   if (yyparse() != 0)
  9036       ERROR;
  7520       ERROR;
  9037 
  7521 
  9038   if (yynerrs > 0) {
  7522   if (yynerrs > 0) {
  9039     fprintf (stderr, "\nFound %d error(s) in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
  7523     fprintf (stderr, "\nFound %d error(s) in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
  9059   yydebug = 1;
  7543   yydebug = 1;
  9060 #endif
  7544 #endif
  9061 
  7545 
  9062   /* now parse the input file... */
  7546   /* now parse the input file... */
  9063   yyin = in_file;
  7547   yyin = in_file;
  9064   yylineno = 1;
       
  9065   allow_function_overloading = false;
  7548   allow_function_overloading = false;
  9066   current_filename = filename;
  7549   current_filename = filename;
       
  7550   current_tracking = GetNewTracking(yyin);
  9067   {int res;
  7551   {int res;
  9068     if ((res = yyparse()) != 0) {
  7552     if ((res = yyparse()) != 0) {
  9069       fprintf (stderr, "\nInternal error while parsing file - yyparse() returned %d. Bailing out!\n", res);
  7553       fprintf (stderr, "\nParsing failed because of too many consecutive syntax errors. Bailing out!\n");
  9070       ERROR;
  7554   		exit(EXIT_FAILURE);
  9071     }
  7555   	}
  9072   }
  7556   }
  9073 
  7557 
  9074   if (yynerrs > 0) {
  7558   if (yynerrs > 0) {
  9075     fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */);
  7559     fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */);
  9076     exit(EXIT_FAILURE);
  7560     exit(EXIT_FAILURE);