Merged
authorLaurent Bessard
Fri, 08 Mar 2013 01:01:15 +0100
changeset 799 214c9dced257
parent 798 d21e598b0b75 (diff)
parent 715 134f110060db (current diff)
child 800 2481fffe6e58
Merged
lib/iec_std_lib.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,824 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/common.mk \
+	$(top_srcdir)/config/config.h.in $(top_srcdir)/configure \
+	COPYING config/INSTALL config/depcomp config/install-sh \
+	config/ltmain.sh config/missing config/ylwrap
+bin_PROGRAMS = iec2c$(EXEEXT) iec2iec$(EXEEXT)
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_iec2c_OBJECTS = main.$(OBJEXT)
+iec2c_OBJECTS = $(am_iec2c_OBJECTS)
+iec2c_DEPENDENCIES = stage1_2/libstage1_2.a stage3/libstage3.a \
+	stage4/generate_c/libstage4_c.a absyntax/libabsyntax.a \
+	absyntax_utils/libabsyntax_utils.a
+am_iec2iec_OBJECTS = main.$(OBJEXT)
+iec2iec_OBJECTS = $(am_iec2iec_OBJECTS)
+iec2iec_DEPENDENCIES = stage1_2/libstage1_2.a stage3/libstage3.a \
+	stage4/generate_iec/libstage4_iec.a absyntax/libabsyntax.a \
+	absyntax_utils/libabsyntax_utils.a
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(iec2c_SOURCES) $(iec2iec_SOURCES)
+DIST_SOURCES = $(iec2c_SOURCES) $(iec2iec_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused \
+	-DHGVERSION="\"${HGVERSION}\""
+SUBDIRS = absyntax absyntax_utils stage1_2 stage3 stage4 
+ACLOCAL_AMFLAGS = -I config
+HGVERSION = $(shell hg -R $(top_srcdir) parents --template '{node|short}' 2> /dev/null || grep node $(top_srcdir)/.hg_archival.txt 2> /dev/null || true )
+iec2c_LDADD = stage1_2/libstage1_2.a \
+	stage3/libstage3.a \
+	stage4/generate_c/libstage4_c.a \
+	absyntax/libabsyntax.a \
+	absyntax_utils/libabsyntax_utils.a 
+
+iec2iec_LDADD = stage1_2/libstage1_2.a \
+	stage3/libstage3.a \
+	stage4/generate_iec/libstage4_iec.a \
+	absyntax/libabsyntax.a \
+	absyntax_utils/libabsyntax_utils.a 
+
+iec2c_SOURCES = main.cc
+iec2iec_SOURCES = main.cc
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+am--refresh: Makefile
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config/config.h: config/stamp-h1
+	@if test ! -f $@; then rm -f config/stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; else :; fi
+
+config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status
+	@rm -f config/stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config/config.h
+$(top_srcdir)/config/config.h.in:  $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f config/stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config/config.h config/stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	      echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	      $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+iec2c$(EXEEXT): $(iec2c_OBJECTS) $(iec2c_DEPENDENCIES) $(EXTRA_iec2c_DEPENDENCIES) 
+	@rm -f iec2c$(EXEEXT)
+	$(CXXLINK) $(iec2c_OBJECTS) $(iec2c_LDADD) $(LIBS)
+iec2iec$(EXEEXT): $(iec2iec_OBJECTS) $(iec2iec_DEPENDENCIES) $(EXTRA_iec2iec_DEPENDENCIES) 
+	@rm -f iec2iec$(EXEEXT)
+	$(CXXLINK) $(iec2iec_OBJECTS) $(iec2iec_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+	install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-binPROGRAMS \
+	clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \
+	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-binPROGRAMS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-binPROGRAMS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,497 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = absyntax
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libabsyntax_a_AR = $(AR) $(ARFLAGS)
+libabsyntax_a_LIBADD =
+am_libabsyntax_a_OBJECTS = absyntax.$(OBJEXT) visitor.$(OBJEXT)
+libabsyntax_a_OBJECTS = $(am_libabsyntax_a_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(libabsyntax_a_SOURCES)
+DIST_SOURCES = $(libabsyntax_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+lib_LIBRARIES = libabsyntax.a
+libabsyntax_a_SOURCES = \
+	absyntax.cc \
+	visitor.cc
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign absyntax/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign absyntax/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  if test -f $$p; then \
+	    $(am__strip_dir) \
+	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libabsyntax.a: $(libabsyntax_a_OBJECTS) $(libabsyntax_a_DEPENDENCIES) $(EXTRA_libabsyntax_a_DEPENDENCIES) 
+	-rm -f libabsyntax.a
+	$(libabsyntax_a_AR) libabsyntax.a $(libabsyntax_a_OBJECTS) $(libabsyntax_a_LIBADD)
+	$(RANLIB) libabsyntax.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/absyntax.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visitor.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- a/absyntax/absyntax.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax/absyntax.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -76,46 +76,58 @@
 
 
 
-
+# define LIST_CAP_INIT 8
+# define LIST_CAP_INCR 8
 
 list_c::list_c(
                int fl, int fc, const char *ffile, long int forder,
                int ll, int lc, const char *lfile, long int lorder)
-  :symbol_c(fl, fc, ffile, forder, ll, lc, lfile, lorder) {
+  :symbol_c(fl, fc, ffile, forder, ll, lc, lfile, lorder),c(LIST_CAP_INIT) {
   n = 0;
-  elements = NULL;
-}
+  elements = (symbol_c**)malloc(LIST_CAP_INIT*sizeof(symbol_c*));
+  if (NULL == elements) ERROR_MSG("out of memory");
+}
+
 
 list_c::list_c(symbol_c *elem, 
                int fl, int fc, const char *ffile, long int forder,
                int ll, int lc, const char *lfile, long int lorder)
-  :symbol_c(fl, fc, ffile, forder, ll, lc, lfile, lorder) {
+  :symbol_c(fl, fc, ffile, forder, ll, lc, lfile, lorder),c(LIST_CAP_INIT) { 
   n = 0;
-  elements = NULL;
-  add_element(elem);
-}
+  elements = (symbol_c**)malloc(LIST_CAP_INIT*sizeof(symbol_c*));
+  if (NULL == elements) ERROR_MSG("out of memory");
+  add_element(elem); 
+}
+
 
 /* append a new element to the end of the list */
 void list_c::add_element(symbol_c *elem) {
-//printf("list_c::add_element()\n");
-  n++;
-  elements = (symbol_c **)realloc(elements, n * sizeof(symbol_c *));
-  if (elements == NULL)
-    ERROR_MSG("Out of memory");
-  elements[n - 1] = elem;
+  // printf("list_c::add_element()\n");
+  if (c <= n)
+    if (!(elements=(symbol_c**)realloc(elements,(c+=LIST_CAP_INCR)*sizeof(symbol_c *))))
+      ERROR_MSG("out of memory");
+  elements[n++] = elem;
  
-  if (elem == NULL)
-    return;
+  if (NULL == elem) return;
 
   /* adjust the location parameters, taking into account the new element. */
-  if ((first_line == elem->first_line) &&
-      (first_column > elem->first_column)) {
+  if (NULL == first_file) {
+    first_file = elem->first_file;
+    first_line = elem->first_line;
+    first_column = elem->first_column;
+  }
+  if ((first_line == elem->first_line) && (first_column > elem->first_column)) {
     first_column = elem->first_column;
   }
   if (first_line > elem->first_line) {
     first_line = elem->first_line;
     first_column = elem->first_column;
   }
+  if (NULL == last_file) {
+    last_file = elem->last_file;
+    last_line = elem->last_line;
+    last_column = elem->last_column;
+  }
   if ((last_line == elem->last_line) &&
       (last_column < elem->last_column)) {
     last_column = elem->last_column;
@@ -130,26 +142,28 @@
 /* To insert into the begining of list, call with pos=0  */
 /* To insert into the end of list, call with pos=list->n */
 void list_c::insert_element(symbol_c *elem, int pos) {
-  if (pos > n) ERROR;
+  if((pos<0) || (n<pos)) ERROR;
   
   /* add new element to end of list. Basically alocate required memory... */
   /* will also increment n by 1 ! */
   add_element(elem);
   /* if not inserting into end position, shift all elements up one position, to open up a slot in pos for new element */
-  if (pos < (n-1)) for (int i = n-2; i >= pos; i--) elements[i+1] = elements[i];
-  elements[pos] = elem;
+  if(pos < (n-1)){ 
+    for(int i=n-2 ; i>=pos ; --i) elements[i+1] = elements[i];
+    elements[pos] = elem;
+  }
 }
 
 
 /* remove element at position pos. */
 void list_c::remove_element(int pos) {
-  if (pos > n) ERROR;
+  if((pos<0) || (n<=pos)) ERROR;
   
   /* Shift all elements down one position, starting at the entry to delete. */
   for (int i = pos; i < n-1; i++) elements[i] = elements[i+1];
-  /* corrent the new size, and free unused memory */
+  /* corrent the new size */
   n--;
-  elements = (symbol_c **)realloc(elements, n * sizeof(symbol_c *));
+  /* elements = (symbol_c **)realloc(elements, n * sizeof(symbol_c *)); */
 }
 
 #define SYM_LIST(class_name_c, ...)								\
--- a/absyntax/absyntax.def	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax/absyntax.def	Fri Mar 08 01:01:15 2013 +0100
@@ -114,7 +114,8 @@
 /***************************/
 /* B 0 - Programming Model */
 /***************************/
-SYM_LIST(library_c)
+/* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
+SYM_LIST(library_c, enumvalue_symtable_t enumvalue_symtable;)
 
 
 /*************************/
@@ -701,7 +702,8 @@
 /***********************/
 /* B 1.5.1 - Functions */
 /***********************/
-SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body)
+/* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
+SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body, enumvalue_symtable_t enumvalue_symtable;)
 
 /* intermediate helper symbol for
  * - function_declaration
@@ -721,7 +723,8 @@
 /* B 1.5.2 - Function Blocks */
 /*****************************/
 /*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
-SYM_REF3(function_block_declaration_c, fblock_name, var_declarations, fblock_body)
+/* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
+SYM_REF3(function_block_declaration_c, fblock_name, var_declarations, fblock_body, enumvalue_symtable_t enumvalue_symtable;)
 
 /* intermediate helper symbol for function_declaration */
 /*  { io_var_declarations | other_var_declarations }   */
@@ -743,7 +746,8 @@
 /* B 1.5.3 - Programs */
 /**********************/
 /*  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */
-SYM_REF3(program_declaration_c, program_type_name, var_declarations, function_block_body)
+/* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
+SYM_REF3(program_declaration_c, program_type_name, var_declarations, function_block_body, enumvalue_symtable_t enumvalue_symtable;)
 
 /* intermediate helper symbol for program_declaration_c */
 /*  { io_var_declarations | other_var_declarations }   */
@@ -826,7 +830,8 @@
    optional_instance_specific_initializations
 END_CONFIGURATION
 */
-SYM_REF5(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations)
+/* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
+SYM_REF5(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations, enumvalue_symtable_t enumvalue_symtable;)
 
 /* helper symbol for configuration_declaration */
 SYM_LIST(resource_declaration_list_c)
@@ -837,7 +842,8 @@
    single_resource_declaration
 END_RESOURCE
 */
-SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration)
+/* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
+SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration, enumvalue_symtable_t enumvalue_symtable;)
 
 /* task_configuration_list program_configuration_list */
 SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list)
@@ -908,11 +914,12 @@
 SYM_LIST(instruction_list_c)
 
 /* | label ':' [il_incomplete_instruction] eol_list */
-/* NOTE: The parameter 'prev_il_instruction' is used to point to all previous il instructions that may be executed imedaitely before this instruction.
- *       In case of an il instruction preceded by a label, this will include all IL instructions that jump to this label!
+/* NOTE: The parameters 'prev_il_instruction'/'next_il_instruction' are used to point to all previous/next il instructions that may be executed imedaitely before/after this instruction.
+ *       In case of an il instruction preceded by a label, the previous_il_instruction will include all IL instructions that jump to this label!
  *       It is filled in by the flow_control_analysis_c during stage 3.
- */
-SYM_REF2(il_instruction_c, label, il_instruction, std::vector <symbol_c *> prev_il_instruction;)
+ *       This will essentially be a doubly linked list of il_instruction_c and il_simple_instruction_c objects!!
+ */
+SYM_REF2(il_instruction_c, label, il_instruction, std::vector <symbol_c *> prev_il_instruction, next_il_instruction;)
 
 
 /* | il_simple_operator [il_operand] */
@@ -927,6 +934,12 @@
 
 
 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
+/* WARNING
+ *   The semantics of the il_expression_c.il_operand member is NOT what you may expect!
+ *   In order to simplify processing of the IL code, stage2 will prepend an artifical (and equivalent) 'LD <il_operand>' IL instruction into the simple_instr_list
+ *   The il_expression_c.il_operand is maintained, in case we really need to handle it as a special case!
+ *   See the comments in iec_bison.yy for details and an example.
+ */
 SYM_REF3(il_expression_c, il_expr_operator, il_operand, simple_instr_list)
 
 /*  il_jump_operator label */
@@ -960,8 +973,12 @@
  * | il_expression eol_list
  * | il_formal_funct_call eol_list
  */
-/* NOTE: The parameter 'prev_il_instruction' is used to point to all previous il instructions that may be executed imedaitely before this instruction. */
-SYM_REF1(il_simple_instruction_c, il_simple_instruction, std::vector <symbol_c *> prev_il_instruction;)
+/* NOTE: The parameters 'prev_il_instruction'/'next_il_instruction' are used to point to all previous/next il instructions that may be executed imedaitely before/after this instruction.
+ *       In case of an il instruction preceded by a label, the previous_il_instruction will include all IL instructions that jump to this label!
+ *       It is filled in by the flow_control_analysis_c during stage 3.
+ *       This will essentially be a doubly linked list of il_instruction_c and il_simple_instruction_c objects!!
+ */
+SYM_REF1(il_simple_instruction_c, il_simple_instruction, std::vector <symbol_c *> prev_il_instruction, next_il_instruction;)
 
 /* | il_initial_param_list il_param_instruction */
 SYM_LIST(il_param_list_c)
--- a/absyntax/absyntax.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax/absyntax.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -48,6 +48,7 @@
 
 #include <stdio.h> // required for NULL
 #include <vector>
+#include <map>
 #include <string>
 #include <stdint.h>  // required for uint64_t, etc...
 #include "../main.hh" // required for uint8_t, real_64_t, ..., and the macros INT8_MAX, REAL32_MAX, ... */
@@ -72,6 +73,28 @@
 
 
 
+/* Case insensitive string compare */
+  /* Case insensitive string compare copied from
+   * "The C++ Programming Language" - 3rd Edition
+   * by Bjarne Stroustrup, ISBN 0201889544.
+   */
+class nocasecmp_c {
+    public:
+      bool operator() (const std::string& x, const std::string& y) const {
+        std::string::const_iterator ix = x.begin();
+        std::string::const_iterator iy = y.begin();
+
+        for(; (ix != x.end()) && (iy != y.end()) && (toupper(*ix) == toupper(*iy)); ++ix, ++iy);
+        if (ix == x.end()) return (iy != y.end());
+        if (iy == y.end()) return false;
+        return (toupper(*ix) < toupper(*iy));
+      };
+  };
+
+
+
+
+
 
 
 
@@ -80,6 +103,9 @@
 class symbol_c {
 
   public:
+    /* WARNING: only use this method for debugging purposes!! */
+    virtual const char *absyntax_cname(void) {return "symbol_c";};
+
     /*
      * Line number for the purposes of error checking.
      * Annotated (inserted) by stage1_2
@@ -96,7 +122,7 @@
 
     /*
      * Annotations produced during stage 3
-     */
+     */    
     /*** Data type analysis ***/
     std::vector <symbol_c *> candidate_datatypes; /* All possible data types the expression/literal/etc. may take. Filled in stage3 by fill_candidate_datatypes_c class */
     /* Data type of the expression/literal/etc. Filled in stage3 by narrow_candidate_datatypes_c 
@@ -117,15 +143,15 @@
      * having more than one entry filled in!
      */
     typedef enum { cs_undefined,   /* not defined/not yet evaluated --> const_value is not valid! */
-                   cs_non_const,   /* we have deternmined that expression is not a const value --> const_value is not valid! */
+                   cs_non_const,   /* we have determined that expression is not a const value --> const_value is not valid! */
                    cs_const_value, /* const value is valid */
                    cs_overflow     /* result produced overflow or underflow --> const_value is not valid! */
                  } const_status_t;
  
-    typedef struct {const_status_t status;  real64_t  value; } const_value_real64_t;
-    typedef struct {const_status_t status;   int64_t  value; } const_value_int64_t;
-    typedef struct {const_status_t status;  uint64_t  value; } const_value_uint64_t;
-    typedef struct {const_status_t status;      bool  value; } const_value_bool_t;
+    typedef struct const_value_real64_s {const_status_t status;  real64_t  value;  const_value_real64_s (): status(cs_undefined), value(0.0)   {} } const_value_real64_t;
+    typedef struct const_value_int64_s  {const_status_t status;   int64_t  value;  const_value_int64_s  (): status(cs_undefined), value(0)     {} } const_value_int64_t;
+    typedef struct const_value_uint64_s {const_status_t status;  uint64_t  value;  const_value_uint64_s (): status(cs_undefined), value(0)     {} } const_value_uint64_t;
+    typedef struct const_value_bool_s   {const_status_t status;      bool  value;  const_value_bool_s   (): status(cs_undefined), value(false) {} } const_value_bool_t;
 
     typedef struct {
       const_value_real64_t _real64; /* status is initialised to UNDEFINED */
@@ -135,6 +161,12 @@
     } const_value_t;
     const_value_t const_value;
     
+    /*** Enumeration datatype checking ***/    
+    /* Not all symbols will contain the following anotations, which is why they are not declared here in symbol_c
+     * They will be declared only inside the symbols that require them (have a look at absyntax.def)
+     */
+    typedef std::multimap<std::string, symbol_c *, nocasecmp_c> enumvalue_symtable_t;
+    
 
   public:
     /* default constructor */
@@ -150,8 +182,13 @@
 };
 
 
+
+
 class token_c: public symbol_c {
   public:
+    /* WARNING: only use this method for debugging purposes!! */
+    virtual const char *absyntax_cname(void) {return "token_c";};
+
     /* the value of the symbol. */
     const char *value;
 
@@ -163,10 +200,15 @@
 };
 
 
+
+
  /* a list of symbols... */
 class list_c: public symbol_c {
   public:
-    int n;
+    /* WARNING: only use this method for debugging purposes!! */
+    virtual const char *absyntax_cname(void) {return "list_c";};
+
+    int c,n; /* c: current capacity of list (malloc'd memory);  n: current number of elements in list */
     symbol_c **elements;
 
   public:
@@ -191,6 +233,11 @@
 
 
 
+
+
+
+
+
 #define SYM_LIST(class_name_c, ...)											\
 class class_name_c:	public list_c {											\
   public:														\
@@ -203,6 +250,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -215,6 +264,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -227,6 +278,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -240,6 +293,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -255,6 +310,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -272,6 +329,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -291,6 +350,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -312,6 +373,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
@@ -335,6 +398,8 @@
                  int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0,			\
                  int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0);			\
     virtual void *accept(visitor_c &visitor);										\
+    /* WARNING: only use this method for debugging purposes!! */							\
+    virtual const char *absyntax_cname(void) {return #class_name_c;};							\
 };
 
 
--- a/absyntax/visitor.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax/visitor.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -70,7 +70,7 @@
 
 null_visitor_c::~null_visitor_c(void) {return;}
 
-#define SYM_LIST(class_name_c)	\
+#define SYM_LIST(class_name_c, ...)	\
   void *null_visitor_c::visit(class_name_c *symbol) {return NULL;}
 
 #define SYM_TOKEN(class_name_c, ...)	\
@@ -118,86 +118,31 @@
 
 
 
-/**********************/
-/* iterator_visitor_c */
-/**********************/
-
-iterator_visitor_c::~iterator_visitor_c(void) {return;}
-
-
-void *iterator_visitor_c::visit_list(list_c *list) {
-  for(int i = 0; i < list->n; i++) {
-    list->elements[i]->accept(*this);
-  }
-  return NULL;
-}
-
-
-#define SYM_LIST(class_name_c)	\
-  void *iterator_visitor_c::visit(class_name_c *symbol) {return visit_list(symbol);}
-
-#define SYM_TOKEN(class_name_c, ...)	\
-  void *iterator_visitor_c::visit(class_name_c *symbol) {return NULL;}
-
-#define SYM_REF0(class_name_c, ...)	\
-  void *iterator_visitor_c::visit(class_name_c *symbol) {return NULL;}
-
-#define SYM_REF1(class_name_c, ref1, ...)			\
-void *iterator_visitor_c::visit(class_name_c *symbol) {	\
-  if (symbol->ref1!=NULL) symbol->ref1->accept(*this);	\
-  return NULL;						\
-}
-
-#define SYM_REF2(class_name_c, ref1, ref2, ...)		\
-void *iterator_visitor_c::visit(class_name_c *symbol) {	\
-  if (symbol->ref1!=NULL) symbol->ref1->accept(*this);	\
-  if (symbol->ref2!=NULL) symbol->ref2->accept(*this);	\
-  return NULL;						\
-}
-
-#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)			\
-void *iterator_visitor_c::visit(class_name_c *symbol) {			\
-  if (symbol->ref1) symbol->ref1->accept(*this);			\
-  if (symbol->ref2) symbol->ref2->accept(*this);			\
-  if (symbol->ref3) symbol->ref3->accept(*this);			\
-  return NULL;								\
-}
-
-#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)		\
-void *iterator_visitor_c::visit(class_name_c *symbol) {			\
-  if (symbol->ref1) symbol->ref1->accept(*this);			\
-  if (symbol->ref2) symbol->ref2->accept(*this);			\
-  if (symbol->ref3) symbol->ref3->accept(*this);			\
-  if (symbol->ref4) symbol->ref4->accept(*this);			\
-  return NULL;								\
-}
-
-#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)	\
-void *iterator_visitor_c::visit(class_name_c *symbol) {			\
-  if (symbol->ref1) symbol->ref1->accept(*this);			\
-  if (symbol->ref2) symbol->ref2->accept(*this);			\
-  if (symbol->ref3) symbol->ref3->accept(*this);			\
-  if (symbol->ref4) symbol->ref4->accept(*this);			\
-  if (symbol->ref5) symbol->ref5->accept(*this);			\
-  return NULL;								\
-}
-
-#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)	\
-void *iterator_visitor_c::visit(class_name_c *symbol) {			\
-  if (symbol->ref1) symbol->ref1->accept(*this);			\
-  if (symbol->ref2) symbol->ref2->accept(*this);			\
-  if (symbol->ref3) symbol->ref3->accept(*this);			\
-  if (symbol->ref4) symbol->ref4->accept(*this);			\
-  if (symbol->ref5) symbol->ref5->accept(*this);			\
-  if (symbol->ref6) symbol->ref6->accept(*this);			\
-  return NULL;								\
-}
-
-
-
-#include "absyntax.def"
-
-
+
+/*******************/
+/* fcall_visitor_c */
+/*******************/
+
+//fcall_visitor_c::~fcall_visitor_c(void) {return;};
+
+
+// void fcall_visitor_c::fcall(symbol_c *symbol) {return;};
+
+#define VISIT_METHOD {fcall(symbol); return NULL;}
+
+#define SYM_LIST(class_name_c, ...)                                             void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_TOKEN(class_name_c, ...)                                            void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF0(class_name_c, ...)                                             void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF1(class_name_c, ref1, ...)                                       void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF2(class_name_c, ref1, ref2, ...)                                 void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)                           void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)                     void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)               void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)         void *fcall_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+
+#include "../absyntax/absyntax.def"
+
+#undef VISIT_METHOD
 
 #undef SYM_LIST
 #undef SYM_TOKEN
@@ -214,104 +159,78 @@
 
 
 
-
-
-
-
-/********************/
-/* search_visitor_c */
-/********************/
-
-search_visitor_c::~search_visitor_c(void) {return;}
-
-
-void *search_visitor_c::visit_list(list_c *list) {
+/**********************/
+/* iterator_visitor_c */
+/**********************/
+
+iterator_visitor_c::~iterator_visitor_c(void) {return;}
+
+
+void *iterator_visitor_c::visit_list(list_c *list) {
   for(int i = 0; i < list->n; i++) {
-    void *res = list->elements[i]->accept(*this);
-    if (res != NULL)
-      return res;
+    list->elements[i]->accept(*this);
   }
   return NULL;
 }
 
 
-#define SYM_LIST(class_name_c)	\
-  void *search_visitor_c::visit(class_name_c *symbol) {return visit_list(symbol);}
+#define SYM_LIST(class_name_c, ...)	\
+  void *iterator_visitor_c::visit(class_name_c *symbol) {return visit_list(symbol);}
 
 #define SYM_TOKEN(class_name_c, ...)	\
-  void *search_visitor_c::visit(class_name_c *symbol) {return NULL;}
+  void *iterator_visitor_c::visit(class_name_c *symbol) {return NULL;}
 
 #define SYM_REF0(class_name_c, ...)	\
-  void *search_visitor_c::visit(class_name_c *symbol) {return NULL;}
-
-#define SYM_REF1(class_name_c, ref1, ...)				\
-void *search_visitor_c::visit(class_name_c *symbol) {		\
-  if (symbol->ref1) return symbol->ref1->accept(*this);		\
-  return NULL;							\
-}
-
-#define SYM_REF2(class_name_c, ref1, ref2, ...)			\
-void *search_visitor_c::visit(class_name_c *symbol) {		\
-  void *res = NULL;						\
-  if (symbol->ref1) res =  symbol->ref1->accept(*this);		\
-  if (res != NULL)  return res;					\
-  if (symbol->ref2) return symbol->ref2->accept(*this);		\
-  return NULL;							\
-}
-
-#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)		\
-void *search_visitor_c::visit(class_name_c *symbol) {		\
-  void *res = NULL;						\
-  if (symbol->ref1) res =  symbol->ref1->accept(*this);		\
-  if (res != NULL)  return res;					\
-  if (symbol->ref2) res =  symbol->ref2->accept(*this);		\
-  if (res != NULL)  return res;					\
-  if (symbol->ref3) return symbol->ref3->accept(*this);		\
-  return NULL;							\
+  void *iterator_visitor_c::visit(class_name_c *symbol) {return NULL;}
+
+#define SYM_REF1(class_name_c, ref1, ...)			\
+void *iterator_visitor_c::visit(class_name_c *symbol) {	\
+  if (symbol->ref1!=NULL) symbol->ref1->accept(*this);	\
+  return NULL;						\
+}
+
+#define SYM_REF2(class_name_c, ref1, ref2, ...)		\
+void *iterator_visitor_c::visit(class_name_c *symbol) {	\
+  if (symbol->ref1!=NULL) symbol->ref1->accept(*this);	\
+  if (symbol->ref2!=NULL) symbol->ref2->accept(*this);	\
+  return NULL;						\
+}
+
+#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)			\
+void *iterator_visitor_c::visit(class_name_c *symbol) {			\
+  if (symbol->ref1) symbol->ref1->accept(*this);			\
+  if (symbol->ref2) symbol->ref2->accept(*this);			\
+  if (symbol->ref3) symbol->ref3->accept(*this);			\
+  return NULL;								\
 }
 
 #define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)		\
-void *search_visitor_c::visit(class_name_c *symbol) {		\
-  void *res = NULL;						\
-  if (symbol->ref1) res =  symbol->ref1->accept(*this);		\
-  if (res != NULL)  return res;					\
-  if (symbol->ref2) res =  symbol->ref2->accept(*this);		\
-  if (res != NULL)  return res;					\
-  if (symbol->ref3) res =  symbol->ref3->accept(*this);		\
-  if (res != NULL)  return res;					\
-  if (symbol->ref4) return symbol->ref4->accept(*this);		\
-  return NULL;							\
-}
-
-#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)		\
-void *search_visitor_c::visit(class_name_c *symbol) {			\
-  void *res = NULL;							\
-  if (symbol->ref1) res =  symbol->ref1->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref2) res =  symbol->ref2->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref3) res =  symbol->ref3->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref4) res =  symbol->ref4->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref5) return symbol->ref5->accept(*this);			\
+void *iterator_visitor_c::visit(class_name_c *symbol) {			\
+  if (symbol->ref1) symbol->ref1->accept(*this);			\
+  if (symbol->ref2) symbol->ref2->accept(*this);			\
+  if (symbol->ref3) symbol->ref3->accept(*this);			\
+  if (symbol->ref4) symbol->ref4->accept(*this);			\
+  return NULL;								\
+}
+
+#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)	\
+void *iterator_visitor_c::visit(class_name_c *symbol) {			\
+  if (symbol->ref1) symbol->ref1->accept(*this);			\
+  if (symbol->ref2) symbol->ref2->accept(*this);			\
+  if (symbol->ref3) symbol->ref3->accept(*this);			\
+  if (symbol->ref4) symbol->ref4->accept(*this);			\
+  if (symbol->ref5) symbol->ref5->accept(*this);			\
   return NULL;								\
 }
 
 #define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)	\
-void *search_visitor_c::visit(class_name_c *symbol) {			\
-  void *res = NULL;							\
-  if (symbol->ref1) res =  symbol->ref1->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref2) res =  symbol->ref2->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref3) res =  symbol->ref3->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref4) res =  symbol->ref4->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref5) res =  symbol->ref5->accept(*this);			\
-  if (res != NULL)  return res;						\
-  if (symbol->ref6) return symbol->ref6->accept(*this);			\
+void *iterator_visitor_c::visit(class_name_c *symbol) {			\
+  if (symbol->ref1) symbol->ref1->accept(*this);			\
+  if (symbol->ref2) symbol->ref2->accept(*this);			\
+  if (symbol->ref3) symbol->ref3->accept(*this);			\
+  if (symbol->ref4) symbol->ref4->accept(*this);			\
+  if (symbol->ref5) symbol->ref5->accept(*this);			\
+  if (symbol->ref6) symbol->ref6->accept(*this);			\
   return NULL;								\
 }
 
@@ -335,10 +254,174 @@
 
 
 
-
-
-
-
-
-
-
+/****************************/
+/* fcall_iterator_visitor_c */
+/****************************/
+
+fcall_iterator_visitor_c::~fcall_iterator_visitor_c(void) {return;};
+
+void fcall_iterator_visitor_c::prefix_fcall(symbol_c *symbol) {return;};
+void fcall_iterator_visitor_c::suffix_fcall(symbol_c *symbol) {return;};
+
+#define VISIT_METHOD {\
+  prefix_fcall(symbol);                \
+  iterator_visitor_c::visit(symbol);   \
+  suffix_fcall(symbol);                \
+  return NULL;                         \
+}
+
+#define SYM_LIST(class_name_c, ...)                                             void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_TOKEN(class_name_c, ...)                                            void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF0(class_name_c, ...)                                             void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF1(class_name_c, ref1, ...)                                       void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF2(class_name_c, ref1, ref2, ...)                                 void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)                           void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)                     void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)               void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)         void *fcall_iterator_visitor_c::visit(class_name_c *symbol) VISIT_METHOD;
+
+#include "../absyntax/absyntax.def"
+
+#undef VISIT_METHOD
+
+#undef SYM_LIST
+#undef SYM_TOKEN
+#undef SYM_REF0
+#undef SYM_REF1
+#undef SYM_REF2
+#undef SYM_REF3
+#undef SYM_REF4
+#undef SYM_REF5
+#undef SYM_REF6
+
+
+
+
+
+
+
+
+/********************/
+/* search_visitor_c */
+/********************/
+
+search_visitor_c::~search_visitor_c(void) {return;}
+
+
+void *search_visitor_c::visit_list(list_c *list) {
+  for(int i = 0; i < list->n; i++) {
+    void *res = list->elements[i]->accept(*this);
+    if (res != NULL)
+      return res;
+  }
+  return NULL;
+}
+
+
+#define SYM_LIST(class_name_c, ...)	\
+  void *search_visitor_c::visit(class_name_c *symbol) {return visit_list(symbol);}
+
+#define SYM_TOKEN(class_name_c, ...)	\
+  void *search_visitor_c::visit(class_name_c *symbol) {return NULL;}
+
+#define SYM_REF0(class_name_c, ...)	\
+  void *search_visitor_c::visit(class_name_c *symbol) {return NULL;}
+
+#define SYM_REF1(class_name_c, ref1, ...)				\
+void *search_visitor_c::visit(class_name_c *symbol) {		\
+  if (symbol->ref1) return symbol->ref1->accept(*this);		\
+  return NULL;							\
+}
+
+#define SYM_REF2(class_name_c, ref1, ref2, ...)			\
+void *search_visitor_c::visit(class_name_c *symbol) {		\
+  void *res = NULL;						\
+  if (symbol->ref1) res =  symbol->ref1->accept(*this);		\
+  if (res != NULL)  return res;					\
+  if (symbol->ref2) return symbol->ref2->accept(*this);		\
+  return NULL;							\
+}
+
+#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)		\
+void *search_visitor_c::visit(class_name_c *symbol) {		\
+  void *res = NULL;						\
+  if (symbol->ref1) res =  symbol->ref1->accept(*this);		\
+  if (res != NULL)  return res;					\
+  if (symbol->ref2) res =  symbol->ref2->accept(*this);		\
+  if (res != NULL)  return res;					\
+  if (symbol->ref3) return symbol->ref3->accept(*this);		\
+  return NULL;							\
+}
+
+#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)		\
+void *search_visitor_c::visit(class_name_c *symbol) {		\
+  void *res = NULL;						\
+  if (symbol->ref1) res =  symbol->ref1->accept(*this);		\
+  if (res != NULL)  return res;					\
+  if (symbol->ref2) res =  symbol->ref2->accept(*this);		\
+  if (res != NULL)  return res;					\
+  if (symbol->ref3) res =  symbol->ref3->accept(*this);		\
+  if (res != NULL)  return res;					\
+  if (symbol->ref4) return symbol->ref4->accept(*this);		\
+  return NULL;							\
+}
+
+#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)		\
+void *search_visitor_c::visit(class_name_c *symbol) {			\
+  void *res = NULL;							\
+  if (symbol->ref1) res =  symbol->ref1->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref2) res =  symbol->ref2->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref3) res =  symbol->ref3->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref4) res =  symbol->ref4->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref5) return symbol->ref5->accept(*this);			\
+  return NULL;								\
+}
+
+#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)	\
+void *search_visitor_c::visit(class_name_c *symbol) {			\
+  void *res = NULL;							\
+  if (symbol->ref1) res =  symbol->ref1->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref2) res =  symbol->ref2->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref3) res =  symbol->ref3->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref4) res =  symbol->ref4->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref5) res =  symbol->ref5->accept(*this);			\
+  if (res != NULL)  return res;						\
+  if (symbol->ref6) return symbol->ref6->accept(*this);			\
+  return NULL;								\
+}
+
+
+
+#include "absyntax.def"
+
+
+
+#undef SYM_LIST
+#undef SYM_TOKEN
+#undef SYM_REF0
+#undef SYM_REF1
+#undef SYM_REF2
+#undef SYM_REF3
+#undef SYM_REF4
+#undef SYM_REF5
+#undef SYM_REF6
+
+
+
+
+
+
+
+
+
+
+
+
--- a/absyntax/visitor.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax/visitor.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -78,32 +78,15 @@
 
 
 
-#define SYM_LIST(class_name_c, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_TOKEN(class_name_c, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF0(class_name_c, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF1(class_name_c, ref1, ...)		\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF2(class_name_c, ref1, ref2, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)		\
-  virtual void *visit(class_name_c *symbol) = 0;
-
-#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)	\
-  virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_LIST(class_name_c, ...)                                             virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_TOKEN(class_name_c, ...)                                            virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF0(class_name_c, ...)                                             virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF1(class_name_c, ref1, ...)                                       virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF2(class_name_c, ref1, ref2, ...)                                 virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)                           virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)                     virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)               virtual void *visit(class_name_c *symbol) = 0;
+#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)         virtual void *visit(class_name_c *symbol) = 0;
 
 class visitor_c {
   public:
@@ -127,32 +110,15 @@
 
 
 
-#define SYM_LIST(class_name_c, ...)	\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_TOKEN(class_name_c, ...)	\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF0(class_name_c, ...)	\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF1(class_name_c, ref1, ...)		\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF2(class_name_c, ref1, ref2, ...)	\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)	\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)	\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)		\
-  virtual void *visit(class_name_c *symbol);
-
-#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)	\
-  virtual void *visit(class_name_c *symbol);
+#define SYM_LIST(class_name_c, ...)                                             virtual void *visit(class_name_c *symbol);
+#define SYM_TOKEN(class_name_c, ...)                                            virtual void *visit(class_name_c *symbol);
+#define SYM_REF0(class_name_c, ...)                                             virtual void *visit(class_name_c *symbol);
+#define SYM_REF1(class_name_c, ref1, ...)                                       virtual void *visit(class_name_c *symbol);
+#define SYM_REF2(class_name_c, ref1, ref2, ...)                                 virtual void *visit(class_name_c *symbol);
+#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...)                           virtual void *visit(class_name_c *symbol);
+#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...)                     virtual void *visit(class_name_c *symbol);
+#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...)               virtual void *visit(class_name_c *symbol);
+#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...)         virtual void *visit(class_name_c *symbol);
 
 
 
@@ -167,6 +133,21 @@
 
 
 
+
+
+class fcall_visitor_c: public visitor_c {
+  public:
+  virtual void fcall(symbol_c *symbol) = 0;
+
+  public:
+  #include "absyntax.def"
+
+//   virtual ~fcall_visitor_c(void);
+};
+
+
+
+
 class iterator_visitor_c: public visitor_c {
   protected:
   void *visit_list(list_c *list);
@@ -178,6 +159,24 @@
 };
 
 
+
+
+
+class fcall_iterator_visitor_c: public iterator_visitor_c {
+  public:
+  virtual void prefix_fcall(symbol_c *symbol);
+  virtual void suffix_fcall(symbol_c *symbol);
+
+  public:
+  #include "absyntax.def"
+
+  virtual ~fcall_iterator_visitor_c(void);
+};
+
+
+
+
+
 class search_visitor_c: public visitor_c {
   protected:
   void *visit_list(list_c *list);
@@ -199,4 +198,11 @@
 #undef SYM_REF5
 #undef SYM_REF6
 
+
+
+
+
+
+
+
 #endif /*  _VISITOR_HH */
--- a/absyntax_utils/Makefile.am	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/Makefile.am	Fri Mar 08 01:01:15 2013 +0100
@@ -15,8 +15,6 @@
 	get_var_name.cc \
 	search_il_label.cc \
 	search_base_type.cc \
-	search_constant_type.cc \
-	search_expression_type.cc \
 	search_fb_instance_decl.cc \
 	search_fb_typedecl.cc \
 	search_varfb_instance_type.cc \
@@ -26,8 +24,6 @@
 	search_varfb_instance_type.cc \
 	search_var_instance_decl.cc \
 	spec_init_separator.cc \
-	type_initial_value.cc 
-
-#search_il_operand_type.cc 
-#search_type_code.c
-
+	type_initial_value.cc \
+	debug_ast.cc \
+	get_datatype_info.cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,554 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = absyntax_utils
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libabsyntax_utils_a_AR = $(AR) $(ARFLAGS)
+libabsyntax_utils_a_LIBADD =
+am_libabsyntax_utils_a_OBJECTS = absyntax_utils.$(OBJEXT) \
+	add_en_eno_param_decl.$(OBJEXT) \
+	decompose_var_instance_name.$(OBJEXT) \
+	array_dimension_iterator.$(OBJEXT) \
+	case_element_iterator.$(OBJEXT) \
+	function_call_iterator.$(OBJEXT) \
+	function_call_param_iterator.$(OBJEXT) \
+	function_param_iterator.$(OBJEXT) \
+	get_sizeof_datatype.$(OBJEXT) get_var_name.$(OBJEXT) \
+	search_il_label.$(OBJEXT) search_base_type.$(OBJEXT) \
+	search_fb_instance_decl.$(OBJEXT) search_fb_typedecl.$(OBJEXT) \
+	search_varfb_instance_type.$(OBJEXT) \
+	search_var_instance_decl.$(OBJEXT) \
+	spec_init_separator.$(OBJEXT) type_initial_value.$(OBJEXT) \
+	search_varfb_instance_type.$(OBJEXT) \
+	search_var_instance_decl.$(OBJEXT) \
+	spec_init_separator.$(OBJEXT) type_initial_value.$(OBJEXT) \
+	debug_ast.$(OBJEXT) get_datatype_info.$(OBJEXT)
+libabsyntax_utils_a_OBJECTS = $(am_libabsyntax_utils_a_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(libabsyntax_utils_a_SOURCES)
+DIST_SOURCES = $(libabsyntax_utils_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+lib_LIBRARIES = libabsyntax_utils.a
+libabsyntax_utils_a_SOURCES = \
+	absyntax_utils.cc \
+	add_en_eno_param_decl.cc \
+	decompose_var_instance_name.cc \
+	array_dimension_iterator.cc \
+	case_element_iterator.cc \
+	function_call_iterator.cc \
+	function_call_param_iterator.cc \
+	function_param_iterator.cc \
+	get_sizeof_datatype.cc \
+	get_var_name.cc \
+	search_il_label.cc \
+	search_base_type.cc \
+	search_fb_instance_decl.cc \
+	search_fb_typedecl.cc \
+	search_varfb_instance_type.cc \
+	search_var_instance_decl.cc \
+	spec_init_separator.cc \
+	type_initial_value.cc \
+	search_varfb_instance_type.cc \
+	search_var_instance_decl.cc \
+	spec_init_separator.cc \
+	type_initial_value.cc \
+	debug_ast.cc \
+	get_datatype_info.cc
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign absyntax_utils/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign absyntax_utils/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  if test -f $$p; then \
+	    $(am__strip_dir) \
+	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libabsyntax_utils.a: $(libabsyntax_utils_a_OBJECTS) $(libabsyntax_utils_a_DEPENDENCIES) $(EXTRA_libabsyntax_utils_a_DEPENDENCIES) 
+	-rm -f libabsyntax_utils.a
+	$(libabsyntax_utils_a_AR) libabsyntax_utils.a $(libabsyntax_utils_a_OBJECTS) $(libabsyntax_utils_a_LIBADD)
+	$(RANLIB) libabsyntax_utils.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/absyntax_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_en_eno_param_decl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array_dimension_iterator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/case_element_iterator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_ast.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decompose_var_instance_name.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/function_call_iterator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/function_call_param_iterator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/function_param_iterator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_datatype_info.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_sizeof_datatype.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_var_name.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_base_type.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_fb_instance_decl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_fb_typedecl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_il_label.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_var_instance_decl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_varfb_instance_type.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spec_init_separator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/type_initial_value.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- a/absyntax_utils/absyntax_utils.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/absyntax_utils.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -124,21 +124,6 @@
 symbol_c null_symbol4;
 symtable_c<symbol_c *, &null_symbol4> type_symtable;
 
-/* A symbol table with all values declared for enumerated type... */
-/* Notes:
- * - if the value is defined multiple times the value
- * is the null pointer.
- *
- * - The stored symbol_c * associated to the value points to the enumerated_type_name
- * (i.e. the name of the enumerated data type) in which the the value/identifier
- * is used/declared.
- *
- * - We could re-use the null_symbol4 object, but it is safer to use a distinct object
- *   (i.e. it might make it easier to find strange bugs).
- */
-symbol_c null_symbol5;
-symtable_c<symbol_c *, &null_symbol5> enumerated_value_symtable;
-
 
 /***********************************************************************/
 /***********************************************************************/
@@ -208,7 +193,7 @@
   /*  enumerated_type_name ':' enumerated_spec_init */
   void *visit(enumerated_type_declaration_c *symbol) {
     TRACE("enumerated_type_declaration_c");
-    type_symtable.insert(symbol->enumerated_type_name, symbol->enumerated_spec_init);
+    type_symtable.insert(symbol->enumerated_type_name, symbol);
     current_enumerated_type = symbol->enumerated_type_name;
     symbol->enumerated_spec_init->accept(*this);
     current_enumerated_type = NULL;
@@ -220,35 +205,6 @@
     return symbol->enumerated_specification->accept(*this);
   }
 
-  /* [enumerated_type_name '#'] identifier */
-  void *visit(enumerated_value_c *symbol) {
-    if (current_enumerated_type != NULL) {
-      if (symbol->type != NULL) ERROR;
-
-      symbol_c *value_type = enumerated_value_symtable.find_value(symbol->value);
-      /* NOTE: The following condition checks whether the same identifier is used more than once
-       *       when defining the enumerated values of the type declaration of the new enumerated type.
-       *       If this occurs, then the program beeing compiled contains a semantic error, which
-       *       must be caught and reported by the semantic analyser. However, since
-       *       this code is run before the semantic analyser, we must not yet raise the ERROR (internal
-       *       compiler error message).
-       *       For this reason, the follosing check is commented out.
-       */
-      /* if (value_type == current_enumerated_type) ERROR; */
-
-      if (value_type == enumerated_value_symtable.end_value())
-	/* This identifier has not yet been used in any previous declaration of an enumeration data type.
-	 * so we add it to the symbol table.
-	 */
-        enumerated_value_symtable.insert(symbol->value, current_enumerated_type);
-      else if (value_type != NULL)
-	/* This identifier has already been used in a previous declaration of an enumeration data type.
-	 * so we set the symbol in symbol table pointing to NULL.
-	 */
-        enumerated_value_symtable.set(symbol->value, NULL);
-    }
-    return NULL;
-  }
 
   /*  identifier ':' array_spec_init */
   void *visit(array_type_declaration_c *symbol) {
--- a/absyntax_utils/absyntax_utils.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/absyntax_utils.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -77,21 +77,6 @@
 extern symbol_c null_symbol4;
 extern symtable_c<symbol_c *, &null_symbol4> type_symtable;
 
-/* A symbol table with all values declared for enumerated type... */
-/* Notes:
- * - if the value is defined multiple times the value
- * is the null pointer.
- *
- * - The stored symbol_c * associated to the value points to the enumerated_type_name
- * (i.e. the name of the enumerated data type) in which the the value/identifier
- * is used/declared.
- *
- * - We could re-use the null_symbol4 object, but it is safer to use a distinct object
- *   (i.e. it might make it easier to find strange bugs).
- */
-extern symbol_c null_symbol5;
-extern symtable_c<symbol_c *, &null_symbol5> enumerated_value_symtable;
-
 
 /***********************************************************************/
 /***********************************************************************/
@@ -111,13 +96,12 @@
 #include "search_var_instance_decl.hh"
 #include "decompose_var_instance_name.hh"
 #include "search_varfb_instance_type.hh"
-#include "search_constant_type.hh"
-#include "search_il_operand_type.hh"
-#include "search_expression_type.hh"
 #include "add_en_eno_param_decl.hh"
 #include "get_sizeof_datatype.hh"
 #include "search_il_label.hh"
 #include "get_var_name.hh"
+#include "get_datatype_info.hh"
+#include "debug_ast.hh"
 
 /***********************************************************************/
 /***********************************************************************/
--- a/absyntax_utils/add_en_eno_param_decl.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/add_en_eno_param_decl.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -42,6 +42,9 @@
  * and eno_param_declaration_c objects.
  */
 
+#ifndef _ADD_EN_ENO_PARAM_DECL_HH
+#define _ADD_EN_ENO_PARAM_DECL_HH
+
 #include "../absyntax/visitor.hh"
 
 
@@ -96,9 +99,11 @@
 
 }; // function_param_iterator_c
 
+#endif /* _ADD_EN_ENO_PARAM_DECL_HH */
 
 
 
 
 
 
+
--- a/absyntax_utils/case_element_iterator.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/case_element_iterator.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -55,7 +55,7 @@
      */
     typedef enum {
       element_single,
-      element_subrange,
+      element_subrange
     } case_element_t ;
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/debug_ast.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,226 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *  Copyright (C) 2012  Mario de Sousa (msousa@fe.up.pt)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * Some classes to help with debuging.
+ *
+ * These classes will print out the current state of a symbol or a portion of the Abstract Syntax Tree.
+ */
+
+/* TODO: Use a class similar to stage4out_c so that we can have nice indentation when printing an AST
+ *       Create a template so that we can TRACE the execution of other visitor classes doing usefull work!
+ */
+
+
+
+#include <unistd.h>
+#include <stdio.h>  /* required for NULL */
+#include "absyntax_utils.hh"
+#include "../absyntax/visitor.hh"
+
+
+
+
+
+
+/*********************************/
+/* Class to print a symbol       */
+/*********************************/
+
+
+class print_symbol_c: public fcall_visitor_c { 
+  public:
+    static void print(symbol_c *symbol);
+    
+  protected:
+    void fcall(symbol_c *symbol);  
+    /* AST symbols with extra data have their own specialised methods for printing that data */
+    void *visit(il_instruction_c *symbol);
+
+  private:
+    static print_symbol_c *singleton;
+    
+    void dump_symbol(symbol_c* symbol);
+};
+
+
+
+
+print_symbol_c *print_symbol_c::singleton = NULL;
+
+
+void print_symbol_c::print(symbol_c* symbol) {
+  if (NULL == singleton)   singleton = new print_symbol_c();
+  if (NULL == singleton)   ERROR;
+
+  symbol->accept(*singleton);
+}
+
+
+
+
+
+void print_symbol_c::fcall(symbol_c* symbol) {
+  dump_symbol(symbol);
+  fprintf(stderr, "\n");
+}
+
+
+void print_symbol_c::dump_symbol(symbol_c* symbol) {
+  fprintf(stderr, "(%03d:%03d..%03d:%03d) \t%s\t", symbol->first_line, symbol->first_column, symbol->last_line, symbol->last_column, symbol->absyntax_cname());
+
+  fprintf(stderr, "  datatype=");
+  if (NULL == symbol->datatype)
+    fprintf(stderr, "NULL\t\t");
+  else {
+	  fprintf(stderr, "%s", symbol->datatype->absyntax_cname());
+  }
+  fprintf(stderr, "\t<-{");
+  if (symbol->candidate_datatypes.size() == 0) {
+    fprintf(stderr, "\t\t\t\t\t");
+  } else if (symbol->candidate_datatypes.size() <= 2) {
+    for (unsigned int i = 0; i < 2; i++)
+      if (i < symbol->candidate_datatypes.size())
+        fprintf(stderr, " %s,", symbol->candidate_datatypes[i]->absyntax_cname());
+      else
+        fprintf(stderr, "\t\t\t");
+  } else {
+    fprintf(stderr, "(%lu)\t\t\t\t\t", (unsigned long int)symbol->candidate_datatypes.size());
+  }
+  fprintf(stderr, "}\t");         
+  
+  /* print the const values... */
+  fprintf(stderr, " constv{f=%f, i=%"PRId64", u=%"PRIu64", b=%d}\t", symbol->const_value._real64.value, symbol->const_value._int64.value, symbol->const_value._uint64.value, symbol->const_value._bool.value?1:0);
+  
+}
+
+
+
+void *print_symbol_c::visit(il_instruction_c *symbol) {
+   dump_symbol(symbol);
+
+   /* NOTE: std::map.size() returns a size_type, whose type is dependent on compiler/platform. To be portable, we need to do an explicit type cast. */
+  fprintf(stderr, "  next_il_=%lu ", (unsigned long int)symbol->next_il_instruction.size());
+  fprintf(stderr, "  prev_il_=%lu ", (unsigned long int)symbol->prev_il_instruction.size());
+  
+  if (symbol->prev_il_instruction.size() == 0)
+    fprintf(stderr, "(----,");
+  else if (symbol->prev_il_instruction[0]->datatype == NULL)
+    fprintf(stderr, "(NULL,");
+  else if (!get_datatype_info_c::is_type_valid(symbol->prev_il_instruction[0]->datatype))
+    fprintf(stderr, "(****,");
+  else
+    fprintf(stderr, "(    ,");
+  
+  if (symbol->next_il_instruction.size() == 0)
+    fprintf(stderr, "----)");
+  else if (symbol->next_il_instruction[0]->datatype == NULL)
+    fprintf(stderr, "NULL)");
+  else if (!get_datatype_info_c::is_type_valid(symbol->next_il_instruction[0]->datatype))
+    fprintf(stderr, "****)");
+  else 
+    fprintf(stderr, "    )");
+  
+  fprintf(stderr, "\n");
+  
+  return NULL;
+};
+
+
+
+
+
+/*********************************/
+/* Class to print an AST         */
+/*********************************/
+
+class print_ast_c: public fcall_iterator_visitor_c { 
+  public:
+    static void print(symbol_c *symbol);
+    static void print(const char *str);
+    
+  protected:
+    void prefix_fcall(symbol_c *symbol);
+    void suffix_fcall(symbol_c *symbol);  
+  
+  private:
+    static print_ast_c *singleton;    
+};
+
+
+
+
+print_ast_c *print_ast_c::singleton = NULL;
+
+
+void print_ast_c::print(symbol_c* symbol) {
+  if (NULL == singleton)   singleton = new print_ast_c();
+  if (NULL == singleton)   ERROR;
+
+  symbol->accept(*singleton);
+}
+
+
+void print_ast_c::print(const char *str) {
+  fprintf(stderr, "%s", str);
+}
+
+  
+void print_ast_c::prefix_fcall(symbol_c* symbol) {print_symbol_c::print(symbol);}
+void print_ast_c::suffix_fcall(symbol_c* symbol) {}
+  
+
+
+
+
+/*********************************/
+/* The DEBUG class               */
+/*********************************/
+
+
+
+
+void debug_c::print(const char *str) {
+  fprintf(stderr, "%s", str);
+}
+
+void debug_c::print(symbol_c *symbol) {
+  print_symbol_c::print(symbol);
+}
+
+void debug_c::print_ast(symbol_c *symbol) {
+  print_ast_c::print(symbol);
+}
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/debug_ast.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,72 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ * Some classes to help with debuging.
+ *
+ * These classes will print out the current state of a symbol or a portion of the Abstract Syntax Tree.
+ */
+
+
+
+
+
+
+#include "../absyntax/absyntax.hh"
+
+
+class debug_c { 
+  public:
+    static void print(symbol_c *symbol);
+    static void print(const char *str);
+
+    /* print the AST from this point downwards */
+    static void print_ast(symbol_c *root_symbol);
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- a/absyntax_utils/function_param_iterator.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/function_param_iterator.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -442,7 +442,6 @@
 //SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init)
 void *function_param_iterator_c::visit(array_var_init_decl_c *symbol) {
   TRACE("array_var_init_decl_c");
-
   current_param_default_value = spec_init_sperator_c::get_init(symbol->array_spec_init);
   current_param_type = spec_init_sperator_c::get_spec(symbol->array_spec_init);
 
@@ -460,6 +459,26 @@
   return symbol->var1_list->accept(*this);
 }
 
+
+
+
+/* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+// SYM_REF3(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization)
+void *function_param_iterator_c::visit(fb_name_decl_c *symbol) {
+  TRACE("structured_var_init_decl_c");
+  current_param_default_value = symbol->structure_initialization ; 
+  current_param_type          = symbol->function_block_type_name ;
+
+  return symbol->fb_name_list->accept(*this);
+}
+
+
+/* fb_name_list ',' fb_name */
+// SYM_LIST(fb_name_list_c)
+void *function_param_iterator_c::visit(fb_name_list_c *symbol) {TRACE("fb_name_list_c"); return handle_param_list(symbol);}
+
+
 void *function_param_iterator_c::visit(output_declarations_c *symbol) {
   TRACE("output_declarations_c");
   current_param_direction = direction_out;
@@ -496,22 +515,18 @@
 /*  var1_list ':' array_specification */
 //SYM_REF2(array_var_declaration_c, var1_list, array_specification)
 void *function_param_iterator_c::visit(array_var_declaration_c *symbol) {
-	TRACE("array_var_declaration_c");
-
-	current_param_default_value = NULL;
-	current_param_type = symbol->array_specification;
-
-	return symbol->var1_list->accept(*this);
+  TRACE("array_var_declaration_c");
+  current_param_default_value = NULL;
+  current_param_type = symbol->array_specification;
+  return symbol->var1_list->accept(*this);
 }
 
 /*  var1_list ':' structure_type_name */
 //SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name)
 void *function_param_iterator_c::visit(structured_var_declaration_c *symbol) {
   TRACE("structured_var_declaration_c");
-
   current_param_default_value = NULL;
   current_param_type = symbol->structure_type_name;
-
   return symbol->var1_list->accept(*this);
 }
 
--- a/absyntax_utils/function_param_iterator.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/function_param_iterator.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -193,15 +193,15 @@
     //SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure)
     void *visit(structured_var_init_decl_c *symbol);
     
-#if 0
-/* name_list ':' function_block_type_name ASSIGN structure_initialization */
-/* structure_initialization -> may be NULL ! */
-SYM_REF4(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization, unused)
-
-/* name_list ',' fb_name */
-SYM_LIST(fb_name_list_c)
-#endif
-
+    /* name_list ':' function_block_type_name ASSIGN structure_initialization */
+    /* structure_initialization -> may be NULL ! */
+    // SYM_REF4(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization, unused)
+    void *visit(fb_name_decl_c *symbol);
+
+    /* name_list ',' fb_name */
+    // SYM_LIST(fb_name_list_c)
+    void *visit(fb_name_list_c *symbol);
+    
     void *visit(output_declarations_c *symbol);
     void *visit(eno_param_declaration_c *symbol);
     void *visit(input_output_declarations_c *symbol);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/get_datatype_info.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,923 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2003-2012  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
+ *  Copyright (C) 2012       Manuele Conti  (conti.ma@alice.it)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Determine the characteristics of a specific data type
+ *  e.g., is it an enumeration, is it an array, is it ANY_INT, etc...
+ *
+ * The methods of this class may be passed either:
+ *  - a data type declaration symbol_c, 
+ *   OR
+ *  - the name of a data type (identifier_c)
+ *    In this case, we shall first serach for the basetype declaration using search_base_type_c, and then 
+ *    run the normal process.
+ */
+#include "absyntax_utils.hh"
+
+#include "../main.hh" // required for ERROR() and ERROR_MSG() macros.
+
+
+
+#include <typeinfo>  // required for typeid
+
+
+/**********************************************************/
+/**********************************************************/
+/**********************************************************/
+/*****                                                *****/
+/*****                                                *****/
+/*****           Some helper classes                  *****/
+/*****                                                *****/
+/*****                                                *****/
+/**********************************************************/
+/**********************************************************/
+/**********************************************************/
+
+/* Return the identifier (name) of a datatype, typically declared in a TYPE .. END_TYPE declaration */
+class get_datatype_id_c: null_visitor_c {
+  private:
+    static get_datatype_id_c *singleton;
+    
+  public:
+    static symbol_c *get_id(symbol_c *symbol) {
+      if (NULL == singleton) singleton = new  get_datatype_id_c();
+      if (NULL == singleton) ERROR;
+      return (symbol_c *)symbol->accept(*singleton);
+    }
+    
+  protected:
+    /********************************/
+    /* B 1.3.3 - Derived data types */
+    /********************************/
+    /*  simple_type_name ':' simple_spec_init */
+    void *visit(simple_type_declaration_c *symbol)      {return symbol->simple_type_name;}
+    /*  subrange_type_name ':' subrange_spec_init */
+    void *visit(subrange_type_declaration_c *symbol)    {return symbol->subrange_type_name;}
+    /*  enumerated_type_name ':' enumerated_spec_init */
+    void *visit(enumerated_type_declaration_c *symbol)  {return symbol->enumerated_type_name;}
+    /*  identifier ':' array_spec_init */
+    void *visit(array_type_declaration_c *symbol)       {return symbol->identifier;}
+    /*  structure_type_name ':' structure_specification */
+    void *visit(structure_type_declaration_c *symbol)   {return symbol->structure_type_name;}
+    /*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+    void *visit(string_type_declaration_c *symbol)      {return symbol->string_type_name;}
+    
+    /*****************************/
+    /* B 1.5.2 - Function Blocks */
+    /*****************************/
+    /*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+    void *visit(function_block_declaration_c *symbol)      {return symbol->fblock_name;}
+}; // get_datatype_id_c 
+
+get_datatype_id_c *get_datatype_id_c::singleton = NULL;
+
+
+
+
+/***********************************************************************/
+/***********************************************************************/
+
+
+/* A small helper class, to transform elementary data type to string.
+ * this allows us to generate more relevant error messages...
+ */
+
+class get_datatype_id_str_c: public null_visitor_c {
+  protected:
+     get_datatype_id_str_c(void)  {};
+    ~get_datatype_id_str_c(void) {};
+
+  private:
+    /* singleton class! */
+    static get_datatype_id_str_c *singleton;
+
+  public:
+    static const char *get_id_str(symbol_c *symbol) {
+      if (NULL == singleton)    singleton = new get_datatype_id_str_c;
+      if (NULL == singleton)    ERROR;
+      const char *res           = (const char *)symbol->accept(*singleton);
+      if (NULL == res)          ERROR;
+      return res;
+    }
+
+
+    /*************************/
+    /* B.1 - Common elements */
+    /*************************/
+    /*******************************************/
+    /* B 1.1 - Letters, digits and identifiers */
+    /*******************************************/
+    void *visit(identifier_c *symbol) {return (void *)symbol->value;};
+
+    /***********************************/
+    /* B 1.3.1 - Elementary Data Types */
+    /***********************************/
+    void *visit(time_type_name_c        *symbol) {return (void *)"TIME";        };
+    void *visit(bool_type_name_c        *symbol) {return (void *)"BOOL";        };
+    void *visit(sint_type_name_c        *symbol) {return (void *)"SINT";        };
+    void *visit(int_type_name_c         *symbol) {return (void *)"INT";         };
+    void *visit(dint_type_name_c        *symbol) {return (void *)"DINT";        };
+    void *visit(lint_type_name_c        *symbol) {return (void *)"LINT";        };
+    void *visit(usint_type_name_c       *symbol) {return (void *)"USINT";       };
+    void *visit(uint_type_name_c        *symbol) {return (void *)"UINT";        };
+    void *visit(udint_type_name_c       *symbol) {return (void *)"UDINT";       };
+    void *visit(ulint_type_name_c       *symbol) {return (void *)"ULINT";       };
+    void *visit(real_type_name_c        *symbol) {return (void *)"REAL";        };
+    void *visit(lreal_type_name_c       *symbol) {return (void *)"LREAL";       };
+    void *visit(date_type_name_c        *symbol) {return (void *)"DATE";        };
+    void *visit(tod_type_name_c         *symbol) {return (void *)"TOD";         };
+    void *visit(dt_type_name_c          *symbol) {return (void *)"DT";          };
+    void *visit(byte_type_name_c        *symbol) {return (void *)"BYTE";        };
+    void *visit(word_type_name_c        *symbol) {return (void *)"WORD";        };
+    void *visit(lword_type_name_c       *symbol) {return (void *)"LWORD";       };
+    void *visit(dword_type_name_c       *symbol) {return (void *)"DWORD";       };
+    void *visit(string_type_name_c      *symbol) {return (void *)"STRING";      };
+    void *visit(wstring_type_name_c     *symbol) {return (void *)"WSTRING";     };
+
+    void *visit(safetime_type_name_c    *symbol) {return (void *)"SAFETIME";    };
+    void *visit(safebool_type_name_c    *symbol) {return (void *)"SAFEBOOL";    };
+    void *visit(safesint_type_name_c    *symbol) {return (void *)"SAFESINT";    };
+    void *visit(safeint_type_name_c     *symbol) {return (void *)"SAFEINT";     };
+    void *visit(safedint_type_name_c    *symbol) {return (void *)"SAFEDINT";    };
+    void *visit(safelint_type_name_c    *symbol) {return (void *)"SAFELINT";    };
+    void *visit(safeusint_type_name_c   *symbol) {return (void *)"SAFEUSINT";   };
+    void *visit(safeuint_type_name_c    *symbol) {return (void *)"SAFEUINT";    };
+    void *visit(safeudint_type_name_c   *symbol) {return (void *)"SAFEUDINT";   };
+    void *visit(safeulint_type_name_c   *symbol) {return (void *)"SAFEULINT";   };
+    void *visit(safereal_type_name_c    *symbol) {return (void *)"SAFEREAL";    };
+    void *visit(safelreal_type_name_c   *symbol) {return (void *)"SAFELREAL";   };
+    void *visit(safedate_type_name_c    *symbol) {return (void *)"SAFEDATE";    };
+    void *visit(safetod_type_name_c     *symbol) {return (void *)"SAFETOD";     };
+    void *visit(safedt_type_name_c      *symbol) {return (void *)"SAFEDT";      };
+    void *visit(safebyte_type_name_c    *symbol) {return (void *)"SAFEBYTE";    };
+    void *visit(safeword_type_name_c    *symbol) {return (void *)"SAFEWORD";    };
+    void *visit(safelword_type_name_c   *symbol) {return (void *)"SAFELWORD";   };
+    void *visit(safedword_type_name_c   *symbol) {return (void *)"SAFEDWORD";   };
+    void *visit(safestring_type_name_c  *symbol) {return (void *)"SAFESTRING";  };
+    void *visit(safewstring_type_name_c *symbol) {return (void *)"SAFEWSTRING"; };
+
+    /********************************/
+    /* B 1.3.3 - Derived data types */
+    /********************************/
+    /*  simple_type_name ':' simple_spec_init */
+    void *visit(simple_type_declaration_c *symbol)      {return symbol->simple_type_name->accept(*this);}
+    /*  subrange_type_name ':' subrange_spec_init */
+    void *visit(subrange_type_declaration_c *symbol)    {return symbol->subrange_type_name->accept(*this);}
+    /*  enumerated_type_name ':' enumerated_spec_init */
+    void *visit(enumerated_type_declaration_c *symbol)  {return symbol->enumerated_type_name->accept(*this);}
+    /*  identifier ':' array_spec_init */
+    void *visit(array_type_declaration_c *symbol)       {return symbol->identifier->accept(*this);}
+    /*  structure_type_name ':' structure_specification */
+    void *visit(structure_type_declaration_c *symbol)   {return symbol->structure_type_name->accept(*this);}
+    /*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+    void *visit(string_type_declaration_c *symbol)      {return symbol->string_type_name->accept(*this);}
+    
+    /*****************************/
+    /* B 1.5.2 - Function Blocks */
+    /*****************************/
+    /*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+    void *visit(function_block_declaration_c *symbol)      {return symbol->fblock_name->accept(*this);}    
+};
+
+get_datatype_id_str_c *get_datatype_id_str_c::singleton = NULL;
+
+
+
+/**********************************************************/
+/**********************************************************/
+/**********************************************************/
+/*****                                                *****/
+/*****                                                *****/
+/*****        GET_DATATYPE_INFO_C                     *****/
+/*****                                                *****/
+/*****                                                *****/
+/**********************************************************/
+/**********************************************************/
+/**********************************************************/
+
+const char *get_datatype_info_c::get_id_str(symbol_c *datatype) {
+  return get_datatype_id_str_c::get_id_str(datatype);
+}
+
+
+symbol_c *get_datatype_info_c::get_id(symbol_c *datatype) {
+  return get_datatype_id_c::get_id(datatype);
+}
+
+
+bool get_datatype_info_c::is_type_equal(symbol_c *first_type, symbol_c *second_type) {
+  if ((NULL == first_type) || (NULL == second_type))                 {return false;}
+  if (typeid(* first_type) == typeid(invalid_type_name_c))           {return false;}
+  if (typeid(*second_type) == typeid(invalid_type_name_c))           {return false;}
+    
+  if ((get_datatype_info_c::is_ANY_ELEMENTARY(first_type)) &&
+      (typeid(*first_type) == typeid(*second_type)))                 {return true;}
+  /* ANY_DERIVED */
+  return (first_type == second_type);
+}
+
+
+
+bool get_datatype_info_c::is_type_valid(symbol_c *type) {
+  if (NULL == type)                                                  {return false;}
+  if (typeid(*type) == typeid(invalid_type_name_c))                  {return false;}
+  return true;
+}
+
+
+
+
+
+
+bool get_datatype_info_c::is_sfc_initstep(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); 
+  if (typeid(*type_decl) == typeid(initial_step_c))                  {return true;}   /* INITIAL_STEP step_name ':' action_association_list END_STEP */  /* A pseudo data type! */
+  return false;
+}
+
+
+
+
+
+bool get_datatype_info_c::is_sfc_step(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); 
+  if (typeid(*type_decl) == typeid(initial_step_c))                  {return true;}   /* INITIAL_STEP step_name ':' action_association_list END_STEP */  /* A pseudo data type! */
+  if (typeid(*type_decl) == typeid(        step_c))                  {return true;}   /*         STEP step_name ':' action_association_list END_STEP */  /* A pseudo data type! */
+  return false;
+}
+
+
+
+
+bool get_datatype_info_c::is_function_block(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); 
+  if (typeid(*type_decl) == typeid(function_block_declaration_c))    {return true;}   /*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+  return false;
+}
+
+
+
+
+
+bool get_datatype_info_c::is_subrange(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); /* NOTE: will work correctly once we update the way search_base_type_c works, by adding a new search_effective_type:c */
+  
+  if (typeid(*type_decl) == typeid(subrange_type_declaration_c))     {return true;}   /*  subrange_type_name ':' subrange_spec_init */
+  if (typeid(*type_decl) == typeid(subrange_spec_init_c))            {return true;}   /* subrange_specification ASSIGN signed_integer */
+  if (typeid(*type_decl) == typeid(subrange_specification_c))        {return true;}   /*  integer_type_name '(' subrange')' */
+    
+  if (typeid(*type_decl) == typeid(subrange_c))                      {ERROR;}         /*  signed_integer DOTDOT signed_integer */
+  return false;
+}
+
+
+
+
+
+bool get_datatype_info_c::is_enumerated(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol);
+  
+  if (typeid(*type_decl) == typeid(enumerated_type_declaration_c))   {return true;}   /*  enumerated_type_name ':' enumerated_spec_init */
+  if (typeid(*type_decl) == typeid(enumerated_spec_init_c))          {return true;}   /* enumerated_specification ASSIGN enumerated_value */
+  if (typeid(*type_decl) == typeid(enumerated_value_list_c))         {return true;}   /* enumerated_value_list ',' enumerated_value */        /* once we change the way we handle enums, this will probably become an ERROR! */
+  
+  if (typeid(*type_decl) == typeid(enumerated_value_c))              {ERROR;}         /* enumerated_type_name '#' identifier */
+  return false;
+}
+
+
+
+
+
+bool get_datatype_info_c::is_array(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol);
+  
+  if (typeid(*type_decl) == typeid(array_type_declaration_c))        {return true;}   /*  identifier ':' array_spec_init */
+  if (typeid(*type_decl) == typeid(array_spec_init_c))               {return true;}   /* array_specification [ASSIGN array_initialization} */
+  if (typeid(*type_decl) == typeid(array_specification_c))           {return true;}   /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+  
+  if (typeid(*type_decl) == typeid(array_subrange_list_c))           {ERROR;}         /* array_subrange_list ',' subrange */
+  if (typeid(*type_decl) == typeid(array_initial_elements_list_c))   {ERROR;}         /* array_initialization:  '[' array_initial_elements_list ']' */  /* array_initial_elements_list ',' array_initial_elements */
+  if (typeid(*type_decl) == typeid(array_initial_elements_c))        {ERROR;}         /* integer '(' [array_initial_element] ')' */
+  return false;
+}
+
+
+
+
+
+bool get_datatype_info_c::is_structure(symbol_c *type_symbol) {
+  symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol);
+  
+  if (typeid(*type_decl) == typeid(structure_type_declaration_c))              {return true;}   /*  structure_type_name ':' structure_specification */
+  if (typeid(*type_decl) == typeid(initialized_structure_c))                   {return true;}   /* structure_type_name ASSIGN structure_initialization */
+  if (typeid(*type_decl) == typeid(structure_element_declaration_list_c))      {return true;}   /* structure_declaration:  STRUCT structure_element_declaration_list END_STRUCT */ /* structure_element_declaration_list structure_element_declaration ';' */
+  
+  if (typeid(*type_decl) == typeid(structure_element_declaration_c))           {ERROR;}         /*  structure_element_name ':' *_spec_init */
+  if (typeid(*type_decl) == typeid(structure_element_initialization_list_c))   {ERROR;}         /* structure_initialization: '(' structure_element_initialization_list ')' */  /* structure_element_initialization_list ',' structure_element_initialization */
+  if (typeid(*type_decl) == typeid(structure_element_initialization_c))        {ERROR;}         /*  structure_element_name ASSIGN value */
+  return false;
+}
+
+
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_ELEMENTARY(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_MAGNITUDE(type_symbol))                           {return true;}
+  if (is_ANY_BIT      (type_symbol))                           {return true;}
+  if (is_ANY_STRING   (type_symbol))                           {return true;}
+  if (is_ANY_DATE     (type_symbol))                           {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEELEMENTARY(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_SAFEMAGNITUDE(type_symbol))                       {return true;}
+  if (is_ANY_SAFEBIT      (type_symbol))                       {return true;}
+  if (is_ANY_SAFESTRING   (type_symbol))                       {return true;}
+  if (is_ANY_SAFEDATE     (type_symbol))                       {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_ELEMENTARY_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_ELEMENTARY    (type_symbol))                      {return true;}
+  if (is_ANY_SAFEELEMENTARY(type_symbol))                      {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_MAGNITUDE(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_TIME(type_symbol))                                    {return true;}
+  if (is_ANY_NUM(type_symbol))                                 {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEMAGNITUDE(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_SAFETIME(type_symbol))                                {return true;}
+  if (is_ANY_SAFENUM(type_symbol))                             {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_MAGNITUDE_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_MAGNITUDE    (type_symbol))                       {return true;}
+  if (is_ANY_SAFEMAGNITUDE(type_symbol))                       {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_signed_MAGNITUDE(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(time_type_name_c))        {return true;}
+  if (is_ANY_signed_NUM(type_symbol))                          {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_signed_SAFEMAGNITUDE(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safetime_type_name_c))    {return true;}
+  return is_ANY_signed_SAFENUM(type_symbol);
+}
+
+
+bool get_datatype_info_c::is_ANY_signed_MAGNITUDE_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_signed_MAGNITUDE    (type_symbol))                {return true;}
+  if (is_ANY_signed_SAFEMAGNITUDE(type_symbol))                {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_NUM(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_REAL(type_symbol))                                {return true;}
+  if (is_ANY_INT (type_symbol))                                {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFENUM(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_SAFEREAL(type_symbol))                            {return true;}
+  if (is_ANY_SAFEINT (type_symbol))                            {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_NUM_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_NUM    (type_symbol))                             {return true;}
+  if (is_ANY_SAFENUM(type_symbol))                             {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_signed_NUM(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_REAL      (type_symbol))                          {return true;}
+  if (is_ANY_signed_INT(type_symbol))                          {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_signed_SAFENUM(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_SAFEREAL      (type_symbol))                      {return true;}
+  if (is_ANY_signed_SAFEINT(type_symbol))                      {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_signed_NUM_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_signed_NUM    (type_symbol))                      {return true;}
+  if (is_ANY_signed_SAFENUM(type_symbol))                      {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_INT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_signed_INT  (type_symbol))                        {return true;}
+  if (is_ANY_unsigned_INT(type_symbol))                        {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEINT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_signed_SAFEINT  (type_symbol))                    {return true;}
+  if (is_ANY_unsigned_SAFEINT(type_symbol))                    {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_INT_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_INT    (type_symbol))                             {return true;}
+  if (is_ANY_SAFEINT(type_symbol))                             {return true;}
+  return false;
+}
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_signed_INT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(sint_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(int_type_name_c))         {return true;}
+  if (typeid(*type_symbol) == typeid(dint_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(lint_type_name_c))        {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_signed_SAFEINT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safesint_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safeint_type_name_c))     {return true;}
+  if (typeid(*type_symbol) == typeid(safedint_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safelint_type_name_c))    {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_signed_INT_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_signed_INT    (type_symbol))                      {return true;}
+  if (is_ANY_signed_SAFEINT(type_symbol))                      {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_unsigned_INT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(usint_type_name_c))       {return true;}
+  if (typeid(*type_symbol) == typeid(uint_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(udint_type_name_c))       {return true;}
+  if (typeid(*type_symbol) == typeid(ulint_type_name_c))       {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_unsigned_SAFEINT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safeusint_type_name_c))   {return true;}
+  if (typeid(*type_symbol) == typeid(safeuint_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safeudint_type_name_c))   {return true;}
+  if (typeid(*type_symbol) == typeid(safeulint_type_name_c))   {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_unsigned_INT_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_unsigned_INT    (type_symbol))                    {return true;}
+  if (is_ANY_unsigned_SAFEINT(type_symbol))                    {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_REAL(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(real_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(lreal_type_name_c))       {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEREAL(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safereal_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safelreal_type_name_c))   {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_REAL_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_REAL    (type_symbol))                            {return true;}
+  if (is_ANY_SAFEREAL(type_symbol))                            {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_nBIT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(byte_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(word_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(dword_type_name_c))       {return true;}
+  if (typeid(*type_symbol) == typeid(lword_type_name_c))       {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEnBIT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safebyte_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safeword_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safedword_type_name_c))   {return true;}
+  if (typeid(*type_symbol) == typeid(safelword_type_name_c))   {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_nBIT_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_nBIT    (type_symbol))                            {return true;}
+  if (is_ANY_SAFEnBIT(type_symbol))                            {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_BOOL(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(bool_type_name_c))        {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_SAFEBOOL(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safebool_type_name_c))    {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_BOOL_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_BOOL    (type_symbol))                                {return true;}
+  if (is_SAFEBOOL(type_symbol))                                {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_BIT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_BOOL    (type_symbol))                                {return true;}
+  if (is_ANY_nBIT(type_symbol))                                {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEBIT(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_SAFEBOOL    (type_symbol))                            {return true;}
+  if (is_ANY_SAFEnBIT(type_symbol))                            {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_BIT_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_BIT    (type_symbol))                             {return true;}
+  if (is_ANY_SAFEBIT(type_symbol))                             {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_TIME(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(time_type_name_c))        {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_SAFETIME(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safetime_type_name_c))    {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_TIME_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_TIME    (type_symbol))                                {return true;}
+  if (is_SAFETIME(type_symbol))                                {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_DATE(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(date_type_name_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(tod_type_name_c))         {return true;}
+  if (typeid(*type_symbol) == typeid(dt_type_name_c))          {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFEDATE(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safedate_type_name_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(safetod_type_name_c))     {return true;}
+  if (typeid(*type_symbol) == typeid(safedt_type_name_c))      {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_DATE_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_DATE    (type_symbol))                            {return true;}
+  if (is_ANY_SAFEDATE(type_symbol))                            {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+
+
+
+bool get_datatype_info_c::is_ANY_STRING(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(string_type_name_c))      {return true;}
+  if (typeid(*type_symbol) == typeid(wstring_type_name_c))     {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_SAFESTRING(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (typeid(*type_symbol) == typeid(safestring_type_name_c))  {return true;}
+  if (typeid(*type_symbol) == typeid(safewstring_type_name_c)) {return true;}
+  return false;
+}
+
+
+bool get_datatype_info_c::is_ANY_STRING_compatible(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                                     {return false;}
+  if (is_ANY_STRING    (type_symbol))                          {return true;}
+  if (is_ANY_SAFESTRING(type_symbol))                          {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+/* Can't we do away with this?? */
+bool get_datatype_info_c::is_ANY_REAL_literal(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                              {return true;} /* Please make sure things will work correctly before changing this to false!! */
+  if (typeid(*type_symbol) == typeid(real_c))           {return true;}
+  if (typeid(*type_symbol) == typeid(neg_real_c))       {return true;}
+  return false;
+}
+
+/* Can't we do away with this?? */
+bool get_datatype_info_c::is_ANY_INT_literal(symbol_c *type_symbol) {
+  if (type_symbol == NULL)                              {return true;} /* Please make sure things will work correctly before changing this to false!! */
+  if (typeid(*type_symbol) == typeid(integer_c))        {return true;}
+  if (typeid(*type_symbol) == typeid(neg_integer_c))    {return true;}
+  if (typeid(*type_symbol) == typeid(binary_integer_c)) {return true;}
+  if (typeid(*type_symbol) == typeid(octal_integer_c))  {return true;}
+  if (typeid(*type_symbol) == typeid(hex_integer_c))    {return true;}
+  return false;
+}
+
+
+
+
+
+
+
+
+
+
+invalid_type_name_c      get_datatype_info_c::invalid_type_name;
+
+/**********************/
+/* B.1.3 - Data types */
+/**********************/
+/***********************************/
+/* B 1.3.1 - Elementary Data Types */
+/***********************************/
+lreal_type_name_c        get_datatype_info_c::lreal_type_name;
+real_type_name_c         get_datatype_info_c::real_type_name;
+
+lint_type_name_c         get_datatype_info_c::lint_type_name;
+dint_type_name_c         get_datatype_info_c::dint_type_name;
+int_type_name_c          get_datatype_info_c::int_type_name;
+sint_type_name_c         get_datatype_info_c::sint_type_name;
+
+ulint_type_name_c        get_datatype_info_c::ulint_type_name;
+udint_type_name_c        get_datatype_info_c::udint_type_name;
+uint_type_name_c         get_datatype_info_c::uint_type_name;
+usint_type_name_c        get_datatype_info_c::usint_type_name;
+
+lword_type_name_c        get_datatype_info_c::lword_type_name;
+dword_type_name_c        get_datatype_info_c::dword_type_name;
+word_type_name_c         get_datatype_info_c::word_type_name;
+byte_type_name_c         get_datatype_info_c::byte_type_name;
+bool_type_name_c         get_datatype_info_c::bool_type_name;
+
+wstring_type_name_c      get_datatype_info_c::wstring_type_name;
+string_type_name_c       get_datatype_info_c::string_type_name;
+
+dt_type_name_c           get_datatype_info_c::dt_type_name;
+date_type_name_c         get_datatype_info_c::date_type_name;
+tod_type_name_c          get_datatype_info_c::tod_type_name;
+time_type_name_c         get_datatype_info_c::time_type_name;
+
+
+/******************************************************/
+/* Extensions to the base standard as defined in      */
+/* "Safety Software Technical Specification,          */
+/*  Part 1: Concepts and Function Blocks,             */
+/*  Version 1.0 – Official Release"                   */
+/* by PLCopen - Technical Committee 5 - 2006-01-31    */
+/******************************************************/  
+safelreal_type_name_c    get_datatype_info_c::safelreal_type_name;
+safereal_type_name_c     get_datatype_info_c::safereal_type_name;
+
+safelint_type_name_c     get_datatype_info_c::safelint_type_name;
+safedint_type_name_c     get_datatype_info_c::safedint_type_name;
+safeint_type_name_c      get_datatype_info_c::safeint_type_name;
+safesint_type_name_c     get_datatype_info_c::safesint_type_name;
+
+safeulint_type_name_c    get_datatype_info_c::safeulint_type_name;
+safeudint_type_name_c    get_datatype_info_c::safeudint_type_name;
+safeuint_type_name_c     get_datatype_info_c::safeuint_type_name;
+safeusint_type_name_c    get_datatype_info_c::safeusint_type_name;
+
+safelword_type_name_c    get_datatype_info_c::safelword_type_name;
+safedword_type_name_c    get_datatype_info_c::safedword_type_name;
+safeword_type_name_c     get_datatype_info_c::safeword_type_name;
+safebyte_type_name_c     get_datatype_info_c::safebyte_type_name;
+safebool_type_name_c     get_datatype_info_c::safebool_type_name;
+
+safewstring_type_name_c  get_datatype_info_c::safewstring_type_name;
+safestring_type_name_c   get_datatype_info_c::safestring_type_name;
+
+safedt_type_name_c       get_datatype_info_c::safedt_type_name;
+safedate_type_name_c     get_datatype_info_c::safedate_type_name;
+safetod_type_name_c      get_datatype_info_c::safetod_type_name;
+safetime_type_name_c     get_datatype_info_c::safetime_type_name;
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/absyntax_utils/get_datatype_info.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,214 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2003-2012  Mario de Sousa (msousa@fe.up.pt)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/* Determine the characteristics of a specific data type
+ *  e.g., is it an enumeration, is it an array, is it ANY_INT, etc...
+ *
+ * The methods of this class may be passed either:
+ *  - a data type declaration symbol_c, 
+ *   OR
+ *  - the name of a data type (identifier_c)
+ *    In this case, we shall first serach for the basetype declaration using search_base_type_c, and then 
+ *    run the normal process.
+ */
+#include "absyntax_utils.hh"
+
+#include "../main.hh" // required for ERROR() and ERROR_MSG() macros.
+
+
+
+
+
+
+class get_datatype_info_c { 
+
+
+  private: // this is a purely static class. No need for constructors!
+     get_datatype_info_c(void) {};
+    ~get_datatype_info_c(void) {};
+
+  
+  public:
+    static symbol_c   *get_id    (symbol_c *datatype); /* get the identifier (name) of the datatype); returns NULL if anonymous datatype! Does not work for elementary datatypes!*/
+    static const char *get_id_str(symbol_c *datatype); /* get the identifier (name) of the datatype); returns NULL if anonymous datatype! */
+      
+    static bool is_type_equal(symbol_c *first_type, symbol_c *second_type);
+    static bool is_type_valid(symbol_c *type);
+      
+    static bool is_ANY_REAL_literal(symbol_c *type_symbol); /* Can't we do away with this?? */
+    static bool is_ANY_INT_literal (symbol_c *type_symbol); /* Can't we do away with this?? */
+
+    static bool is_sfc_initstep                    (symbol_c *type_symbol);
+    static bool is_sfc_step                        (symbol_c *type_symbol);
+    static bool is_function_block                  (symbol_c *type_symbol);
+    static bool is_subrange                        (symbol_c *type_symbol);
+    static bool is_enumerated                      (symbol_c *type_symbol);
+    static bool is_array                           (symbol_c *type_symbol);
+    static bool is_structure                       (symbol_c *type_symbol);
+
+  
+    static bool is_ANY_ELEMENTARY                  (symbol_c *type_symbol);
+    static bool is_ANY_SAFEELEMENTARY              (symbol_c *type_symbol);
+    static bool is_ANY_ELEMENTARY_compatible       (symbol_c *type_symbol);
+
+    static bool is_ANY_MAGNITUDE                   (symbol_c *type_symbol);
+    static bool is_ANY_SAFEMAGNITUDE               (symbol_c *type_symbol);
+    static bool is_ANY_MAGNITUDE_compatible        (symbol_c *type_symbol);
+
+    static bool is_ANY_signed_MAGNITUDE            (symbol_c *type_symbol);
+    static bool is_ANY_signed_SAFEMAGNITUDE        (symbol_c *type_symbol);
+    static bool is_ANY_signed_MAGNITUDE_compatible (symbol_c *type_symbol);
+
+    static bool is_ANY_NUM                         (symbol_c *type_symbol);
+    static bool is_ANY_SAFENUM                     (symbol_c *type_symbol);
+    static bool is_ANY_NUM_compatible              (symbol_c *type_symbol);
+
+    static bool is_ANY_signed_NUM                  (symbol_c *type_symbol);
+    static bool is_ANY_signed_SAFENUM              (symbol_c *type_symbol);
+    static bool is_ANY_signed_NUM_compatible       (symbol_c *type_symbol);
+
+    static bool is_ANY_INT                         (symbol_c *type_symbol);
+    static bool is_ANY_SAFEINT                     (symbol_c *type_symbol);
+    static bool is_ANY_INT_compatible              (symbol_c *type_symbol);
+
+    static bool is_ANY_signed_INT                  (symbol_c *type_symbol);
+    static bool is_ANY_signed_SAFEINT              (symbol_c *type_symbol);
+    static bool is_ANY_signed_INT_compatible       (symbol_c *type_symbol);
+
+    static bool is_ANY_unsigned_INT                (symbol_c *type_symbol);
+    static bool is_ANY_unsigned_SAFEINT            (symbol_c *type_symbol);
+    static bool is_ANY_unsigned_INT_compatible     (symbol_c *type_symbol);
+
+    static bool is_ANY_REAL                        (symbol_c *type_symbol);
+    static bool is_ANY_SAFEREAL                    (symbol_c *type_symbol);
+    static bool is_ANY_REAL_compatible             (symbol_c *type_symbol);
+
+    static bool is_ANY_nBIT                        (symbol_c *type_symbol);
+    static bool is_ANY_SAFEnBIT                    (symbol_c *type_symbol);
+    static bool is_ANY_nBIT_compatible             (symbol_c *type_symbol);
+
+    static bool is_BOOL                            (symbol_c *type_symbol);
+    static bool is_SAFEBOOL                        (symbol_c *type_symbol);
+    static bool is_BOOL_compatible                 (symbol_c *type_symbol);
+
+    static bool is_ANY_BIT                         (symbol_c *type_symbol);
+    static bool is_ANY_SAFEBIT                     (symbol_c *type_symbol);
+    static bool is_ANY_BIT_compatible              (symbol_c *type_symbol);
+
+    static bool is_ANY_DATE                        (symbol_c *type_symbol);
+    static bool is_ANY_SAFEDATE                    (symbol_c *type_symbol);
+    static bool is_ANY_DATE_compatible             (symbol_c *type_symbol);
+
+    static bool is_TIME                            (symbol_c *type_symbol);
+    static bool is_SAFETIME                        (symbol_c *type_symbol);
+    static bool is_TIME_compatible                 (symbol_c *type_symbol);
+
+    static bool is_ANY_STRING                      (symbol_c *type_symbol);
+    static bool is_ANY_SAFESTRING                  (symbol_c *type_symbol);
+    static bool is_ANY_STRING_compatible           (symbol_c *type_symbol);
+
+    
+    
+    
+  public:
+    /* object used to identify an entry in the abstract syntax tree with an invalid data type */
+    /* This is only used from stage3 onwards. Stages 1 and 2 will never create any instances of invalid_type_name_c */
+    static invalid_type_name_c     invalid_type_name;
+
+    /**********************/
+    /* B.1.3 - Data types */
+    /**********************/
+    /***********************************/
+    /* B 1.3.1 - Elementary Data Types */
+    /***********************************/
+    static lreal_type_name_c        lreal_type_name;
+    static real_type_name_c         real_type_name;
+    
+    static lint_type_name_c         lint_type_name;
+    static dint_type_name_c         dint_type_name;
+    static int_type_name_c          int_type_name;
+    static sint_type_name_c         sint_type_name;
+    
+    static ulint_type_name_c        ulint_type_name;
+    static udint_type_name_c        udint_type_name;
+    static uint_type_name_c         uint_type_name;
+    static usint_type_name_c        usint_type_name;
+
+    static lword_type_name_c        lword_type_name;
+    static dword_type_name_c        dword_type_name;
+    static word_type_name_c         word_type_name;
+    static byte_type_name_c         byte_type_name;
+    static bool_type_name_c         bool_type_name;
+    
+    static wstring_type_name_c      wstring_type_name;
+    static string_type_name_c       string_type_name;
+    
+    static dt_type_name_c           dt_type_name;
+    static date_type_name_c         date_type_name;
+    static tod_type_name_c          tod_type_name;
+    static time_type_name_c         time_type_name;
+
+
+    /******************************************************/
+    /* Extensions to the base standard as defined in      */
+    /* "Safety Software Technical Specification,          */
+    /*  Part 1: Concepts and Function Blocks,             */
+    /*  Version 1.0 – Official Release"                   */
+    /* by PLCopen - Technical Committee 5 - 2006-01-31    */
+    /******************************************************/  
+    static safelreal_type_name_c    safelreal_type_name;
+    static safereal_type_name_c     safereal_type_name;
+    
+    static safelint_type_name_c     safelint_type_name;
+    static safedint_type_name_c     safedint_type_name;
+    static safeint_type_name_c      safeint_type_name;
+    static safesint_type_name_c     safesint_type_name;
+           
+    static safeulint_type_name_c    safeulint_type_name;
+    static safeudint_type_name_c    safeudint_type_name;
+    static safeuint_type_name_c     safeuint_type_name;
+    static safeusint_type_name_c    safeusint_type_name;
+           
+    static safelword_type_name_c    safelword_type_name;
+    static safedword_type_name_c    safedword_type_name;
+    static safeword_type_name_c     safeword_type_name;
+    static safebyte_type_name_c     safebyte_type_name;
+    static safebool_type_name_c     safebool_type_name;
+    
+    static safewstring_type_name_c  safewstring_type_name;
+    static safestring_type_name_c   safestring_type_name;
+    
+    static safedt_type_name_c       safedt_type_name;
+    static safedate_type_name_c     safedate_type_name;
+    static safetod_type_name_c      safetod_type_name;
+    static safetime_type_name_c     safetime_type_name;               
+};
+
--- a/absyntax_utils/search_base_type.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/search_base_type.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -49,49 +49,64 @@
 #include "../main.hh" // required for ERROR() and ERROR_MSG() macros.
 
 
-
-search_base_type_c::search_base_type_c(void) {current_type_name = NULL;}
-
-
-
-
+/* pointer to singleton instance */
+search_base_type_c *search_base_type_c::search_base_type_singleton = NULL;
+
+
+
+search_base_type_c::search_base_type_c(void) {current_type_name = NULL; current_basetype = NULL;}
+
+/* static method! */
+void search_base_type_c::create_singleton(void) {
+  if (NULL == search_base_type_singleton)   search_base_type_singleton = new search_base_type_c();
+  if (NULL == search_base_type_singleton)   ERROR;
+}
+
+/* static method! */
 symbol_c *search_base_type_c::get_basetype_decl(symbol_c *symbol) {
-  if (NULL == symbol)
-    return NULL;
-  
-  return (symbol_c *)symbol->accept(*this);
-}
-
+  create_singleton();
+  if (NULL == symbol)    return NULL; 
+  search_base_type_singleton->current_type_name = NULL;
+  search_base_type_singleton->current_basetype  = NULL; 
+  return (symbol_c *)symbol->accept(*search_base_type_singleton);
+}
+
+/* static method! */
 symbol_c *search_base_type_c::get_basetype_id  (symbol_c *symbol) {
-  if (NULL == symbol)
-    return NULL;
-  
-  current_type_name = NULL; /* just to be on the safe side... */
-  symbol->accept(*this);
-  return (symbol_c *)current_type_name;
+  create_singleton();
+  if (NULL == symbol)    return NULL; 
+  search_base_type_singleton->current_type_name = NULL;
+  search_base_type_singleton->current_basetype  = NULL; 
+  symbol->accept(*search_base_type_singleton);
+  return (symbol_c *)search_base_type_singleton->current_type_name;
 }
 
 
 /* Note by MJS: The following two functions definately do not belong in this class!! Maybe create a new utility class?
  * I will need to clean this up when the opportunity arises!
  */
-
+/* static method! */
 bool search_base_type_c::type_is_subrange(symbol_c* type_decl) {
-  this->is_subrange = false;
-  type_decl->accept(*this);
-  return this->is_subrange;
-}
-
+  create_singleton();
+  search_base_type_singleton->is_subrange = false;
+  type_decl->accept(*search_base_type_singleton);
+  return search_base_type_singleton->is_subrange;
+}
+
+
+/* static method! */
 bool search_base_type_c::type_is_enumerated(symbol_c* type_decl) {
-  this->is_enumerated = false;
-  type_decl->accept(*this);
-  return this->is_enumerated;
+  create_singleton();
+  search_base_type_singleton->is_enumerated = false;
+  type_decl->accept(*search_base_type_singleton);
+  return search_base_type_singleton->is_enumerated;
 }
 
 bool search_base_type_c::type_is_fb(symbol_c* type_decl) {
-  this->is_fb = false;
-  type_decl->accept(*this);
-  return this->is_fb;
+  create_singleton();
+  search_base_type_singleton->is_fb = false;
+  type_decl->accept(*search_base_type_singleton);
+  return search_base_type_singleton->is_fb;
 }
 
 /*************************/
@@ -105,6 +120,10 @@
   symbol_c *type_decl;
 
   this->current_type_name = type_name;
+  /* if we have reached this point, it is because the current_basetype is not yet pointing to the base datatype we are looking for,
+   * so we will be searching for the delcaration of the type named in type_name, which might be the base datatype (we search recursively!)
+   */
+  this->current_basetype  = NULL; 
   
   /* look up the type declaration... */
   type_decl = type_symtable.find_value(type_name);
@@ -237,18 +256,38 @@
 /*  enumerated_type_name ':' enumerated_spec_init */
 void *search_base_type_c::visit(enumerated_type_declaration_c *symbol) {
   this->current_type_name = symbol->enumerated_type_name;
+  /* NOTE: We want search_base_type_c to return a enumerated_type_declaration_c as the base datatpe if possible
+   *       (i.e. if it is a named datatype declared inside a TYPE ... END_TYPE declarations, as opposed to an
+   *        anonymous datatype declared in a VAR ... AND_VAR declaration).
+   *       However, we cannot return this symbol just yet, as it may not be the final base datatype.
+   *       So we store it in a temporary current_basetype variable!
+   */
+  this->current_basetype  = symbol; 
   return symbol->enumerated_spec_init->accept(*this);
 }
 
 /* enumerated_specification ASSIGN enumerated_value */
 void *search_base_type_c::visit(enumerated_spec_init_c *symbol) {
   this->is_enumerated = true;
-  return symbol->enumerated_specification->accept(*this);
+  // current_basetype may have been set in the previous enumerated_type_declaration_c visitor, in which case we do not want to overwrite the value!
+  if (NULL == this->current_basetype)
+    this->current_basetype  = symbol; 
+  /* NOTE: the following line may call either the visitor to 
+   *         - identifier_c, in which case this is not yet the base datatype we are looking for (it will set current_basetype to NULL!)
+   *         - enumerated_value_list_c, in which case we have found the base datatype.
+   */
+  return symbol->enumerated_specification->accept(*this); 
 }
 
 /* helper symbol for enumerated_specification->enumerated_spec_init */
 /* enumerated_value_list ',' enumerated_value */
-void *search_base_type_c::visit(enumerated_value_list_c *symbol)                        {return (void *)symbol;}
+void *search_base_type_c::visit(enumerated_value_list_c *symbol) {
+  this->is_enumerated = true;
+  // current_basetype may have been set in the previous enumerated_type_declaration_c or enumerated_spec_init_c visitors, in which case we do not want to overwrite the value!
+  if (NULL == this->current_basetype) 
+    this->current_basetype  = symbol; 
+  return (void *)current_basetype;
+}
 
 /* enumerated_type_name '#' identifier */
 // SYM_REF2(enumerated_value_c, type, value)
--- a/absyntax_utils/search_base_type.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/search_base_type.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -52,20 +52,23 @@
 
   private:
     symbol_c *current_type_name;
+    symbol_c *current_basetype;
     bool is_array;
     bool is_subrange;
     bool is_enumerated;
     bool is_fb;
+    static search_base_type_c *search_base_type_singleton; // Make this a singleton class!
+    
+  private:  
+    static void create_singleton(void);
 
   public:
     search_base_type_c(void);
-
-  public:
-    symbol_c *get_basetype_decl(symbol_c *symbol);
-    symbol_c *get_basetype_id  (symbol_c *symbol);
-    bool type_is_subrange(symbol_c* type_decl);
-    bool type_is_enumerated(symbol_c* type_decl);
-    bool type_is_fb(symbol_c* type_decl);
+    static symbol_c *get_basetype_decl (symbol_c *symbol);
+    static symbol_c *get_basetype_id   (symbol_c *symbol);
+    static bool      type_is_subrange  (symbol_c *type_decl);
+    static bool      type_is_enumerated(symbol_c *type_decl);
+    static bool      type_is_fb        (symbol_c *type_decl);
 
   public:
   /*************************/
--- a/absyntax_utils/search_constant_type.cc	Sat Feb 23 23:14:59 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
- *  matiec - a compiler for the programming languages defined in IEC 61131-3
- *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
- *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * This code is made available on the understanding that it will not be
- * used in safety-critical situations without a full and competent review.
- */
-
-/*
- * An IEC 61131-3 compiler.
- *
- * Based on the
- * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
- *
- */
-
-/* Determine the data type of a specific constant or variable.
- * A reference to the relevant type definition is returned.
- *
- * For example:
- *       22          -> returns reference to a int_type_name_c object.
- *       22.2        -> returns reference to a real_type_name_c object.
- *       LREAL#22.2  -> returns reference to a lreal_type_name_c object.
- *       etc...
- */
-
-
-#include "../util/symtable.hh"
-#include "search_constant_type.hh"
-#include "absyntax_utils.hh"
-#include "../main.hh" // required for ERROR() and ERROR_MSG() macros.
-
-
-
-symbol_c *search_constant_type_c::get_type(symbol_c *constant) {
-  return (symbol_c *)constant->accept(*this);
-}
-
-
-/*********************/
-/* B 1.2 - Constants */
-/*********************/
-
-/******************************/
-/* B 1.2.1 - Numeric Literals */
-/******************************/
-/* Numeric literals without any explicit type cast have unknown data type, 
-  * so we continue considering them as their own basic data types until
-  * they can be resolved (for example, when using '30+x' where 'x' is a LINT variable, the
-  * numeric literal '30' must then be considered a LINT so the ADD function may be called
-  * with all inputs of the same data type.
-  * If 'x' were a SINT, then the '30' would have to be a SINT too!
-  */
-void *search_constant_type_c::visit(real_c *symbol)           {return (void *)symbol;}
-void *search_constant_type_c::visit(neg_real_c *symbol)       {return (void *)symbol;}
-void *search_constant_type_c::visit(integer_c *symbol)        {return (void *)symbol;}
-void *search_constant_type_c::visit(neg_integer_c *symbol)    {return (void *)symbol;}
-void *search_constant_type_c::visit(binary_integer_c *symbol) {return (void *)symbol;}
-void *search_constant_type_c::visit(octal_integer_c *symbol)  {return (void *)symbol;}
-void *search_constant_type_c::visit(hex_integer_c *symbol)    {return (void *)symbol;}
-
-void *search_constant_type_c::visit(integer_literal_c *symbol)
-  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
-void *search_constant_type_c::visit(real_literal_c *symbol)
-  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
-void *search_constant_type_c::visit(bit_string_literal_c *symbol)
-  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
-void *search_constant_type_c::visit(boolean_literal_c *symbol)
-  {return (void *)((symbol->type!=NULL)?symbol->type:symbol->value->accept(*this));}
-
-void *search_constant_type_c::visit(boolean_true_c *symbol)   {return (void *)symbol;}
-void *search_constant_type_c::visit(boolean_false_c *symbol)  {return (void *)symbol;}
-
-
-/*******************************/
-/* B.1.2.2   Character Strings */
-/*******************************/
-void *search_constant_type_c::visit(double_byte_character_string_c *symbol) {return (void *)&wstring_type_name;}
-void *search_constant_type_c::visit(single_byte_character_string_c *symbol) {return (void *)&string_type_name;}
-
-/***************************/
-/* B 1.2.3 - Time Literals */
-/***************************/
-/************************/
-/* B 1.2.3.1 - Duration */
-/************************/
-void *search_constant_type_c::visit(neg_time_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
-void *search_constant_type_c::visit(duration_c *symbol) {return (void *)(symbol->type_name);}
-void *search_constant_type_c::visit(fixed_point_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
-void *search_constant_type_c::visit(interval_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
-
-/************************************/
-/* B 1.2.3.2 - Time of day and Date */
-/************************************/
-void *search_constant_type_c::visit(time_of_day_c *symbol) {return (void *)(symbol->type_name);}
-void *search_constant_type_c::visit(daytime_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
-void *search_constant_type_c::visit(date_c *symbol) {return (void *)(symbol->type_name);}
-void *search_constant_type_c::visit(date_literal_c *symbol) {ERROR; return NULL;}  /* this member function should never be called. */
-void *search_constant_type_c::visit(date_and_time_c *symbol) {return (void *)(symbol->type_name);}
-
-/********************************/
-/* B 1.3.3 - Derived data types */
-/********************************/
-void *search_constant_type_c::visit(enumerated_value_c *symbol) {
-  if (symbol->type != NULL)
-    return (void *)(symbol->type);
-
-  symbol_c *value_type = enumerated_value_symtable.find_value(symbol->value);
-  if (value_type == enumerated_value_symtable.end_value())
-    return NULL;
-  return (void *)value_type;
-}
-
-
-
-
-invalid_type_name_c  search_constant_type_c::invalid_type_name;
-
-
-real_type_name_c     search_constant_type_c::real_type_name;
-sint_type_name_c     search_constant_type_c::sint_type_name;
-lint_type_name_c     search_constant_type_c::lint_type_name;
-dint_type_name_c     search_constant_type_c::dint_type_name;
-date_type_name_c     search_constant_type_c::date_type_name;
-dword_type_name_c    search_constant_type_c::dword_type_name;
-dt_type_name_c       search_constant_type_c::dt_type_name;
-tod_type_name_c      search_constant_type_c::tod_type_name;
-udint_type_name_c    search_constant_type_c::udint_type_name;
-word_type_name_c     search_constant_type_c::word_type_name;
-wstring_type_name_c  search_constant_type_c::wstring_type_name;
-string_type_name_c   search_constant_type_c::string_type_name;
-lword_type_name_c    search_constant_type_c::lword_type_name;
-uint_type_name_c     search_constant_type_c::uint_type_name;
-lreal_type_name_c    search_constant_type_c::lreal_type_name;
-byte_type_name_c     search_constant_type_c::byte_type_name;
-usint_type_name_c    search_constant_type_c::usint_type_name;
-ulint_type_name_c    search_constant_type_c::ulint_type_name;
-bool_type_name_c     search_constant_type_c::bool_type_name;
-time_type_name_c     search_constant_type_c::time_type_name;
-int_type_name_c      search_constant_type_c::int_type_name;
-
-safetime_type_name_c     search_constant_type_c::safetime_type_name;
-safetod_type_name_c      search_constant_type_c::safetod_type_name;
-safedt_type_name_c       search_constant_type_c::safedt_type_name;
-safedate_type_name_c     search_constant_type_c::safedate_type_name;
-safereal_type_name_c     search_constant_type_c::safereal_type_name;
-safesint_type_name_c     search_constant_type_c::safesint_type_name;
-safelint_type_name_c     search_constant_type_c::safelint_type_name;
-safedint_type_name_c     search_constant_type_c::safedint_type_name;
-safedword_type_name_c    search_constant_type_c::safedword_type_name;
-safeudint_type_name_c    search_constant_type_c::safeudint_type_name;
-safeword_type_name_c     search_constant_type_c::safeword_type_name;
-safewstring_type_name_c  search_constant_type_c::safewstring_type_name;
-safestring_type_name_c   search_constant_type_c::safestring_type_name;
-safelword_type_name_c    search_constant_type_c::safelword_type_name;
-safeuint_type_name_c     search_constant_type_c::safeuint_type_name;
-safelreal_type_name_c    search_constant_type_c::safelreal_type_name;
-safebyte_type_name_c     search_constant_type_c::safebyte_type_name;
-safeusint_type_name_c    search_constant_type_c::safeusint_type_name;
-safeulint_type_name_c    search_constant_type_c::safeulint_type_name;
-safebool_type_name_c     search_constant_type_c::safebool_type_name;
-safeint_type_name_c      search_constant_type_c::safeint_type_name;
-
-
--- a/absyntax_utils/search_constant_type.hh	Sat Feb 23 23:14:59 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- *  matiec - a compiler for the programming languages defined in IEC 61131-3
- *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
- *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * This code is made available on the understanding that it will not be
- * used in safety-critical situations without a full and competent review.
- */
-
-/*
- * An IEC 61131-3 compiler.
- *
- * Based on the
- * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
- *
- */
-
-/* NOTE: The use of this visitor class is now deprecated.
- *       The new version of stage3 data type checking adds an entry to
- *       every relevant object in the abstract syntax tree defining
- *       the data type of that object. Please use that instead!
- */
-
-
-
-/* Determine the data type of a specific constant or variable.
- * A reference to the relevant type definition is returned.
- *
- * For example:
- *       22          -> returns reference to a int_type_name_c object.
- *       22.2        -> returns reference to a real_type_name_c object.
- *       LREAL#22.2  -> returns reference to a lreal_type_name_c object.
- *       etc...
- */
-
-
-#include "../absyntax/visitor.hh"
-
-#ifndef _SEARCH_CONSTANT_TYPE_HH
-#define _SEARCH_CONSTANT_TYPE_HH
-
-class search_constant_type_c: public search_visitor_c {
-
-  public:
-  /* object used to identify an entry in the abstract syntax tree with an invalid data type */
-  /* This is only used from stage3 onwards. Stages 1 and 2 will never create any instances of invalid_type_name_c */
-  static invalid_type_name_c     invalid_type_name;
-
-  /**********************/
-  /* B.1.3 - Data types */
-  /**********************/
-  /***********************************/
-  /* B 1.3.1 - Elementary Data Types */
-  /***********************************/
-  static real_type_name_c     real_type_name;
-  static sint_type_name_c     sint_type_name;
-  static lint_type_name_c     lint_type_name;
-  static dint_type_name_c     dint_type_name;
-  static date_type_name_c     date_type_name;
-  static dword_type_name_c    dword_type_name;
-  static dt_type_name_c       dt_type_name;
-  static tod_type_name_c      tod_type_name;
-  static udint_type_name_c    udint_type_name;
-  static word_type_name_c     word_type_name;
-  static wstring_type_name_c  wstring_type_name;
-  static string_type_name_c   string_type_name;
-  static lword_type_name_c    lword_type_name;
-  static uint_type_name_c     uint_type_name;
-  static lreal_type_name_c    lreal_type_name;
-  static byte_type_name_c     byte_type_name;
-  static usint_type_name_c    usint_type_name;
-  static ulint_type_name_c    ulint_type_name;
-  static bool_type_name_c     bool_type_name;
-  static time_type_name_c     time_type_name;
-  static int_type_name_c      int_type_name;
-
-
-  /******************************************************/
-  /* Extensions to the base standard as defined in      */
-  /* "Safety Software Technical Specification,          */
-  /*  Part 1: Concepts and Function Blocks,             */
-  /*  Version 1.0 – Official Release"                   */
-  /* by PLCopen - Technical Committee 5 - 2006-01-31    */
-  /******************************************************/
- 
-//  static safebool_type_name_c          safebool_type_name;
-  /* The following is required because the expression (TOD_var - TOD_var) will result in a data type
-   *  (in this case, TIME) that is neither of the expression elements...
-   */
-  static safetime_type_name_c     safetime_type_name;
-  static safetod_type_name_c      safetod_type_name;
-  static safedt_type_name_c       safedt_type_name;
-  static safedate_type_name_c     safedate_type_name;
-  static safereal_type_name_c     safereal_type_name;
-  static safesint_type_name_c     safesint_type_name;
-  static safelint_type_name_c     safelint_type_name;
-  static safedint_type_name_c     safedint_type_name;
-  static safedword_type_name_c    safedword_type_name;
-  static safeudint_type_name_c    safeudint_type_name;
-  static safeword_type_name_c     safeword_type_name;
-  static safewstring_type_name_c  safewstring_type_name;
-  static safestring_type_name_c   safestring_type_name;
-  static safelword_type_name_c    safelword_type_name;
-  static safeuint_type_name_c     safeuint_type_name;
-  static safelreal_type_name_c    safelreal_type_name;
-  static safebyte_type_name_c     safebyte_type_name;
-  static safeusint_type_name_c    safeusint_type_name;
-  static safeulint_type_name_c    safeulint_type_name;
-  static safebool_type_name_c     safebool_type_name;
-  static safeint_type_name_c      safeint_type_name;
-
-  public:
-    symbol_c *get_type(symbol_c *constant);
-
-
-  private:
-    /*********************/
-    /* B 1.2 - Constants */
-    /*********************/
-
-    /******************************/
-    /* B 1.2.1 - Numeric Literals */
-    /******************************/
-    void *visit(real_c *symbol);
-    void *visit(neg_real_c *symbol);
-    void *visit(integer_c *symbol);
-    void *visit(neg_integer_c *symbol);
-    void *visit(binary_integer_c *symbol);
-    void *visit(octal_integer_c *symbol);
-    void *visit(hex_integer_c *symbol);
-
-    void *visit(integer_literal_c *symbol);
-    void *visit(real_literal_c *symbol);
-    void *visit(bit_string_literal_c *symbol);
-    void *visit(boolean_literal_c *symbol);
-
-    void *visit(boolean_true_c *symbol);
-    void *visit(boolean_false_c *symbol);
-
-    /*******************************/
-    /* B.1.2.2   Character Strings */
-    /*******************************/
-    void *visit(double_byte_character_string_c *symbol);
-    void *visit(single_byte_character_string_c *symbol);
-
-    /***************************/
-    /* B 1.2.3 - Time Literals */
-    /***************************/
-    /************************/
-    /* B 1.2.3.1 - Duration */
-    /************************/
-    void *visit(neg_time_c *symbol);
-    void *visit(duration_c *symbol);
-    void *visit(interval_c *symbol);
-    void *visit(fixed_point_c *symbol);
-
-    /************************************/
-    /* B 1.2.3.2 - Time of day and Date */
-    /************************************/
-    void *visit(time_of_day_c *symbol);
-    void *visit(daytime_c *symbol);
-    void *visit(date_c *symbol);
-    void *visit(date_literal_c *symbol);
-    void *visit(date_and_time_c *symbol);
-
-    /********************************/
-    /* B 1.3.3 - Derived data types */
-    /********************************/
-    void *visit(enumerated_value_c *symbol);
-};  // search_constant_type_c
-
-
-#endif /* ifndef _SEARCH_CONSTANT_TYPE_HH */
--- a/absyntax_utils/search_expression_type.cc	Sat Feb 23 23:14:59 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
- *  matiec - a compiler for the programming languages defined in IEC 61131-3
- *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
- *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * This code is made available on the understanding that it will not be
- * used in safety-critical situations without a full and competent review.
- */
-
-/*
- * An IEC 61131-3 compiler.
- *
- * Based on the
- * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
- *
- */
-
-
-/* Determine the data type of an ST expression.
- * A reference to the relevant type definition is returned.
- *
- * For example:
- *       2 + 3       -> returns reference to a int_type_name_c object.
- *       22.2 - 5    -> returns reference to a real_type_name_c object.
- *       etc...
- */
-
-
-
-#include "absyntax_utils.hh"
-#include <typeinfo>
-
-search_expression_type_c::search_expression_type_c(symbol_c *search_scope) {
-  search_varfb_instance_type = new search_varfb_instance_type_c(search_scope);
-}
-
-search_expression_type_c::~search_expression_type_c(void) {
-  delete search_varfb_instance_type;
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_bool_type(symbol_c *type_symbol) {
-  bool_type_name_c tt;
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(safebool_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(bool_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(boolean_true_c))       {return true;}
-  if (typeid(*type_symbol) == typeid(boolean_false_c))      {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_time_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(time_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(date_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(tod_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(dt_type_name_c))       {return true;}
-  if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safedate_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safetod_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safedt_type_name_c))   {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_string_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(string_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(wstring_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safestring_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safewstring_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_literal_integer_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(integer_c))        {return true;}
-  if (typeid(*type_symbol) == typeid(neg_integer_c))    {return true;}
-  if (typeid(*type_symbol) == typeid(binary_integer_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(octal_integer_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(hex_integer_c))    {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_integer_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(sint_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(int_type_name_c))       {return true;}
-  if (typeid(*type_symbol) == typeid(dint_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(lint_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(usint_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(uint_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(udint_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(ulint_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safesint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeint_type_name_c))   {return true;}
-  if (typeid(*type_symbol) == typeid(safedint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safelint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeusint_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safeuint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeudint_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safeulint_type_name_c)) {return true;}
-  return is_literal_integer_type(type_symbol);
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_literal_real_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(real_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(neg_real_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool search_expression_type_c::is_real_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(real_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(lreal_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safereal_type_name_c))  {return true;} 
-  if (typeid(*type_symbol) == typeid(safelreal_type_name_c)) {return true;}  
-  return is_literal_real_type(type_symbol);
-}
-
-bool search_expression_type_c::is_num_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  return is_real_type(type_symbol) || is_integer_type(type_symbol);
-}
-
-bool search_expression_type_c::is_nbinary_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-  if (typeid(*type_symbol) == typeid(byte_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(word_type_name_c))      {return true;}
-  if (typeid(*type_symbol) == typeid(dword_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(lword_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safebyte_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeword_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safedword_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safelword_type_name_c)) {return true;}
-  return is_literal_integer_type(type_symbol);
-}
-
-bool search_expression_type_c::is_binary_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return true;}
-//   if (typeid(*type_symbol) == typeid(bool_type_name_c))     {return true;}
-//   if (typeid(*type_symbol) == typeid(safebool_type_name_c)) {return true;}
-  return (is_nbinary_type(type_symbol) || is_bool_type(type_symbol));
-}
-
-bool search_expression_type_c::is_same_type(symbol_c *first_type, symbol_c *second_type) {
-  if (first_type == NULL || second_type == NULL) {return true;}
-  if (typeid(*first_type) == typeid(*second_type)) {return true;}
-  if (is_bool_type(first_type)            && is_bool_type(second_type))            {return true;}
-  if (is_integer_type(first_type)         && is_literal_integer_type(second_type)) {return true;}
-  if (is_literal_integer_type(first_type) && is_integer_type(second_type))         {return true;}
-  if (is_binary_type(first_type)          && is_literal_integer_type(second_type)) {return true;}
-  if (is_literal_integer_type(first_type) && is_binary_type(second_type))          {return true;}
-  if (is_real_type(first_type)            && is_literal_real_type(second_type))    {return true;}
-  if (is_literal_real_type(first_type)    && is_real_type(second_type))            {return true;}
-  return false;
-}
-
-symbol_c* search_expression_type_c::common_type(symbol_c *first_type, symbol_c *second_type) {
-  if (first_type == NULL && second_type == NULL) {return NULL;}
-  if (first_type == NULL) {return second_type;}
-  if (second_type == NULL) {return first_type;}
-  if (typeid(*first_type) == typeid(*second_type)) {return first_type;}
-  if (is_integer_type(first_type)         && is_literal_integer_type(second_type)) {return first_type;}
-  if (is_literal_integer_type(first_type) && is_integer_type(second_type))         {return second_type;}
-  if (is_binary_type(first_type)          && is_literal_integer_type(second_type)) {return first_type;}
-  if (is_literal_integer_type(first_type) && is_binary_type(second_type))          {return second_type;}
-  if (is_real_type(first_type)            && is_literal_real_type(second_type))    {return first_type;}
-  if (is_literal_real_type(first_type)    && is_real_type(second_type))            {return second_type;}
-  return NULL;
-}
-
-symbol_c *search_expression_type_c::default_literal_type(symbol_c* symbol) {
-  if (is_literal_integer_type(symbol)) {
-    return (symbol_c *)&search_constant_type_c::lint_type_name;
-  }
-  else if (is_literal_real_type(symbol)) {
-    return (symbol_c *)&search_constant_type_c::lreal_type_name;
-  }
-  return symbol;
-}
-
-
-/* A helper function... */
-void *search_expression_type_c::compute_boolean_expression(symbol_c *left_type, symbol_c *right_type) {
-  if (!is_same_type(left_type, right_type))
-    ERROR;
-  if (!is_bool_type(left_type) && !is_binary_type(left_type))
-    ERROR;
-  if (is_literal_integer_type(left_type)) {return (void *)right_type;}
-  else {return (void *)left_type;}
-}
-
-/* A helper function... */
-void *search_expression_type_c::compute_numeric_expression(symbol_c *left_type, symbol_c *right_type) {
-  if (!is_same_type(left_type, right_type))
-    ERROR;
-  if (!is_integer_type(left_type) && !is_real_type(left_type))
-    ERROR;
-  if (is_literal_integer_type(left_type) || is_literal_real_type(left_type)) {return (void *)right_type;}
-  else {return (void *)left_type;}
-  return NULL;
-}
-
-/* a helper function... */
-symbol_c *search_expression_type_c::base_type(symbol_c *symbol) {
-  return (symbol_c *)symbol->accept(search_base_type);
-}
-
-/*********************/
-/* B 1.4 - Variables */
-/*********************/
-
-void *search_expression_type_c::visit(symbolic_variable_c *symbol) {
-  symbol_c *res;
-  
-  /* Nope, now we assume it is a variable, and determine its type... */
-  res = search_varfb_instance_type->get_basetype_decl(symbol);
-  if (NULL != res) return res;
-  
-  return NULL;
-}
-
-/********************************************/
-/* B 1.4.1 - Directly Represented Variables */
-/********************************************/
-void *search_expression_type_c::visit(direct_variable_c *symbol) {
-  symbol_c *res;
-  
-  /* Nope, now we assume it is a variable, and determine its type... */
-  res = search_varfb_instance_type->get_basetype_decl(symbol);
-  if (NULL != res) return res;
-  
-  return NULL;
-}
-
-/*************************************/
-/* B 1.4.2 - Multi-element variables */
-/*************************************/
-
-void *search_expression_type_c::visit(array_variable_c *symbol) {
-  symbol_c *res;
-  
-  /* Nope, now we assume it is a variable, and determine its type... */
-  res = search_varfb_instance_type->get_basetype_decl(symbol);
-  if (NULL != res) return res;
-  
-  return NULL;
-}
-
-void *search_expression_type_c::visit(structured_variable_c *symbol) {
-  symbol_c *res;
-  
-  /* Nope, now we assume it is a variable, and determine its type... */
-  res = search_varfb_instance_type->get_basetype_decl(symbol);
-  if (NULL != res) return res;
-  
-  return NULL;
-}
-
-/***************************************/
-/* B.3 - Language ST (Structured Text) */
-/***************************************/
-/***********************/
-/* B 3.1 - Expressions */
-/***********************/
-void *search_expression_type_c::visit(or_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  return compute_boolean_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(xor_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  return compute_boolean_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(and_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  return compute_boolean_expression(left_type, right_type); 
-}
-
-void *search_expression_type_c::visit(equ_expression_c *symbol) {return (void *)&bool_type_name;}
-void *search_expression_type_c::visit(notequ_expression_c *symbol) {return (void *)&bool_type_name;}
-void *search_expression_type_c::visit(lt_expression_c *symbol) {return (void *)&bool_type_name;}
-void *search_expression_type_c::visit(gt_expression_c *symbol) {return (void *)&bool_type_name;}
-void *search_expression_type_c::visit(le_expression_c *symbol) {return (void *)&bool_type_name;}
-void *search_expression_type_c::visit(ge_expression_c *symbol) {return (void *)&bool_type_name;}
-
-void *search_expression_type_c::visit(add_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  if (typeid(*left_type) == typeid(time_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&time_type_name;}
-  if (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&tod_type_name;}
-  if (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&dt_type_name;}
-  return compute_numeric_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(sub_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  if (typeid(*left_type) == typeid(time_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&time_type_name;}
-  if (typeid(*left_type) == typeid(date_type_name_c) && typeid(*right_type) == typeid(date_type_name_c)) {return (void *)&time_type_name;}
-  if (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&tod_type_name;}
-  if (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(tod_type_name_c)) {return (void *)&time_type_name;}
-  if (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) {return (void *)&dt_type_name;}
-  if (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(dt_type_name_c)) {return (void *)&time_type_name;}
-  return compute_numeric_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(mul_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  if (typeid(*left_type) == typeid(time_type_name_c) && is_num_type(right_type)) {
-      return (void *)&time_type_name;
-  }
-  return compute_numeric_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(div_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  if (typeid(*left_type) == typeid(time_type_name_c) && is_num_type(right_type)){
-      return (void *)&time_type_name;
-  }
-  return compute_numeric_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(mod_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  return compute_numeric_expression(left_type, right_type);
-}
-
-void *search_expression_type_c::visit(power_expression_c *symbol) {
-  symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this));
-  symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this));
-  if (is_real_type(left_type) && is_num_type(right_type)) {
-      return (void *)left_type;
-  }
-  ERROR;
-  return NULL;
-}
-
-void *search_expression_type_c::visit(neg_expression_c *symbol) {
-  symbol_c *exp_type = base_type((symbol_c *)symbol->exp->accept(*this));
-  if (is_num_type(exp_type) || typeid(*exp_type) == typeid(time_type_name_c)){
-      return (void *)exp_type;
-  }
-  ERROR;
-  return NULL;
-}
-
-void *search_expression_type_c::visit(not_expression_c *symbol) {
-  symbol_c *exp_type = base_type((symbol_c *)symbol->exp->accept(*this));
-  return compute_boolean_expression(exp_type, exp_type);
-}
-
-void *search_expression_type_c::visit(function_invocation_c *symbol) {
-  function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
-  if (f_decl == NULL) ERROR;
-  return base_type(f_decl->type_name);
-}
-
-/*bool_type_name_c     search_expression_type_c::bool_type_name;*/
-
--- a/absyntax_utils/search_expression_type.hh	Sat Feb 23 23:14:59 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- *  matiec - a compiler for the programming languages defined in IEC 61131-3
- *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
- *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * This code is made available on the understanding that it will not be
- * used in safety-critical situations without a full and competent review.
- */
-
-/*
- * An IEC 61131-3 compiler.
- *
- * Based on the
- * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
- *
- */
-
-/* Determine the data type of an ST expression.
- * A reference to the relevant type definition is returned.
- *
- * For example:
- *       2 + 3       -> returns reference to a int_type_name_c object.
- *       22.2 - 5    -> returns reference to a real_type_name_c object.
- *       etc...
- */
-
-/* WARNING   WARNING  WARNING
- *
- * When taking into consideration calls to functions, this search_expression_type_c
- * class will use internal atributes (i.e. anotation) in the function_invocation_c symbol 
- * in the abstract syntax tree.
- *
- * Since this anotation/atribute is only set/populated with the correct value
- * during stage3 (semantic verification), this class will only work correctly
- * after the semantic verification in stage 3 has been executed
- * (to be more exact, the data type checking of stage 3).
- */
-
-class search_expression_type_c: public search_constant_type_c {
-
-  private:
-    search_varfb_instance_type_c *search_varfb_instance_type;
-    search_base_type_c search_base_type;
-
-
-  public:
-    search_expression_type_c(symbol_c *search_scope);
-    virtual ~search_expression_type_c(void);
-
-    /* A helper function... */
-    bool is_bool_type(symbol_c *type_symbol);
-    bool is_time_type(symbol_c *type_symbol);
-    bool is_string_type(symbol_c *type_symbol);
-    bool is_literal_integer_type(symbol_c *type_symbol);
-    bool is_integer_type(symbol_c *type_symbol);
-    bool is_literal_real_type(symbol_c *type_symbol);
-    bool is_real_type(symbol_c *type_symbol);
-    bool is_num_type(symbol_c *type_symbol);
-    bool is_nbinary_type(symbol_c *type_symbol);
-    bool is_binary_type(symbol_c *type_symbol);
-
-    bool is_same_type(symbol_c *first_type, symbol_c *second_type);
-    symbol_c* common_type(symbol_c *first_type, symbol_c *second_type);
-    symbol_c* default_literal_type(symbol_c *symbol);
-
-    /*
-    #include "search_type_code.c"
-    */
-    void *compute_standard_function_default(function_invocation_c *st_symbol, il_formal_funct_call_c *il_symbol);
-    void *compute_standard_function_il(il_function_call_c *symbol, symbol_c *param_data_type);
-
-
-
-    /*static bool_type_name_c bool_type_name;*/
-
-    /* A helper function... */
-    void *compute_boolean_expression(symbol_c *left_type, symbol_c *right_type);
-
-    /* A helper function... */
-    void *compute_numeric_expression(symbol_c *left_type, symbol_c *right_type);
-
-    /* a helper function... */
-    symbol_c *base_type(symbol_c *symbol);
-
-    /*********************/
-    /* B 1.4 - Variables */
-    /*********************/
-    
-    void *visit(symbolic_variable_c *symbol);
-
-    /********************************************/
-    /* B 1.4.1 - Directly Represented Variables */
-    /********************************************/
-    void *visit(direct_variable_c *symbol);
-
-    /*************************************/
-    /* B 1.4.2 - Multi-element variables */
-    /*************************************/
- 
-    void *visit(array_variable_c *symbol);
-    void *visit(structured_variable_c *symbol);
-
-    /***************************************/
-    /* B.3 - Language ST (Structured Text) */
-    /***************************************/
-    /***********************/
-    /* B 3.1 - Expressions */
-    /***********************/
-    void *visit(or_expression_c *symbol);
-    void *visit(xor_expression_c *symbol);
-    void *visit(and_expression_c *symbol);
-    void *visit(equ_expression_c *symbol);
-    void *visit(notequ_expression_c *symbol);
-    void *visit(lt_expression_c *symbol);
-    void *visit(gt_expression_c *symbol);
-    void *visit(le_expression_c *symbol);
-    void *visit(ge_expression_c *symbol);
-    
-    void *visit(add_expression_c *symbol);
-    void *visit(sub_expression_c *symbol);
-    void *visit(mul_expression_c *symbol);
-    void *visit(div_expression_c *symbol);
-    void *visit(mod_expression_c *symbol);
-    void *visit(power_expression_c *symbol);
-    void *visit(neg_expression_c *symbol);
-    void *visit(not_expression_c *symbol);
-    void *visit(function_invocation_c *symbol);
-
-
-    static integer_c integer;
-
-}; // search_expression_type_c
-
-
-
--- a/absyntax_utils/search_il_operand_type.cc	Sat Feb 23 23:14:59 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- *  matiec - a compiler for the programming languages defined in IEC 61131-3
- *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
- *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * This code is made available on the understanding that it will not be
- * used in safety-critical situations without a full and competent review.
- */
-
-/*
- * An IEC 61131-3 compiler.
- *
- * Based on the
- * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
- *
- */
-
-
-
-
-/* Returns the data type of an il_operand.
- *
- * Note that the il_operand may be a variable, in which case
- * we return the type of the variable instance.
- * The il_operand may also be a constant, in which case
- * we return the data type of that constant.
- *
- * The variable instance may be a member of a structured variable,
- * or an element in an array, or any combination of the two.
- *
- * The class constructor must be given the search scope
- * (function, function block or program within which
- * the possible il_operand variable instance was declared).
- */
-
-#include "absyntax_utils.hh"
-
-symbol_c *search_il_operand_type_c::get_type(symbol_c *il_operand) {
-  symbol_c *res;
-
-  /* We first assume that it is a constant... */
-  res = search_constant_type.get_type(il_operand);
-  if (res != NULL) return res;
-
-  /* Nope, now we assume it is a variable, and determine its type... */
-  res = search_varfb_instance_type.get_type(il_operand);
-  if (NULL != res) return res;
-
-  /* not found */
-  return NULL;
-}
--- a/absyntax_utils/search_il_operand_type.hh	Sat Feb 23 23:14:59 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- *  matiec - a compiler for the programming languages defined in IEC 61131-3
- *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
- *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- * This code is made available on the understanding that it will not be
- * used in safety-critical situations without a full and competent review.
- */
-
-/*
- * An IEC 61131-3 compiler.
- *
- * Based on the
- * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
- *
- */
-
-/* Returns the data type of an il_operand.
- *
- * Note that the il_operand may be a variable, in which case
- * we return the type of the variable instance.
- * The il_operand may also be a constant, in which case
- * we return the data type of that constant.
- *
- * The variable instance may be a member of a structured variable,
- * or an element in an array, or any combination of the two.
- *
- * The class constructor must be given the search scope
- * (function, function block or program within which
- * the possible il_operand variable instance was declared).
- */
-
-class search_il_operand_type_c {
-
-  private:
-    search_varfb_instance_type_c search_varfb_instance_type;
-    search_constant_type_c search_constant_type;
-
-  public:
-    search_il_operand_type_c(symbol_c *search_scope): search_varfb_instance_type(search_scope) {}
-
-  public:
-    symbol_c *get_type(symbol_c *il_operand);
-};
--- a/absyntax_utils/search_var_instance_decl.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/search_var_instance_decl.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -132,11 +132,10 @@
 #include <typeinfo>  /* required for typeid() */
 bool search_var_instance_decl_c::type_is_complex(symbol_c *symbol) {
   symbol_c *decl;
-  search_base_type_c search_base_type;
   
   decl = this->get_decl(symbol);
   if (NULL == decl) ERROR;
-  decl = search_base_type.get_basetype_decl(decl);
+  decl = search_base_type_c::get_basetype_decl(decl);
   if (NULL == decl) ERROR;
   
   return ((typeid( *(decl) ) == typeid( array_specification_c                )) ||
@@ -145,7 +144,7 @@
           (typeid( *(decl) ) == typeid( structure_element_declaration_list_c )) ||
 //        (typeid( *(decl) ) == typeid( structure_type_declaration_c         )) ||  /* does not seem to be necessary */
           (typeid( *(decl) ) == typeid( initialized_structure_c              )) ||
-          (search_base_type.type_is_fb(decl) && current_vartype == external_vt)
+          (search_base_type_c::type_is_fb(decl) && current_vartype == external_vt)
          );
 }
 
--- a/absyntax_utils/search_varfb_instance_type.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/search_varfb_instance_type.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -136,8 +136,8 @@
   /* symbol should be a variable name!! */
   /* Note: although the method is called get_decl(), it is getting the declaration of the variable, which for us is the type_id of that variable! */
   current_type_id       = search_var_instance_decl.get_decl (variable_name);
-  current_basetype_decl = search_base_type.get_basetype_decl(current_type_id);
-  current_basetype_id   = search_base_type.get_basetype_id  (current_type_id);
+  current_basetype_decl = search_base_type_c::get_basetype_decl(current_type_id);
+  current_basetype_id   = search_base_type_c::get_basetype_id  (current_type_id);
     
   /* What if the variable has not been declared?  Then this should not be a compiler error! 
    * However, currently stage 2 of the compiler already detects when variables have not been delcared,
@@ -193,8 +193,8 @@
 void *search_varfb_instance_type_c::visit(array_specification_c *symbol) {
   /* found the type of the element we were looking for! */
   current_type_id       = symbol->non_generic_type_name;
-  current_basetype_decl = search_base_type.get_basetype_decl(current_type_id);
-  current_basetype_id   = search_base_type.get_basetype_id  (current_type_id);
+  current_basetype_decl = search_base_type_c::get_basetype_decl(current_type_id);
+  current_basetype_id   = search_base_type_c::get_basetype_id  (current_type_id);
     
   return NULL; 
 }
@@ -256,8 +256,8 @@
   if (compare_identifiers(symbol->structure_element_name, current_field_selector) == 0) {
     /* found the type of the element we were looking for! */
     current_type_id       = symbol->spec_init;
-    current_basetype_decl = search_base_type.get_basetype_decl(current_type_id);
-    current_basetype_id   = search_base_type.get_basetype_id  (current_type_id);
+    current_basetype_decl = search_base_type_c::get_basetype_decl(current_type_id);
+    current_basetype_id   = search_base_type_c::get_basetype_id  (current_type_id);
   }  
 
   /* Did not find the type of the element we were looking for! */
@@ -363,8 +363,8 @@
   /* If not found, these pointers will all be set to NULL!! */
   search_var_instance_decl_c search_decl(symbol);
   current_type_id       = search_decl.get_decl(current_field_selector);
-  current_basetype_decl = search_base_type.get_basetype_decl(current_type_id);
-  current_basetype_id   = search_base_type.get_basetype_id  (current_type_id);
+  current_basetype_decl = search_base_type_c::get_basetype_decl(current_type_id);
+  current_basetype_id   = search_base_type_c::get_basetype_id  (current_type_id);
   
   return NULL;
 }
@@ -383,13 +383,14 @@
   identifier_c T("T");
   identifier_c X("X");
   
+  /* Hard code the datatypes of the implicit variables Stepname.X and Stepname.T */
   if (compare_identifiers(&T, current_field_selector) == 0)   
-    current_type_id = &search_constant_type_c::time_type_name;
+    current_type_id = &get_datatype_info_c::time_type_name;
   if (compare_identifiers(&X, current_field_selector) == 0)   
-    current_type_id = &search_constant_type_c::bool_type_name;
-  
-  current_basetype_decl = search_base_type.get_basetype_decl(current_type_id);
-  current_basetype_id   = search_base_type.get_basetype_id  (current_type_id);
+    current_type_id = &get_datatype_info_c::bool_type_name;
+  
+  current_basetype_decl = search_base_type_c::get_basetype_decl(current_type_id);
+  current_basetype_id   = search_base_type_c::get_basetype_id  (current_type_id);
 
   return NULL;
 }
--- a/absyntax_utils/search_varfb_instance_type.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/search_varfb_instance_type.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -89,7 +89,6 @@
 
   private:
     search_var_instance_decl_c search_var_instance_decl;
-    search_base_type_c         search_base_type;
 
 //  symbol_c *current_type_decl;
     symbol_c *current_type_id;
--- a/absyntax_utils/type_initial_value.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/type_initial_value.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -81,7 +81,7 @@
    * for the DATE data type. Untill we fix our implementation, we use 1970-01-01
    * as our default value!!
    */
-    date_literal_0 =  new date_literal_c(integer_1, integer_1, integer_1);
+//date_literal_0 =  new date_literal_c(integer_1, integer_1, integer_1);
   date_literal_0 =  new date_literal_c(new integer_c("1970"), integer_1, integer_1);
   daytime_literal_0 = new daytime_c(integer_0, integer_0, real_0);
   time_0 = new duration_c(new time_type_name_c(), NULL, new interval_c(NULL, NULL, NULL, integer_0, NULL));  // T#0s
@@ -98,9 +98,9 @@
 
 
 
-symbol_c *type_initial_value_c::get(identifier_c *type_name) {
+symbol_c *type_initial_value_c::get(symbol_c *type) {
   TRACE("type_initial_value_c::get(): called ");
-  return (symbol_c *)type_name->accept(*this);
+  return (symbol_c *)type->accept(*type_initial_value_c::instance());
 }
 
 
--- a/absyntax_utils/type_initial_value.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/absyntax_utils/type_initial_value.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -59,8 +59,10 @@
 
 class type_initial_value_c : public null_visitor_c {
 
+  public:
+    static symbol_c *get(symbol_c *type);
+
   private:
-    static type_initial_value_c *_instance;
     /* constants for the default values of elementary data types... */
     static real_c		*real_0;
     static integer_c		*integer_0, *integer_1;
@@ -74,17 +76,12 @@
     static single_byte_character_string_c *string_0;
     static double_byte_character_string_c *wstring_0;
 
-  public:
-    static type_initial_value_c *instance(void);
-
   protected:
     type_initial_value_c(void);
 
-  public:
-    symbol_c *get(identifier_c *type_name);
-
-
   private:
+    static type_initial_value_c *_instance;
+    static type_initial_value_c *instance(void);
     void *handle_type_spec(symbol_c *base_type_name, symbol_c *type_spec_init);
 
   private:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/aclocal.m4	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,971 @@
+# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.3], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.3])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+m4_if([$1], [v7],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/config.h.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,171 @@
+/* config/config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `pow' function. */
+#undef HAVE_POW
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+   and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+   `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+   a type exists and the standard includes do not define it. */
+#undef int8_t
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint8_t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configure	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,7219 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for matiec 0.1.
+#
+# Report bugs to <msousa@fe.up.pt, beremiz-devel@lists.sourceforge.net>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	# Preserve -v and -x to the replacement shell.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	case $- in # ((((
+	  *v*x* | *x*v* ) as_opts=-vx ;;
+	  *v* ) as_opts=-v ;;
+	  *x* ) as_opts=-x ;;
+	  * ) as_opts= ;;
+	esac
+	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and msousa@fe.up.pt,
+$0: beremiz-devel@lists.sourceforge.net about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='matiec'
+PACKAGE_TARNAME='matiec'
+PACKAGE_VERSION='0.1'
+PACKAGE_STRING='matiec 0.1'
+PACKAGE_BUGREPORT='msousa@fe.up.pt, beremiz-devel@lists.sourceforge.net'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_func_list=
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+CPP
+RANLIB
+LN_S
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+LEXLIB
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+LEX_OUTPUT_ROOT
+LEX
+YFLAGS
+YACC
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+YACC
+YFLAGS
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures matiec 0.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/matiec]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of matiec 0.1:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+
+Some influential environment variables:
+  YACC        The `Yet Another Compiler Compiler' implementation to use.
+              Defaults to the first program found out of: `bison -y', `byacc',
+              `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <msousa@fe.up.pt, beremiz-devel@lists.sourceforge.net>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+matiec configure 0.1
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ##
+## Report this to msousa@fe.up.pt ##
+## bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in int$2_t 'int' 'long int' \
+	 'long long int' 'short int' 'signed char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	     enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	        enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  case $ac_type in #(
+  int$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+	 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  case $ac_type in #(
+  uint$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by matiec $as_me 0.1, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+as_fn_append ac_header_list " sys/time.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_func_list " alarm"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_config_headers="$ac_config_headers config/config.h"
+
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+am__api_version='1.11'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='matiec'
+ VERSION='0.1'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# Before checking for CXX and CC, set CFLAGS and CXXFLAGS because they
+# are otherwise initialized to contain -g -O2
+if test "x$CFLAGS" = "x"; then
+CFLAGS=
+fi
+if test "x$CXXFLAGS" = "x"; then
+CXXFLAGS=
+fi
+
+# Checks for programs.
+for ac_prog in 'bison -y' byacc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_YACC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_YACC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
+$as_echo "$YACC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+
+for ac_prog in flex lex
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LEX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LEX"; then
+  ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LEX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5
+$as_echo "$LEX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
+if test "x$LEX" != "x:"; then
+  cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
+#endif
+int
+main (void)
+{
+  return ! yylex () + ! yywrap ();
+}
+_ACEOF
+{ { ac_try="$LEX conftest.l"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5
+$as_echo_n "checking lex output file root... " >&6; }
+if ${ac_cv_prog_lex_root+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test -f lex.yy.c; then
+  ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+  ac_cv_prog_lex_root=lexyy
+else
+  as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5
+$as_echo "$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5
+$as_echo_n "checking lex library... " >&6; }
+if ${ac_cv_lib_lex+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    ac_save_LIBS=$LIBS
+    ac_cv_lib_lex='none needed'
+    for ac_lib in '' -lfl -ll; do
+      LIBS="$ac_lib $ac_save_LIBS"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lex=$ac_lib
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      test "$ac_cv_lib_lex" != 'none needed' && break
+    done
+    LIBS=$ac_save_LIBS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5
+$as_echo "$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5
+$as_echo_n "checking whether yytext is a pointer... " >&6; }
+if ${ac_cv_prog_lex_yytext_pointer+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent.  Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+ac_save_LIBS=$LIBS
+LIBS="$LEXLIB $ac_save_LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+  #define YYTEXT_POINTER 1
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_prog_lex_yytext_pointer=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5
+$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; }
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+
+$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h
+
+fi
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
+
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+
+# Check bison version, we need a version great or equal than 2.4 to build matiec.
+version_bison="$(bison --version | sed q | cut -d' ' -f4)"
+version_bison=${version_bison:0:3}
+
+if awk -v ver="$version_bison" 'BEGIN { if (ver < 2.4) exit 1; }'; then :
+  have_bison_correct=yes
+else
+  have_bison_correct=no
+fi
+
+
+if test "x${have_bison_correct}" = xno; then
+  echo "------------------------------------------"
+  echo " Wrong bison version: $version_bison < 2.4 "
+  echo "------------------------------------------"
+  (exit 1); exit 1;
+fi
+
+# Checks for header files.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in float.h limits.h stdint.h stdlib.h string.h strings.h sys/timeb.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+	struct s { _Bool s: 1; _Bool t; } s;
+
+	char a[true == 1 ? 1 : -1];
+	char b[false == 0 ? 1 : -1];
+	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+	char d[(bool) 0.5 == true ? 1 : -1];
+	/* See body of main program for 'e'.  */
+	char f[(_Bool) 0.0 == false ? 1 : -1];
+	char g[true];
+	char h[sizeof (_Bool)];
+	char i[sizeof s.t];
+	enum { j = false, k = true, l = false * true, m = true * 256 };
+	/* The following fails for
+	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+	_Bool n[m];
+	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+	/* Catch a bug in an HP-UX C compiler.  See
+	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+	 */
+	_Bool q = true;
+	_Bool *pq = &q;
+
+int
+main ()
+{
+
+	bool e = &s;
+	*pq |= q;
+	*pq |= ! q;
+	/* Refer to every declared value, to avoid compiler optimizations.  */
+	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+		+ !m + !n + !o + !p + !q + !pq);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdbool_h=yes
+else
+  ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+  no|yes) ;; #(
+  *)
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+  esac
+
+
+# Checks for library functions.
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_malloc_0_nonnull=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_malloc_0_nonnull=yes
+else
+  ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+
+else
+  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_time=yes
+else
+  ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+
+
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+  for ac_func in $ac_func_list
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
+$as_echo_n "checking for working mktime... " >&6; }
+if ${ac_cv_func_working_mktime+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_working_mktime=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Test program from Paul Eggert and Tony Leneis.  */
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+#include <limits.h>
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifndef HAVE_ALARM
+# define alarm(X) /* empty */
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests.  */
+#undef putenv
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable.  */
+static const char *tz_strings[] = {
+  (const char *) 0, "TZ=GMT0", "TZ=JST-9",
+  "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+   Based on a problem report from Andreas Jaeger.  */
+static int
+spring_forward_gap ()
+{
+  /* glibc (up to about 1998-10-07) failed this test. */
+  struct tm tm;
+
+  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+     instead of "TZ=America/Vancouver" in order to detect the bug even
+     on systems that don't support the Olson extension, or don't have the
+     full zoneinfo tables installed.  */
+  putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
+
+  tm.tm_year = 98;
+  tm.tm_mon = 3;
+  tm.tm_mday = 5;
+  tm.tm_hour = 2;
+  tm.tm_min = 0;
+  tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+  return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (time_t now)
+{
+  struct tm *lt;
+  return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+  return (mktime_test1 (now)
+	  && mktime_test1 ((time_t) (time_t_max - now))
+	  && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+  /* Based on code from Ariel Faigon.  */
+  struct tm tm;
+  tm.tm_year = 96;
+  tm.tm_mon = 3;
+  tm.tm_mday = 0;
+  tm.tm_hour = 0;
+  tm.tm_min = 0;
+  tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+  mktime (&tm);
+  return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+  struct tm tm;
+  time_t now;
+  tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+  now = mktime (&tm);
+  if (now != (time_t) -1)
+    {
+      struct tm *lt = localtime (&now);
+      if (! (lt
+	     && lt->tm_year == tm.tm_year
+	     && lt->tm_mon == tm.tm_mon
+	     && lt->tm_mday == tm.tm_mday
+	     && lt->tm_hour == tm.tm_hour
+	     && lt->tm_min == tm.tm_min
+	     && lt->tm_sec == tm.tm_sec
+	     && lt->tm_yday == tm.tm_yday
+	     && lt->tm_wday == tm.tm_wday
+	     && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+		  == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+	return 0;
+    }
+  return 1;
+}
+
+static int
+year_2050_test ()
+{
+  /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+     ignoring leap seconds.  */
+  unsigned long int answer = 2527315200UL;
+
+  struct tm tm;
+  time_t t;
+  tm.tm_year = 2050 - 1900;
+  tm.tm_mon = 2 - 1;
+  tm.tm_mday = 1;
+  tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+
+  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+     instead of "TZ=America/Vancouver" in order to detect the bug even
+     on systems that don't support the Olson extension, or don't have the
+     full zoneinfo tables installed.  */
+  putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
+
+  t = mktime (&tm);
+
+  /* Check that the result is either a failure, or close enough
+     to the correct answer that we can assume the discrepancy is
+     due to leap seconds.  */
+  return (t == (time_t) -1
+	  || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+int
+main ()
+{
+  time_t t, delta;
+  int i, j;
+
+  /* This test makes some buggy mktime implementations loop.
+     Give up after 60 seconds; a mktime slower than that
+     isn't worth using anyway.  */
+  alarm (60);
+
+  for (;;)
+    {
+      t = (time_t_max << 1) + 1;
+      if (t <= time_t_max)
+	break;
+      time_t_max = t;
+    }
+  time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
+
+  delta = time_t_max / 997; /* a suitable prime number */
+  for (i = 0; i < N_STRINGS; i++)
+    {
+      if (tz_strings[i])
+	putenv ((char*) tz_strings[i]);
+
+      for (t = 0; t <= time_t_max - delta; t += delta)
+	if (! mktime_test (t))
+	  return 1;
+      if (! (mktime_test ((time_t) 1)
+	     && mktime_test ((time_t) (60 * 60))
+	     && mktime_test ((time_t) (60 * 60 * 24))))
+	return 1;
+
+      for (j = 1; ; j <<= 1)
+	if (! bigtime_test (j))
+	  return 1;
+	else if (INT_MAX / 2 < j)
+	  break;
+      if (! bigtime_test (INT_MAX))
+	return 1;
+    }
+  return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_working_mktime=yes
+else
+  ac_cv_func_working_mktime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5
+$as_echo "$ac_cv_func_working_mktime" >&6; }
+if test $ac_cv_func_working_mktime = no; then
+  case " $LIBOBJS " in
+  *" mktime.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS mktime.$ac_objext"
+ ;;
+esac
+
+fi
+
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_realloc_0_nonnull=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
+
+int
+main ()
+{
+return ! realloc (0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_realloc_0_nonnull=yes
+else
+  ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
+
+else
+  $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
+
+   case " $LIBOBJS " in
+  *" realloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
+
+fi
+
+
+for ac_func in clock_gettime memset pow strcasecmp strdup strtoul strtoull
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile absyntax/Makefile absyntax_utils/Makefile stage1_2/Makefile stage3/Makefile stage4/Makefile stage4/generate_c/Makefile stage4/generate_iec/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by matiec $as_me 0.1, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <msousa@fe.up.pt, beremiz-devel@lists.sourceforge.net>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+matiec config.status 0.1
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS config/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "absyntax/Makefile") CONFIG_FILES="$CONFIG_FILES absyntax/Makefile" ;;
+    "absyntax_utils/Makefile") CONFIG_FILES="$CONFIG_FILES absyntax_utils/Makefile" ;;
+    "stage1_2/Makefile") CONFIG_FILES="$CONFIG_FILES stage1_2/Makefile" ;;
+    "stage3/Makefile") CONFIG_FILES="$CONFIG_FILES stage3/Makefile" ;;
+    "stage4/Makefile") CONFIG_FILES="$CONFIG_FILES stage4/Makefile" ;;
+    "stage4/generate_c/Makefile") CONFIG_FILES="$CONFIG_FILES stage4/generate_c/Makefile" ;;
+    "stage4/generate_iec/Makefile") CONFIG_FILES="$CONFIG_FILES stage4/generate_iec/Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+
--- a/configure.ac	Sat Feb 23 23:14:59 2013 +0100
+++ b/configure.ac	Fri Mar 08 01:01:15 2013 +0100
@@ -28,7 +28,8 @@
 AC_PROG_AWK
 
 # Check bison version, we need a version great or equal than 2.4 to build matiec.
-[[[ $(bison --version) =~ ([0-9][.][0-9]*) ]]] && version_bison="${BASH_REMATCH[[1]]}"
+version_bison="$(bison --version | sed q | cut -d' ' -f4)"
+version_bison=${version_bison:0:3}
 
 AS_IF([awk -v ver="$version_bison" 'BEGIN { if (ver < 2.4) exit 1; }'],
 	[have_bison_correct=yes], [have_bison_correct=no])
--- a/lib/iec_std_lib.h	Sat Feb 23 23:14:59 2013 +0100
+++ b/lib/iec_std_lib.h	Fri Mar 08 01:01:15 2013 +0100
@@ -26,6 +26,10 @@
  *       $gcc -E iec_std_lib.h 
  */
 
+#ifndef _IEC_STD_LIB_H
+#define _IEC_STD_LIB_H
+
+
 #include <limits.h>
 #include <float.h>
 #include <math.h>
@@ -339,7 +343,7 @@
 static inline TIME __time_mul(TIME IN1, LREAL IN2){
   LREAL s_f = IN1.tv_sec * IN2;
   time_t s = (time_t)s_f;
-  div_t ns = div((int)(IN1.tv_nsec * IN2), 1000000000);
+  div_t ns = div((int)((LREAL)IN1.tv_nsec * IN2), 1000000000);
   TIME res = {(long)s + ns.quot,
 		      (long)ns.rem + (s_f - s) * 1000000000 };
   __normalize_timespec(&res);
@@ -1911,8 +1915,8 @@
     TEST_EN_COND(STRING, L < 0)\
     res = __INIT_STRING;\
     L = L < (TYPENAME)IN.len ? L : (TYPENAME)IN.len;\
-    memcpy(&res.body, &IN.body, L);\
-    res.len = L;\
+    memcpy(&res.body, &IN.body, (size_t)L);\
+    res.len = (__strlen_t)L;\
     return res;\
 }
 __ANY_INT(__left)
@@ -1928,8 +1932,8 @@
   TEST_EN_COND(STRING, L < 0)\
   res = __INIT_STRING;\
   L = L < (TYPENAME)IN.len ? L : (TYPENAME)IN.len;\
-  memcpy(&res.body, &IN.body[(TYPENAME)IN.len - L], L);\
-  res.len = L;\
+  memcpy(&res.body, &IN.body[(TYPENAME)IN.len - L], (size_t)L);\
+  res.len = (__strlen_t)L;\
   return res;\
 }
 __ANY_INT(__right)
@@ -1947,8 +1951,8 @@
   if(P <= (TYPENAME)IN.len){\
 	P -= 1; /* now can be used as [index]*/\
 	L = L + P <= (TYPENAME)IN.len ? L : (TYPENAME)IN.len - P;\
-	memcpy(&res.body, &IN.body[P] , L);\
-	res.len = L;\
+	memcpy(&res.body, &IN.body[P] , (size_t)L);\
+	res.len = (__strlen_t)L;\
   }\
   return res;\
 }
@@ -2012,7 +2016,7 @@
 #define __iec_(TYPENAME) \
 static inline STRING INSERT__STRING__STRING__STRING__##TYPENAME(EN_ENO_PARAMS, STRING str1, STRING str2, TYPENAME P){\
   TEST_EN_COND(STRING, P < 0)\
-  return (STRING)__insert(str1,str2,P);\
+  return (STRING)__insert(str1,str2,(__strlen_t)P);\
 }
 __ANY_INT(__iec_)
 #undef __iec_
@@ -2043,7 +2047,7 @@
 #define __iec_(TYPENAME) \
 static inline STRING DELETE__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, STRING str, TYPENAME L, TYPENAME P){\
   TEST_EN_COND(STRING, L < 0 || P < 0)\
-  return (STRING)__delete(str,L,P);\
+  return (STRING)__delete(str,(__strlen_t)L,(__strlen_t)P);\
 }
 __ANY_INT(__iec_)
 #undef __iec_
@@ -2084,7 +2088,7 @@
 #define __iec_(TYPENAME) \
 static inline STRING REPLACE__STRING__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, STRING str1, STRING str2, TYPENAME L, TYPENAME P){\
   TEST_EN_COND(STRING, L < 0 || P < 0)\
-  return (STRING)__replace(str1,str2,L,P);\
+  return (STRING)__replace(str1,str2,(__strlen_t)L,(__strlen_t)P);\
 }
 __ANY_INT(__iec_)
 #undef __iec_
@@ -2180,7 +2184,7 @@
 #define __iec_(TYPENAME)\
 static inline TIME MULTIME__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
   TEST_EN(TIME)\
-  return __time_mul(IN1, IN2);\
+  return __time_mul(IN1, (LREAL)IN2);\
 }
 __ANY_NUM(__iec_)
 #undef __iec_
@@ -2189,7 +2193,7 @@
 #define __iec_(TYPENAME)\
 static inline TIME MUL__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
   TEST_EN(TIME)\
-  return __time_mul(IN1, IN2);\
+  return __time_mul(IN1, (LREAL)IN2);\
 }
 __ANY_NUM(__iec_)
 #undef __iec_
@@ -2198,7 +2202,7 @@
 #define __iec_(TYPENAME)\
 static inline TIME DIVTIME__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
   TEST_EN(TIME)\
-  return __time_div(IN1, IN2);\
+  return __time_div(IN1, (LREAL)IN2);\
 }
 __ANY_NUM(__iec_)
 #undef __iec_
@@ -2207,7 +2211,7 @@
 #define __iec_(TYPENAME)\
 static inline TIME DIV__TIME__TIME__##TYPENAME(EN_ENO_PARAMS, TIME IN1, TYPENAME IN2){\
   TEST_EN(TIME)\
-  return __time_div(IN1, IN2);\
+  return __time_div(IN1, (LREAL)IN2);\
 }
 __ANY_NUM(__iec_)
 #undef __iec_
@@ -2232,3 +2236,5 @@
 /********************************************/
 
 /* Do we support this? */
+
+#endif /* _IEC_STD_LIB_H */
--- a/lib/iec_types.h	Sat Feb 23 23:14:59 2013 +0100
+++ b/lib/iec_types.h	Fri Mar 08 01:01:15 2013 +0100
@@ -32,7 +32,7 @@
 typedef struct {
     long int tv_sec;            /* Seconds.  */
     long int tv_nsec;           /* Nanoseconds.  */
-}__attribute__((packed)) IEC_TIMESPEC;
+} /* __attribute__((packed)) */ IEC_TIMESPEC;  /* packed is gcc specific! */
 
 typedef IEC_TIMESPEC IEC_TIME;
 typedef IEC_TIMESPEC IEC_DATE;
@@ -51,6 +51,6 @@
 typedef struct {
     __strlen_t len;
     uint8_t body[STR_MAX_LEN];
-} __attribute__((packed)) IEC_STRING;
+} /* __attribute__((packed)) */ IEC_STRING;  /* packed is gcc specific! */
 
 #endif /*IEC_TYPES_H*/
--- a/lib/iec_types_all.h	Sat Feb 23 23:14:59 2013 +0100
+++ b/lib/iec_types_all.h	Fri Mar 08 01:01:15 2013 +0100
@@ -62,8 +62,10 @@
 /* Include non windows.h clashing typedefs */
 #include "iec_types.h"
 
-#define TRUE 1
-#define FALSE 0
+#ifndef TRUE
+  #define TRUE 1
+  #define FALSE 0
+#endif
 
 #define __IEC_DEBUG_FLAG 0x01
 #define __IEC_FORCE_FLAG 0x02
--- a/main.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/main.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -67,21 +67,28 @@
 
 
 
-//#include <stdio.h>   // printf()
+#include <stdio.h>
 #include <getopt.h>
 #include <string.h>
-#include <stdlib.h>  // EXIT_FAILURE
-#include "absyntax/absyntax.hh"  // symbol_c type
-
-/* A macro for printing out internal parser errors... */
-#include <iostream> // required for std::cerr
+#include <stdlib.h>
+#include <stdarg.h>
+#include <iostream>
+
+
+#include "config/config.h"
+#include "absyntax/absyntax.hh"
+#include "absyntax_utils/absyntax_utils.hh"
+#include "stage1_2/stage1_2.hh"
+#include "stage3/stage3.hh"
+#include "stage4/stage4.hh"
+#include "main.hh"
+
 
 #ifndef HGVERSION
-#define HGVERSION ""
+   #define HGVERSION ""
 #endif
 
-#include "main.hh"  // symbol_c type
-#include <stdarg.h> // required for va_start(), va_list
+
 
 void error_exit(const char *file_name, int line_no, const char *errmsg, ...) {
   va_list argptr;
@@ -101,28 +108,20 @@
 }
 
 
-
-#include "config/config.h"
-#include "stage1_2/stage1_2.hh"
-#include "absyntax_utils/absyntax_utils.hh"
-
-int stage3(symbol_c *tree_root);
-int stage4(symbol_c *tree_root, const char *builddir);
-
-
 static void printusage(const char *cmd) {
-  printf("syntax: %s [-h] [-v] [-f] [-s] [-I <include_directory>] [-T <target_directory>] <input_file>\n", cmd);
+  printf("\nsyntax: %s [-h] [-v] [-f] [-s] [-c] [-I <include_directory>] [-T <target_directory>] <input_file>\n", cmd);
   printf("  h : show this help message\n");
   printf("  v : print version number\n");  
   printf("  f : display full token location on error messages\n");
       /******************************************************/
-      /* whether we are suporting safe extensions           */
+      /* whether we are supporting safe extensions          */
       /* as defined in PLCopen - Technical Committee 5      */
       /* Safety Software Technical Specification,           */
       /* Part 1: Concepts and Function Blocks,              */
-      /* Version 1.0 – Official Release                     */
+      /* Version 1.0 is Official Release                    */
       /******************************************************/
   printf("  s : allow use of safe extensions\n");
+  printf("  c : create conversion functions\n");
   printf("\n");
   printf("%s - Copyright (C) 2003-2011 \n"
          "This program comes with ABSOLUTELY NO WARRANTY!\n"
@@ -137,29 +136,34 @@
   stage1_2_options_t stage1_2_options = {false, false, NULL};
   int optres, errflg = 0;
   int path_len;
-/*
-  extern char *optarg;
-  extern int optind, optopt;
-*/
+
 
   /******************************************/
   /*   Parse command line options...        */
   /******************************************/
-  while ((optres = getopt(argc, argv, ":hvfsI:T:")) != -1) {
+  while ((optres = getopt(argc, argv, ":hvfscI:T:")) != -1) {
     switch(optres) {
     case 'h':
       printusage(argv[0]);
       return 0;
+
     case 'v':
       fprintf(stdout, "%s version %s\n"
 		      "changeset id: %s\n", PACKAGE_NAME, PACKAGE_VERSION, HGVERSION);      
-      return 0;        
+      return 0;
+
     case 'f':
       stage1_2_options.full_token_loc = true;
       break;
+
     case 's':
       stage1_2_options.safe_extensions = true;
       break;
+
+    case 'c':
+      stage1_2_options.conversion_functions = true;
+      break;
+
     case 'I':
       /* NOTE: To improve the usability under windows:
        *       We delete last char's path if it ends with "\".
@@ -170,20 +174,24 @@
       if (optarg[path_len] == '\\') optarg[path_len]= '\0';
       stage1_2_options.includedir = optarg;
       break;
+
     case 'T':
       /* NOTE: see note above */
       path_len = strlen(optarg) - 1;
       if (optarg[path_len] == '\\') optarg[path_len]= '\0';
       builddir = optarg;
       break;
+
     case ':':       /* -I or -T without operand */
       fprintf(stderr, "Option -%c requires an operand\n", optopt);
       errflg++;
       break;
+
     case '?':
       fprintf(stderr, "Unrecognized option: -%c\n", optopt);
       errflg++;
       break;
+
     default:
       fprintf(stderr, "Unknown error while parsing command line options.");
       errflg++;
@@ -202,9 +210,8 @@
   }
 
   if (errflg) {
-      printf("\n");
-      printusage(argv[0]);
-      return EXIT_FAILURE;
+    printusage(argv[0]);
+    return EXIT_FAILURE;
   }
 
 
@@ -225,7 +232,6 @@
   if (stage3(tree_root) < 0)
     return EXIT_FAILURE;
   
-
   /* 3rd Pass */
   if (stage4(tree_root, builddir) < 0)
     return EXIT_FAILURE;
--- a/main.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/main.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -40,19 +40,17 @@
 #include <stddef.h>  /* required for NULL */
  
 #define ERROR               error_exit(__FILE__,__LINE__)
-#define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg)
-// #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, __VA_ARGS__)
+#define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, ## __VA_ARGS__)
 
 extern void error_exit(const char *file_name, int line_no, const char *errmsg = NULL, ...);
 
 
 
 
-
-
  /* Get the definition of INT16_MAX, INT16_MIN, UINT64_MAX, INT64_MAX, INT64_MIN, ... */
-
+#ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS /* required to have UINTxx_MAX defined when including stdint.h from C++ source code. */
+#endif
 #include <stdint.h>         
 #include <limits>
 
@@ -122,6 +120,15 @@
 
 
 
+/* get the printf format macros for printing variables of fixed data size
+ * e.g.  int64_t v; printf("value=%"PRId64" !!\n", v);
+ * e.g. uint64_t v; printf("value=%"PRIu64" !!\n", v);
+ * e.g. uint64_t v; printf("value=%"PRIx64" !!\n", v);  // hexadecimal format
+ */
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+#include <inttypes.h>
 
 
-#endif // #ifndef _MAIN_HH
\ No newline at end of file
+#endif // #ifndef _MAIN_HH
--- a/stage1_2/Makefile.am	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage1_2/Makefile.am	Fri Mar 08 01:01:15 2013 +0100
@@ -16,6 +16,7 @@
 libstage1_2_a_SOURCES = \
 	iec_flex.ll \
 	iec_bison.yy \
+    create_enumtype_conversion_functions.cc \
 	stage1_2.cc 
 
 libstage1_2_a_CPPFLAGS =  -DDEFAULT_LIBDIR='"lib"' -I../../absyntax
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage1_2/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,596 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in iec_bison.cc iec_bison.h iec_flex.cc
+subdir = stage1_2
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libstage1_2_a_AR = $(AR) $(ARFLAGS)
+libstage1_2_a_LIBADD =
+am_libstage1_2_a_OBJECTS = libstage1_2_a-iec_flex.$(OBJEXT) \
+	libstage1_2_a-iec_bison.$(OBJEXT) \
+	libstage1_2_a-create_enumtype_conversion_functions.$(OBJEXT) \
+	libstage1_2_a-stage1_2.$(OBJEXT)
+libstage1_2_a_OBJECTS = $(am_libstage1_2_a_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
+YLWRAP = $(top_srcdir)/config/ylwrap
+YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libstage1_2_a_SOURCES)
+DIST_SOURCES = $(libstage1_2_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+AM_YFLAGS = -d
+AM_LFLAGS = -o$(LEX_OUTPUT_ROOT).c
+
+# Make sure this header file is generated first (by bison), as it is included
+# by other C++ code that will also be compiled.
+BUILT_SOURCES = iec_bison.h
+CLEANFILES = \
+	iec_flex.cc \
+	iec_bison.cc \
+	iec_bison.h
+
+lib_LIBRARIES = libstage1_2.a
+libstage1_2_a_SOURCES = \
+	iec_flex.ll \
+	iec_bison.yy \
+    create_enumtype_conversion_functions.cc \
+	stage1_2.cc 
+
+libstage1_2_a_CPPFLAGS = -DDEFAULT_LIBDIR='"lib"' -I../../absyntax
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .ll .o .obj .yy
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign stage1_2/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign stage1_2/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  if test -f $$p; then \
+	    $(am__strip_dir) \
+	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+iec_bison.h: iec_bison.cc
+	@if test ! -f $@; then rm -f iec_bison.cc; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) iec_bison.cc; else :; fi
+libstage1_2.a: $(libstage1_2_a_OBJECTS) $(libstage1_2_a_DEPENDENCIES) $(EXTRA_libstage1_2_a_DEPENDENCIES) 
+	-rm -f libstage1_2.a
+	$(libstage1_2_a_AR) libstage1_2.a $(libstage1_2_a_OBJECTS) $(libstage1_2_a_LIBADD)
+	$(RANLIB) libstage1_2.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstage1_2_a-iec_bison.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstage1_2_a-iec_flex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstage1_2_a-stage1_2.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+libstage1_2_a-iec_flex.o: iec_flex.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-iec_flex.o -MD -MP -MF $(DEPDIR)/libstage1_2_a-iec_flex.Tpo -c -o libstage1_2_a-iec_flex.o `test -f 'iec_flex.cc' || echo '$(srcdir)/'`iec_flex.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-iec_flex.Tpo $(DEPDIR)/libstage1_2_a-iec_flex.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='iec_flex.cc' object='libstage1_2_a-iec_flex.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-iec_flex.o `test -f 'iec_flex.cc' || echo '$(srcdir)/'`iec_flex.cc
+
+libstage1_2_a-iec_flex.obj: iec_flex.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-iec_flex.obj -MD -MP -MF $(DEPDIR)/libstage1_2_a-iec_flex.Tpo -c -o libstage1_2_a-iec_flex.obj `if test -f 'iec_flex.cc'; then $(CYGPATH_W) 'iec_flex.cc'; else $(CYGPATH_W) '$(srcdir)/iec_flex.cc'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-iec_flex.Tpo $(DEPDIR)/libstage1_2_a-iec_flex.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='iec_flex.cc' object='libstage1_2_a-iec_flex.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-iec_flex.obj `if test -f 'iec_flex.cc'; then $(CYGPATH_W) 'iec_flex.cc'; else $(CYGPATH_W) '$(srcdir)/iec_flex.cc'; fi`
+
+libstage1_2_a-iec_bison.o: iec_bison.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-iec_bison.o -MD -MP -MF $(DEPDIR)/libstage1_2_a-iec_bison.Tpo -c -o libstage1_2_a-iec_bison.o `test -f 'iec_bison.cc' || echo '$(srcdir)/'`iec_bison.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-iec_bison.Tpo $(DEPDIR)/libstage1_2_a-iec_bison.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='iec_bison.cc' object='libstage1_2_a-iec_bison.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-iec_bison.o `test -f 'iec_bison.cc' || echo '$(srcdir)/'`iec_bison.cc
+
+libstage1_2_a-iec_bison.obj: iec_bison.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-iec_bison.obj -MD -MP -MF $(DEPDIR)/libstage1_2_a-iec_bison.Tpo -c -o libstage1_2_a-iec_bison.obj `if test -f 'iec_bison.cc'; then $(CYGPATH_W) 'iec_bison.cc'; else $(CYGPATH_W) '$(srcdir)/iec_bison.cc'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-iec_bison.Tpo $(DEPDIR)/libstage1_2_a-iec_bison.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='iec_bison.cc' object='libstage1_2_a-iec_bison.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-iec_bison.obj `if test -f 'iec_bison.cc'; then $(CYGPATH_W) 'iec_bison.cc'; else $(CYGPATH_W) '$(srcdir)/iec_bison.cc'; fi`
+
+libstage1_2_a-create_enumtype_conversion_functions.o: create_enumtype_conversion_functions.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-create_enumtype_conversion_functions.o -MD -MP -MF $(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Tpo -c -o libstage1_2_a-create_enumtype_conversion_functions.o `test -f 'create_enumtype_conversion_functions.cc' || echo '$(srcdir)/'`create_enumtype_conversion_functions.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Tpo $(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='create_enumtype_conversion_functions.cc' object='libstage1_2_a-create_enumtype_conversion_functions.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-create_enumtype_conversion_functions.o `test -f 'create_enumtype_conversion_functions.cc' || echo '$(srcdir)/'`create_enumtype_conversion_functions.cc
+
+libstage1_2_a-create_enumtype_conversion_functions.obj: create_enumtype_conversion_functions.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-create_enumtype_conversion_functions.obj -MD -MP -MF $(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Tpo -c -o libstage1_2_a-create_enumtype_conversion_functions.obj `if test -f 'create_enumtype_conversion_functions.cc'; then $(CYGPATH_W) 'create_enumtype_conversion_functions.cc'; else $(CYGPATH_W) '$(srcdir)/create_enumtype_conversion_functions.cc'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Tpo $(DEPDIR)/libstage1_2_a-create_enumtype_conversion_functions.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='create_enumtype_conversion_functions.cc' object='libstage1_2_a-create_enumtype_conversion_functions.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-create_enumtype_conversion_functions.obj `if test -f 'create_enumtype_conversion_functions.cc'; then $(CYGPATH_W) 'create_enumtype_conversion_functions.cc'; else $(CYGPATH_W) '$(srcdir)/create_enumtype_conversion_functions.cc'; fi`
+
+libstage1_2_a-stage1_2.o: stage1_2.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-stage1_2.o -MD -MP -MF $(DEPDIR)/libstage1_2_a-stage1_2.Tpo -c -o libstage1_2_a-stage1_2.o `test -f 'stage1_2.cc' || echo '$(srcdir)/'`stage1_2.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-stage1_2.Tpo $(DEPDIR)/libstage1_2_a-stage1_2.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='stage1_2.cc' object='libstage1_2_a-stage1_2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-stage1_2.o `test -f 'stage1_2.cc' || echo '$(srcdir)/'`stage1_2.cc
+
+libstage1_2_a-stage1_2.obj: stage1_2.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libstage1_2_a-stage1_2.obj -MD -MP -MF $(DEPDIR)/libstage1_2_a-stage1_2.Tpo -c -o libstage1_2_a-stage1_2.obj `if test -f 'stage1_2.cc'; then $(CYGPATH_W) 'stage1_2.cc'; else $(CYGPATH_W) '$(srcdir)/stage1_2.cc'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libstage1_2_a-stage1_2.Tpo $(DEPDIR)/libstage1_2_a-stage1_2.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='stage1_2.cc' object='libstage1_2_a-stage1_2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstage1_2_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libstage1_2_a-stage1_2.obj `if test -f 'stage1_2.cc'; then $(CYGPATH_W) 'stage1_2.cc'; else $(CYGPATH_W) '$(srcdir)/stage1_2.cc'; fi`
+
+.ll.cc:
+	$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
+
+.yy.cc:
+	$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-rm -f iec_bison.cc
+	-rm -f iec_bison.h
+	-rm -f iec_flex.cc
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLIBRARIES
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage1_2/create_enumtype_conversion_functions.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,327 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2009-2012  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2012       Manuele Conti  (conti.ma@alice.it)
+ *
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+#include <sstream>
+#include "create_enumtype_conversion_functions.hh"
+
+/* set to 1 to see debug info during execution */
+static const int debug = 0;
+
+
+/* 
+ * The create_enumtype_conversion_functions_c class generates ST source code!
+ * This code is in actual fact datatype conversion functions between user defined
+ * enumerated datatypes, and some basic datatypes.
+ *
+ * These conversion functions cannot be implemented the normal way (i.e. in the standard library)
+ * since they convert from/to a datatype that is defined by the user. So, we generate these conversions
+ * functions on the fly! 
+ * (to get an idea of what the generated code looks like, see the comments in create_enumtype_conversion_functions.cc)
+ *
+ * Currently, we support conversion between the user defined enumerated datatype and STRING,
+ * SINT, INT, DINT, LINT, USINT, UINT, UDINT, ULINT (basically the ANY_INT)
+ *
+ * ST source code is generated when the method get_declaration() is called. since the
+ * create_enumtype_conversion_functions_c inherits from the iterator visitor, this method may be 
+ * passed either the root of an abstract syntax tree, or sub-tree of the AST.
+ *
+ * This class will iterate through that AST, and for each enumerated type declaration, will 
+ * create the apropriate conversion functions.
+ */
+
+create_enumtype_conversion_functions_c *create_enumtype_conversion_functions_c::singleton = NULL;
+
+create_enumtype_conversion_functions_c:: create_enumtype_conversion_functions_c(symbol_c *ignore) {}
+create_enumtype_conversion_functions_c::~create_enumtype_conversion_functions_c(void)             {}
+
+
+std::string &create_enumtype_conversion_functions_c::get_declaration(symbol_c *symbol) {
+    if (NULL == singleton)  singleton = new create_enumtype_conversion_functions_c(NULL);
+    if (NULL == singleton)  ERROR_MSG("Out of memory. Bailing out!\n");
+    
+    singleton->text = "";
+    if (NULL != symbol) 
+      symbol->accept(*singleton);
+
+    return singleton->text;
+}
+
+
+void *create_enumtype_conversion_functions_c::visit(identifier_c *symbol) {
+    currentToken = symbol->value;
+    return NULL;
+}
+
+/**********************/
+/* B 1.3 - Data types */
+/**********************/
+/********************************/
+/* B 1.3.3 - Derived data types */
+/********************************/
+void *create_enumtype_conversion_functions_c::visit(enumerated_type_declaration_c *symbol) {
+    std::string enumerateName;
+    std::string functionName;
+    std::list <std::string> enumerateValues;
+
+    symbol->enumerated_type_name->accept(*this);
+    enumerateName = currentToken;
+
+    symbol->enumerated_spec_init->accept(*this);
+    enumerateValues = currentTokenList;
+
+    printStringToEnum  (enumerateName, enumerateValues);
+    printEnumToString  (enumerateName, enumerateValues);
+    for (size_t s = 8; s <= 64; s*= 2) {
+        printIntegerToEnum (enumerateName, enumerateValues, true , s);
+        printEnumToInteger (enumerateName, enumerateValues, true , s);
+        printIntegerToEnum (enumerateName, enumerateValues, false, s);
+        printEnumToInteger (enumerateName, enumerateValues, false, s);
+    }
+    if (debug) std::cout << text << std::endl;
+    
+    return NULL;
+}
+
+void *create_enumtype_conversion_functions_c::visit(enumerated_value_list_c *symbol) {
+    list_c *list;
+
+    currentTokenList.clear();
+    list = (list_c *)symbol;
+    for (int i = 0; i < list->n; i++) {
+        list->elements[i]->accept(*this);
+        currentTokenList.push_back(currentToken);
+    }
+
+    return NULL;
+}
+
+/*
+ * getIntegerName function generate a integer data name from signed and size.
+ */
+std::string create_enumtype_conversion_functions_c::getIntegerName(bool isSigned, size_t size) {
+    std::string integerType = "";
+    if (! isSigned) {
+        integerType = "U";
+    }
+    switch(size) {
+    case 8 : integerType += "S"; break;
+    case 16:                     break;
+    case 32: integerType += "D"; break;
+    case 64: integerType += "L"; break;
+    default:                     break;
+    }
+    integerType +="INT";
+
+    return integerType;
+}
+
+/*
+ * printStringToEnum function print conversion function from STRING to <ENUM>:
+ * ST Output:
+ *
+
+ FUNCTION STRING_TO_<ENUM> : <ENUM>
+  VAR_INPUT
+  IN: STRING;
+  END_VAR
+  IF IN = '<ENUM.VALUE_1>' THEN
+   STRING_TO_<ENUM> := <ENUM>#<ENUM.VALUE_1>;
+   RETURN;
+  END_IF;
+  ...
+  IF IN = '<ENUM.VALU_N>' THEN
+   STRING_TO_<ENUM> := <ENUM>#<ENUM.VALUE_N>;
+   RETURN;
+  END_IF;
+  ENO := FALSE;
+  END_FUNCTION
+
+  Note: if you change code below remember to update this comment.
+ */
+void create_enumtype_conversion_functions_c::printStringToEnum  (std::string &enumerateName, std::list<std::string> &enumerateValues) {
+    std::list <std::string>::const_iterator itr;
+    std::string functionName;
+
+    functionName = "STRING_TO_" + enumerateName;
+    text += "FUNCTION " + functionName + " : " + enumerateName;
+    text += "\nVAR_INPUT\nIN : STRING;\nEND_VAR\n";
+    for (itr = enumerateValues.begin(); itr != enumerateValues.end(); ++itr) {
+       std::string value = *itr;
+       text += "IF IN = '" + value + "' THEN\n";
+       text += " " + functionName + " := " + enumerateName + "#" + value + ";\n";
+       text += " RETURN;\n"; 
+       text += "END_IF;\n";
+    }
+    text += "ENO := FALSE;\n";
+    text += "END_FUNCTION\n\n";
+}
+
+/*
+ * printEnumToString function print conversion function from <ENUM> to STRING:
+ * ST Output:
+ *
+
+ FUNCTION <ENUM>_TO_STRING : STRING
+  VAR_INPUT
+  IN: <ENUM>;
+  END_VAR
+  IF IN = <ENUM>#<ENUM.VALUE_1> THEN
+   <ENUM>_TO_STRING := '<ENUM>#<ENUM.VALUE_1>';
+   RETURN;
+  END_IF;
+  ...
+  IF IN = <ENUM>#<ENUM.VALUE_N> THEN
+   <ENUM>_TO_STRING := '<ENUM>#<ENUM.VALUE_N>';
+   RETURN;
+  END_IF;
+  ENO := FALSE;
+  END_FUNCTION
+
+  Note: if you change code below remember to update this comment.
+ */
+void create_enumtype_conversion_functions_c::printEnumToString  (std::string &enumerateName, std::list<std::string> &enumerateValues) {
+    std::list <std::string>::const_iterator itr;
+    std::string functionName;
+
+    functionName = enumerateName + "_TO_STRING";
+    text += "FUNCTION " + functionName + " : STRING";
+    text += "\nVAR_INPUT\nIN : " + enumerateName + ";\nEND_VAR\n";
+    for (itr = enumerateValues.begin(); itr != enumerateValues.end(); ++itr) {
+        std::string value = *itr;
+        text += "IF IN = " + enumerateName + "#" + value + " THEN\n";
+        text += " " + functionName + " := '" + enumerateName + "#" + value + "';\n";
+        text += " RETURN;\n";
+        text += "END_IF;\n";
+    }
+    text += "ENO := FALSE;\n";
+    text += "END_FUNCTION\n\n";
+}
+
+/*
+ * printIntegerToEnum function print conversion function from <INTEGER> to <ENUM>:
+ * ST Output:
+ *
+
+ FUNCTION <INTEGER>_TO_<ENUM> : <ENUM>
+  VAR_INPUT
+  IN: <INTEGER>;
+  END_VAR
+  IF IN = 1 THEN
+   <INTEGER>_TO_<ENUM> := <ENUM>#<ENUM.VALUE_1>;
+   RETURN;
+  END_IF;
+  ...
+  IF IN = N THEN
+   <INTEGER>_TO_<ENUM> := <ENUM>#<ENUM.VALUE_N>;
+   RETURN;
+  END_IF;
+  ENO := FALSE;
+  END_FUNCTION
+
+  Note: if you change code below remember to update this comment.
+ */
+void create_enumtype_conversion_functions_c::printIntegerToEnum (std::string &enumerateName, std::list<std::string> &enumerateValues, bool isSigned, size_t size) {
+    std::list <std::string>::const_iterator itr;
+    std::string functionName;
+    std::string integerType;
+    int count;
+
+    integerType  = getIntegerName(isSigned, size);
+    functionName = integerType + "_TO_" + enumerateName;
+    text += "FUNCTION " + functionName + " : " + enumerateName;
+    text += "\nVAR_INPUT\nIN : " + integerType + ";\nEND_VAR\n";
+    count = 0;
+    for (itr = enumerateValues.begin(); itr != enumerateValues.end(); ++itr) {
+        std::string value = *itr;
+        std::stringstream out;
+        out << count;
+        text += "IF IN = " + out.str() + " THEN\n";
+        text += " " + functionName + " := " + enumerateName + "#" + value + ";\n";
+        text += " RETURN;\n";
+        text += "END_IF;\n";
+        count++;
+    }
+    text += "ENO := FALSE;\n";
+    text += "END_FUNCTION\n\n";
+}
+
+/*
+ * printEnumToInteger function print conversion function from <ENUM> to <INTEGER>:
+ * ST Output:
+ *
+
+ FUNCTION <ENUM>_TO_<INTEGER> : <INTEGER>
+  VAR_INPUT
+  IN: <INTEGER>;
+  END_VAR
+  IF IN = <ENUM>#<ENUM.VALUE_1> THEN
+   <ENUM>_TO_<INTEGER> := 1;
+   RETURN;
+  END_IF;
+  ...
+  IF IN = <ENUM>#<ENUM.VALUE_N> THEN
+   <ENUM>_TO_<INTEGER> := N;
+   RETURN;
+  END_IF;
+  ENO := FALSE;
+  END_FUNCTION
+
+  Note: if you change code below remember to update this comment.
+ */
+void create_enumtype_conversion_functions_c::printEnumToInteger (std::string &enumerateName, std::list<std::string> &enumerateValues, bool isSigned, size_t size) {
+    std::list <std::string>::const_iterator itr;
+    std::string functionName;
+    std::string integerType;
+    int count;
+
+    integerType  = getIntegerName(isSigned, size);
+    functionName = enumerateName + "_TO_" + integerType;
+    text += "FUNCTION " + functionName + " : " + integerType;
+    text += "\nVAR_INPUT\nIN : " + enumerateName + ";\nEND_VAR\n";
+    count = 0;
+    for (itr = enumerateValues.begin(); itr != enumerateValues.end(); ++itr) {
+        std::string value = *itr;
+        std::stringstream out;
+        out << count;
+        text += "IF IN = " + enumerateName + "#" + value + " THEN\n";
+        text += " " + functionName + " := " + out.str() + ";\n";
+        text += " RETURN;\n";
+        text += "END_IF;\n";
+        count++;
+    }
+    text += "ENO := FALSE;\n";
+    text += "END_FUNCTION\n\n";
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage1_2/create_enumtype_conversion_functions.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,79 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2009-2012  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2012       Manuele Conti  (conti.ma@alice.it)
+ *
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+/*
+ * create_enumtype_conversion_functions_c generates ST conversion functions source code for
+ * enumerate user defined data types.
+ *
+ */
+
+#ifndef _CREATE_ENUMTYPE_CONVERSION_FUNCTIONS_HH
+#define _CREATE_ENUMTYPE_CONVERSION_FUNCTIONS_HH
+
+#include <string>
+#include <list>
+
+#include "../absyntax_utils/absyntax_utils.hh"
+
+
+class create_enumtype_conversion_functions_c: public iterator_visitor_c {
+  private:
+    static create_enumtype_conversion_functions_c *singleton;
+    
+  public:
+    explicit create_enumtype_conversion_functions_c(symbol_c *ignore);
+    virtual ~create_enumtype_conversion_functions_c(void);
+    static std::string &get_declaration(symbol_c *symbol);
+
+    void *visit(identifier_c *symbol);
+    /**********************/
+    /* B 1.3 - Data types */
+    /**********************/
+    /********************************/
+    /* B 1.3.3 - Derived data types */
+    /********************************/
+    void *visit(enumerated_type_declaration_c *symbol);
+    void *visit(enumerated_value_list_c *symbol);
+
+  private:
+    std::string text;
+    std::string currentToken;
+    std::list <std::string> currentTokenList;
+    std::string getIntegerName(bool isSigned, size_t size);
+    void printStringToEnum  (std::string &enumerateName, std::list <std::string> &enumerateValues);
+    void printEnumToString  (std::string &enumerateName, std::list <std::string> &enumerateValues);
+    void printIntegerToEnum (std::string &enumerateName, std::list <std::string> &enumerateValues, bool isSigned, size_t size);
+    void printEnumToInteger (std::string &enumerateName, std::list <std::string> &enumerateValues, bool isSigned, size_t size);
+};
+
+#endif /* _CREATE_ENUMTYPE_CONVERSION_FUNCTIONS_HH */
--- a/stage1_2/iec_bison.yy	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage1_2/iec_bison.yy	Fri Mar 08 01:01:15 2013 +0100
@@ -100,7 +100,7 @@
 
 /* The interface through which bison and flex interact. */
 #include "stage1_2_priv.hh"
-
+#include "create_enumtype_conversion_functions.hh"
 
 #include "../absyntax_utils/add_en_eno_param_decl.hh"	/* required for  add_en_eno_param_decl_c */
 
@@ -203,6 +203,11 @@
  */
 extern bool full_token_loc;
 
+/* A global flag used to tell the parser whether to generate conversion function
+ * for enumerated data types.
+ */
+extern bool conversion_functions_;
+
 /* A pointer to the root of the parsing tree that will be generated 
  * by bison.
  */
@@ -232,7 +237,7 @@
                    int last_column,
                    const char *last_filename,
                    long int last_order,
-                   const char *additional_error_msg);
+                   const char *additional_error_msg);    
 %}
 
 
@@ -433,7 +438,7 @@
 /* B 1.2 - Constants */
 /*********************/
 %type <leaf>	constant
-%type <leaf>	non_negative_constant
+%type <leaf>	non_int_or_real_constant
 
 /******************************/
 /* B 1.2.1 - Numeric Literals */
@@ -1299,7 +1304,7 @@
 %type  <leaf>	unary_expression
 // %type  <leaf>	unary_operator
 %type  <leaf>	primary_expression
-%type  <leaf>	non_negative_primary_expression
+%type  <leaf>	non_int_or_real_primary_expression
 /* intermediate helper symbol for primary_expression */
 %type  <leaf>	function_invocation
 
@@ -1730,91 +1735,64 @@
 /* B 1.2 - Constants */
 /*********************/
 constant:
-  numeric_literal
-| character_string
+  character_string
 | time_literal
 | bit_string_literal
 | boolean_literal
+| numeric_literal  
+/* NOTE: Our definition of numeric_literal is diferent than the one in the standard.
+ *       We will now add what is missing in our definition of numeric literal, so our
+ *       definition of constant matches what the definition of constant in the standard.
+ */
 /* NOTE: in order to remove reduce/reduce conflicts,
  * [between -9.5 being parsed as 
  *     (i)   a signed real, 
  *     (ii)  or as a real preceded by the '-' operator
  *  ]
  *  we need to define a variant of the constant construct
- *  where any constant is never preceded by the '-' character.
- * In order to do this, we have borugh the signed_real 
- * directly into the definition of the constant construct
- * (so we can define another non_negative_constant
- * construct that does not include it!)
- */
-| signed_real
-/* NOTE: in order to remove reduce/reduce conflicts,
- * unsigned_integer, signed_integer, binary_integer, octal_integer
- * and hex_integer have been integrated directly into
- * the constants construct, instead of belonging to
- * both the bit_string_literal or integer_literal
- * construct.
- */
+ *  where any real or integer constant is always preceded by 
+ *  a sign (i.e. the '-' or '+' characters).
+ *  (For more info, see comment in the construct non_int_or_real_primary_expression)
+ *
+ * For the above reason, our definition of the numeric_literal construct
+ * is missing the integer and real constrcuts (when not preceded by a sign)
+ * so we add then here explicitly!
+ */
+| real
+| integer
 /* NOTE: unsigned_integer, although used in some
  * rules, is not defined in the spec!
  * We therefore replaced unsigned_integer as integer
  */
-/*| integer {} */  /* i.e. an unsigned_integer */ /* NOTE: already included as a signed integer! */
-| signed_integer
-| binary_integer
-| octal_integer
-| hex_integer
-;
-
-
+;
+
+
+
+
+non_int_or_real_constant:
+  character_string
+| time_literal
+| bit_string_literal
+| boolean_literal
+| numeric_literal  
+/* NOTE: Our definition of numeric_literal is diferent than the one in the standard.
+ *       It is missing the integer and real when not prefixed by a sign 
+ *       (i.e. -54, +42 is included in numerical_literal,
+ *        but   54,  42 is not parsed as a numeric_literal!!)
+ */
 /* NOTE: in order to remove reduce/reduce conflicts,
  * [between -9.5 being parsed as 
  *     (i)   a signed real, 
  *     (ii)  or as a real preceded by the '-' operator
  *  ]
+ * [and a similar situation for integers!]
  *  we need to define a variant of the constant construct
- *  where any constant is never preceded by the '-' character.
- * In order to do this, we have borugh the signed_real 
- * directly into the definition of the constant construct
- * (so we can define another non_negative_constant
- * construct that does not include it!)
- */
-non_negative_constant:
-  numeric_literal
-| character_string
-| time_literal
-| bit_string_literal
-| boolean_literal
-/* NOTE: in order to remove reduce/reduce conflicts,
- * [between -9.5 being parsed as 
- *     (i)   a signed real, 
- *     (ii)  or as a real preceded by the '-' operator
- *  ]
- *  we need to define a variant of the constant construct
- *  where any constant is never preceded by the '-' character.
- * In order to do this, we have borugh the signed_real 
- * directly into the definition of the constant construct
- * (so we can define another non_negative_constant
- * construct that does not include it!)
- */
-/* | signed_real */
-| real /* an unsigned real */
-/* NOTE: in order to remove reduce/reduce conflicts,
- * unsigned_integer, signed_integer, binary_integer, octal_integer
- * and hex_integer have been integrated directly into
- * the constants construct, instead of belonging to
- * both the bit_string_literal or integer_literal
- * construct.
- */
-/* NOTE: unsigned_integer, although used in some
- * rules, is not defined in the spec!
- * We therefore replaced unsigned_integer as integer
- */
-| integer  /* i.e. an unsigned_integer */
-/* | signed_integer */
-| binary_integer
-| octal_integer
-| hex_integer
+ *  where any real or integer constant is always preceded by 
+ *  a sign (i.e. the '-' or '+' characters).
+ *
+ * For the above reason, our definition of the numeric_literal construct
+ * is missing the integer and real constrcuts (when not preceded by a sign)
+ */
 ;
 
 
@@ -1916,10 +1894,13 @@
 	{$$ = new integer_literal_c($1, $3, locloc(@$));}
 | integer_type_name '#' hex_integer
 	{$$ = new integer_literal_c($1, $3, locloc(@$));}
-/* NOTE: see note in the definition of constant for reason
- * why signed_integer, binary_integer, octal_integer
- * and hex_integer are missing here!
- */
+| binary_integer
+| octal_integer
+| hex_integer
+//|signed_integer  /* We expand the construct signed_integer here, so we can remove one of its constituents */
+//|  integer       /* REMOVED! see note in the definition of constant for reason why integer is missing here! */
+| '+' integer   {$$ = $2;}
+| '-' integer	{$$ = new neg_integer_c($2, locloc(@$));}
 /* ERROR_CHECK_BEGIN */
 | integer_type_name signed_integer
 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;}
@@ -1938,6 +1919,13 @@
 /* ERROR_CHECK_END */
 ;
 
+/* NOTE: this construct is used in the definition of integer_literal. However, in order to remove
+ *       a reduce/reduce conflict (see NOTE in definition of constant for reason why)
+ *       it is not used directly, but rather its expansion is copied there.
+ *
+ *       If for some reason you need to change the definition of signed_integer, don't forget
+ *       to change its expansion in integer_literal too!
+*/
 signed_integer:
   integer
 | '+' integer   {$$ = $2;}
@@ -1946,11 +1934,11 @@
 
 
 real_literal:
-/* NOTE: see note in the definition of constant for reason
- * why signed_real is missing here!
- */
-/*  signed_real */
-  real_type_name '#' signed_real
+// signed_real /* We expand the construct signed_integer here, so we can remove one of its constituents */
+// real        /* REMOVED! see note in the definition of constant for reason why real is missing here! */
+  '+' real	{$$ = $2;}
+| '-' real	{$$ = new neg_real_c($2, locloc(@2));}
+| real_type_name '#' signed_real
 	{$$ = new real_literal_c($1, $3, locloc(@$));}
 /* ERROR_CHECK_BEGIN */
 | real_type_name signed_real
@@ -1964,7 +1952,13 @@
 /* ERROR_CHECK_END */
 ;
 
-
+/* NOTE: this construct is used in the definition of real_literal. However, in order to remove
+ *       a reduce/reduce conflict (see NOTE in definition of constant for reason why)
+ *       it is not used directly, but rather its expansion is copied there.
+ *
+ *       If for some reason you need to change the definition of signed_real, don't forget
+ *       to change its expansion in real_literal too!
+*/
 signed_real:
   real
 | '+' real	{$$ = $2;}
@@ -1972,7 +1966,6 @@
 ;
 
 
-
 bit_string_literal:
   bit_string_type_name '#' integer  /* i.e. unsigned_integer */
 	{$$ = new bit_string_literal_c($1, $3, locloc(@$));}
@@ -2513,7 +2506,7 @@
 
 data_type_declaration:
   TYPE type_declaration_list END_TYPE
-	{$$ = new data_type_declaration_c($2, locloc(@$));}
+	{$$ = new data_type_declaration_c($2, locloc(@$)); if (conversion_functions_) include_string((create_enumtype_conversion_functions_c::get_declaration($$)).c_str());}
 /* ERROR_CHECK_BEGIN */
 | TYPE END_TYPE
 	{$$ = NULL; print_err_msg(locl(@1), locf(@2), "no data type declared in data type(s) declaration."); yynerrs++;}
@@ -2561,10 +2554,13 @@
 
 simple_type_declaration:
 /*  simple_type_name ':' simple_spec_init */
-  identifier ':' simple_spec_init
-	{$$ = new simple_type_declaration_c($1, $3, locloc(@$));
-	 library_element_symtable.insert($1, prev_declared_simple_type_name_token);
-	}
+/* To understand why simple_spec_init was brocken up into its consituent components in the following rules, please see note in the definition of 'enumerated_type_declaration'. */
+  identifier ':' simple_specification           {library_element_symtable.insert($1, prev_declared_simple_type_name_token);}
+	{$$ = new simple_type_declaration_c($1, $3, locloc(@$));}
+| identifier ':' elementary_type_name           {library_element_symtable.insert($1, prev_declared_simple_type_name_token);} ASSIGN constant
+	{$$ = new simple_type_declaration_c($1, new simple_spec_init_c($3, $6, locf(@3), locl(@6)), locloc(@$));}
+| identifier ':' prev_declared_simple_type_name {library_element_symtable.insert($1, prev_declared_simple_type_name_token);} ASSIGN constant
+	{$$ = new simple_type_declaration_c($1, new simple_spec_init_c($3, $6, locf(@3), locl(@6)), locloc(@$));}
 /* ERROR_CHECK_BEGIN */
 | error ':' simple_spec_init
 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for data type declaration.");yyerrok;}
@@ -2699,10 +2695,23 @@
 
 enumerated_type_declaration:
 /*  enumerated_type_name ':' enumerated_spec_init */
-  identifier ':' enumerated_spec_init
-	{$$ = new enumerated_type_declaration_c($1, $3, locloc(@$));
-	 library_element_symtable.insert($1, prev_declared_enumerated_type_name_token);
-	}
+/* NOTE: The 'identifier' used for the name of the new enumerated type is inserted early into the library_element_symtable so it may be used
+ *       in defining the default initial value of this type, using the fully qualified enumerated constant syntax: type_name#enum_value
+ *       In other words, this allows us to correclty parse the following IEC 61131-3 code:
+ *           TYPE enum_t : (x1, x2, x3) := enum_t#x3; END_TYPE
+ *                                         ^^^^^^^
+ *
+ *       However, we can only introduce it after we are sure we are parsing an enumerated_spec. For this reason, instead of using the
+ *       symbol enumerated_spec_init in this rule, we decompose it here instead!
+ *       
+ *       If it were not for the above, we could use the rule
+ *           identifier ':' enumerated_spec_init
+ *       and include the library_element_symtable.insert(...) code in the rule actions!
+ */
+  identifier ':' enumerated_specification {library_element_symtable.insert($1, prev_declared_enumerated_type_name_token);}
+	{$$ = new enumerated_type_declaration_c($1, new enumerated_spec_init_c($3, NULL, locloc(@3)), locloc(@$));}
+| identifier ':' enumerated_specification {library_element_symtable.insert($1, prev_declared_enumerated_type_name_token);} ASSIGN enumerated_value
+	{$$ = new enumerated_type_declaration_c($1, new enumerated_spec_init_c($3, $6, locf(@3), locl(@6)), locloc(@$));}
 /* ERROR_CHECK_BEGIN */
 | error ':' enumerated_spec_init
 	{$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for enumerated type declaration."); yyerrok;}
@@ -6378,6 +6387,26 @@
 
 il_expression:
 // il_expr_operator '(' [il_operand] EOL {EOL} [simple_instr_list] ')'
+/* IMPORTANT NOTE:
+ *  When the <il_operand> exists, and to make it easier to handle the <il_operand> as a general case (i.e. without C++ code handling this as a special case), 
+ *  we will create an equivalent LD <il_operand> IL instruction, and prepend it into the <simple_instr_list>. 
+ *  The remainder of the compiler may from now on assume that the code being compiled does not contain any IL code like
+ *     LD 1
+ *     ADD ( 2
+ *        SUB 3
+ *        )
+ *
+ * but instead, the equivalent code
+ *     LD 1
+ *     ADD ( 
+ *        LD  2
+ *        SUB 3
+ *        )
+ *
+ * Note, however, that in the first case, we still store in the il_expression_c a pointer to the <il_operand> (the literal '2' in the above example), in case
+ * somewhere further on in the compiler we really want to handle it as a special case. To handle it as a special case, it should be easy to simply delete the first
+ * artificial entry in <simple_instr_list> with il_expression->simple_instr_list->remove_element(0)  !!
+ */
 /*
  * Note: Bison is getting confused with the use of il_expr_operator,
  *       i.e. it is finding conflicts where there seemingly are really none.
@@ -6387,17 +6416,29 @@
   il_expr_operator_noclash '(' eol_list ')'
 	{$$ = new il_expression_c($1, NULL, NULL, locloc(@$));}
 | il_expr_operator_noclash '(' il_operand eol_list ')'
-	{$$ = new il_expression_c($1, $3, NULL, locloc(@$));}
+	{ simple_instr_list_c *tmp_simple_instr_list = new simple_instr_list_c(locloc(@3));
+	  tmp_simple_instr_list ->insert_element(new il_simple_instruction_c(new il_simple_operation_c(new LD_operator_c(locloc(@3)), $3, locloc(@3)), locloc(@3)), 0);
+	  $$ = new il_expression_c($1, $3, tmp_simple_instr_list, locloc(@$));
+	}
 | il_expr_operator_noclash '(' eol_list simple_instr_list ')'
 	{$$ = new il_expression_c($1, NULL, $4, locloc(@$));}
 | il_expr_operator_noclash '(' il_operand eol_list simple_instr_list ')'
-	{$$ = new il_expression_c($1, $3, $5, locloc(@$));}
+	{ simple_instr_list_c *tmp_simple_instr_list = dynamic_cast <simple_instr_list_c *> $5;
+	  tmp_simple_instr_list ->insert_element(new il_simple_instruction_c(new il_simple_operation_c(new LD_operator_c(locloc(@3)), $3, locloc(@3)), locloc(@3)), 0);
+	  $$ = new il_expression_c($1, $3, $5, locloc(@$));
+	}
 | il_expr_operator_clash '(' eol_list ')'
 	{$$ = new il_expression_c($1, NULL, NULL, locloc(@$));}
 | il_expr_operator_clash '(' il_operand eol_list ')'
-	{$$ = new il_expression_c($1, $3, NULL, locloc(@$));}
+	{ simple_instr_list_c *tmp_simple_instr_list = new simple_instr_list_c(locloc(@3));
+	  tmp_simple_instr_list ->insert_element(new il_simple_instruction_c(new il_simple_operation_c(new LD_operator_c(locloc(@3)), $3, locloc(@3)), locloc(@3)), 0);
+	  $$ = new il_expression_c($1, $3, tmp_simple_instr_list, locloc(@$));
+	}
 | il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')'
-	{$$ = new il_expression_c($1, $3, $5, locloc(@$));}
+	{ simple_instr_list_c *tmp_simple_instr_list = dynamic_cast <simple_instr_list_c *> $5;
+	  tmp_simple_instr_list ->insert_element(new il_simple_instruction_c(new il_simple_operation_c(new LD_operator_c(locloc(@3)), $3, locloc(@3)), locloc(@3)), 0);
+	  $$ = new il_expression_c($1, $3, $5, locloc(@$));
+	}
 | il_expr_operator_clash_eol_list simple_instr_list ')'
 	{$$ = new il_expression_c($1, NULL, $2, locloc(@$));}
 /* ERROR_CHECK_BEGIN */
@@ -7201,8 +7242,8 @@
 
 
 unary_expression:
-  non_negative_primary_expression
-| '-' non_negative_primary_expression
+  primary_expression
+| '-' non_int_or_real_primary_expression
 	{$$ = new neg_expression_c($2, locloc(@$));}
 | NOT primary_expression
 	{$$ = new not_expression_c($2, locloc(@$));}
@@ -7238,8 +7279,34 @@
  *       (i.e. the constant 9, preceded by a unary negation)
  *
  *       To remove the conflict, we only allow constants without
- *       a preceding '-' to be used in primary_expression
+ *       integer or reals that are not preceded by a sign 
+ *       (i.e. a '-' or '+' character) to be used in primary_expression
  *       (i.e. as a parameter to the unary negation operator)
+ *
+ *       e.g.  '-42', '+54', '42', '54' are all allowed in primary expression
+ *       according to the standard. However, we will allow only '-42' and '+54'
+ *       to be used as an argument to the negation operator ('-').
+ */
+/* NOTE: Notice that the standard considers the following syntax correct:
+ *         VAR intv: INT; END_VAR
+ *         intv :=      42;         <----- OK
+ *         intv :=     -42;         <----- OK
+ *         intv :=     +42;         <----- OK
+ *         intv :=    --42;         <----- OK!!
+ *         intv :=    -+42;         <----- OK!!
+ *         intv :=  -(--42);        <----- OK!!
+ *         intv :=  -(-+42);        <----- OK!!
+ *         intv :=-(-(--42));       <----- OK!!
+ *         intv :=-(-(-+42));       <----- OK!!
+ *     but does NOT allow the following syntax:
+ *         VAR intv: INT; END_VAR
+ *         intv :=   ---42;       <----- ERROR!!
+ *         intv :=   --+42;       <----- ERROR!!
+ *         intv :=  ----42;       <----- ERROR!!
+ *         intv :=  ---+42;       <----- ERROR!!
+ *
+ *    Although strange, we follow the standard to the letter, and do exactly
+ *    as stated above!!
  */
 /* NOTE: We use enumerated_value_without_identifier instead of enumerated_value
  *       in order to remove a reduce/reduce conflict between reducing an
@@ -7251,8 +7318,8 @@
  *       for a variable and an enumerated value, then the variable shall be
  *       considered.
  */
-non_negative_primary_expression:
-  non_negative_constant
+non_int_or_real_primary_expression:
+  non_int_or_real_constant
 //| enumerated_value_without_identifier
 | enumerated_value
 | variable
@@ -7904,11 +7971,6 @@
 #include <errno.h>
 #include "../util/symtable.hh"
 
-/* variables defined in code generated by flex... */
-extern FILE *yyin;
-extern int yylineno;
-extern tracking_t* current_tracking;
-
 
 
 
@@ -8035,7 +8097,6 @@
   }
   //fprintf(stderr, "error %d: %s\n", yynerrs /* a global variable */, additional_error_msg);
   print_include_stack();
-  //fprintf(stderr, "%s(%d-%d): %s\n", current_filename, first_line, last_line, current_error_msg);
 }
 
 
@@ -8186,36 +8247,11 @@
              bool full_token_loc_        /* error messages specify full token location */
             ) {
 
-  FILE *in_file = NULL, *lib_file = NULL;
   char *libfilename = NULL;
-	
-  if((in_file = fopen(filename, "r")) == NULL) {
-    char *errmsg = strdup2("Error opening main file ", filename);
-    perror(errmsg);
-    free(errmsg);
-    return -1;
-  }
 
   if (includedir != NULL) {
     INCLUDE_DIRECTORIES[0] = includedir;
   }
-  if ((libfilename = strdup3(INCLUDE_DIRECTORIES[0], "/", LIBFILE)) == NULL) {
-    fprintf (stderr, "Out of memory. Bailing out!\n");
-    return -1;
-  }
-
-  if((lib_file = fopen(libfilename, "r")) == NULL) {
-    char *errmsg = strdup2("Error opening library file ", libfilename);
-    perror(errmsg);
-    free(errmsg);
-  }
-
-  if (lib_file == NULL) {
-    /* we give up... */
-    free(libfilename);
-    fclose(in_file);
-    return -1;
-  }
 
   /* first parse the standard library file... */
   /* Do not debug the standard library, even if debug flag is set! */
@@ -8224,21 +8260,33 @@
     yydebug = 1;
   #endif
   */
-  yyin = lib_file;
+
+  if ((libfilename = strdup3(INCLUDE_DIRECTORIES[0], "/", LIBFILE)) == NULL) {
+    fprintf (stderr, "Out of memory. Bailing out!\n");
+    return -1;
+  }
+  
+  FILE *libfile = NULL;
+  if((libfile = parse_file(libfilename)) == NULL) {
+    char *errmsg = strdup2("Error opening library file ", libfilename);
+    perror(errmsg);
+    free(errmsg);
+    /* we give up... */
+    return -1;
+  }
+
   allow_function_overloading = true;
   allow_extensible_function_parameters = true;
   full_token_loc = full_token_loc_;
-  current_filename = libfilename;
-  current_tracking = GetNewTracking(yyin);
   if (yyparse() != 0)
       ERROR;
-
+  fclose(libfile);
+      
   if (yynerrs > 0) {
     fprintf (stderr, "\n%d error(s) found in %s. Bailing out!\n", yynerrs /* global variable */, libfilename);
     ERROR;
   }
   free(libfilename);
-  fclose(lib_file);
 
   /* if by any chance the library is not complete, we
    * now add the missing reserved keywords to the list!!!
@@ -8253,19 +8301,24 @@
   #if YYDEBUG
     yydebug = 1;
   #endif
-  yyin = in_file;
+  FILE *mainfile = NULL;
+  if ((mainfile = parse_file(filename)) == NULL) {
+    char *errmsg = strdup2("Error opening main file ", filename);
+    perror(errmsg);
+    free(errmsg);
+    return -1;
+  }
+
   allow_function_overloading = false;
   allow_extensible_function_parameters = false;
   full_token_loc = full_token_loc_;
-  current_filename = filename;
-  current_tracking = GetNewTracking(yyin);
-  {int res;
-    if ((res = yyparse()) != 0) {
-      fprintf (stderr, "\nParsing failed because of too many consecutive syntax errors. Bailing out!\n");
-  		exit(EXIT_FAILURE);
-  	}
+
+  if (yyparse() != 0) {
+    fprintf (stderr, "\nParsing failed because of too many consecutive syntax errors. Bailing out!\n");
+    exit(EXIT_FAILURE);
   }
-
+  fclose(mainfile);
+  
   if (yynerrs > 0) {
     fprintf (stderr, "\n%d error(s) found. Bailing out!\n", yynerrs /* global variable */);
     exit(EXIT_FAILURE);
@@ -8274,9 +8327,19 @@
   if (tree_root_ref != NULL)
     *tree_root_ref = tree_root;
 
-  fclose(in_file);
   return 0;
 }
 
 
 
+
+
+
+
+
+
+
+
+
+
+
--- a/stage1_2/iec_flex.ll	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage1_2/iec_flex.ll	Fri Mar 08 01:01:15 2013 +0100
@@ -144,15 +144,11 @@
 extern YYSTYPE yylval;
 
 /* The name of the file currently being parsed...
- * This variable is declared and read from the code generated by bison!
  * Note that flex accesses and updates this global variable
- * apropriately whenever it comes across an (*#include <filename> *)
- * directive...
- */
-/*
- NOTE: already defined in iec_bison.h 
-extern const char *current_filename;
-*/
+ * apropriately whenever it comes across an (*#include <filename> *) directive...
+ */
+const char *current_filename = NULL;
+
 
 
 /* We will not be using unput() in our flex code... */
@@ -247,6 +243,10 @@
  * but first return to the stream an additional character to mark the end of the token. 
  */
 void unput_and_mark(const char c);
+
+void include_file(const char *include_filename);
+
+int GetNextChar(char *b, int maxBuffer);
 %}
 
 
@@ -416,7 +416,7 @@
 /* we are parsing a function, program or function block declaration */
 %s decl_state
 
-/* we will be parsing a function body. Whether il/st is remains unknown */
+/* we will be parsing a function body. Whether il/st/sfc remains to be determined */
 %x body_state
 
 /* we are parsing il code -> flex must return the EOL tokens!       */
@@ -464,12 +464,22 @@
 #define MAX_INCLUDE_DEPTH 16
 
 typedef struct {
+    int eof;
+    int lineNumber;
+    int currentChar;
+    int lineLength;
+    int currentTokenStart;
+    char *buffer;
+    FILE *in_file;
+  } tracking_t;
+
+typedef struct {
 	  YY_BUFFER_STATE buffer_state;
-	  tracking_t* env;
+	  tracking_t *env;
 	  const char *filename;
 	} include_stack_t;
 
-tracking_t* current_tracking;
+tracking_t *current_tracking = NULL;
 include_stack_t include_stack[MAX_INCLUDE_DEPTH];
 int include_stack_ptr = 0;
 
@@ -481,7 +491,6 @@
 	"/usr/lib/iec",
 	NULL /* must end with NULL!! */
 	};
-
 %}
 
 
@@ -728,9 +737,9 @@
  */
 
 interval_ms_X		({integer_0_999}(\.{integer})?)ms
-interval_s_X		{integer_0_59}s(_?{interval_ms_X})?
-interval_m_X		{integer_0_59}m(_?{interval_s_X})?
-interval_h_X		{integer_0_23}h(_?{interval_m_X})?
+interval_s_X		{integer_0_59}s(_?{interval_ms_X})?|({integer_0_59}(\.{integer})?s)
+interval_m_X		{integer_0_59}m(_?{interval_s_X})?|({integer_0_59}(\.{integer})?m)
+interval_h_X		{integer_0_23}h(_?{interval_m_X})?|({integer_0_23}(\.{integer})?h)
 
 interval_ms		{integer}ms|({fixed_point}ms)
 interval_s		{integer}s(_?{interval_ms_X})?|({fixed_point}s)
@@ -740,6 +749,7 @@
 
 interval		{interval_ms}|{interval_s}|{interval_m}|{interval_h}|{interval_d}
 
+
 /* to help provide nice error messages, we also parse an incorrect but plausible interval... */
 /* NOTE that this erroneous interval will be parsed outside the time_literal_state, so must not 
  *      be able to parse any other legal lexcial construct (besides a legal interval, but that
@@ -868,54 +878,36 @@
 <include_beg>{file_include_pragma_beg}	BEGIN(include_filename);
 
 <include_filename>{file_include_pragma_filename}	{
-			  /* got the include file name */
-			  int i;
-
-			  if (include_stack_ptr >= MAX_INCLUDE_DEPTH) {
-			    fprintf(stderr, "Includes nested too deeply\n");
-			    exit( 1 );
-			  }
-			  include_stack[include_stack_ptr].buffer_state = YY_CURRENT_BUFFER;
-			  include_stack[include_stack_ptr].env = current_tracking;
-			  include_stack[include_stack_ptr].filename = current_filename;
-			  
-			  for (i = 0, yyin = NULL; (INCLUDE_DIRECTORIES[i] != NULL) && (yyin == NULL); i++) {
-			    char *full_name = strdup3(INCLUDE_DIRECTORIES[i], "/", yytext);
-			    if (full_name == NULL) {
-			      fprintf(stderr, "Out of memory!\n");
-			      exit( 1 );
-			    }
-			    yyin = fopen(full_name, "r");
-			    free(full_name);
-			  }
-
-			  if (!yyin) {
-			    fprintf(stderr, "Error opening included file %s\n", yytext);
-			    exit( 1 );
-			  }
-
-			  current_filename = strdup(yytext);
-			  current_tracking = GetNewTracking(yyin);
-			  include_stack_ptr++;
-
-			  /* switch input buffer to new file... */
-			  yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+			  /* set the internal state variables of lexical analyser to process a new include file */
+			  include_file(yytext);
 			  /* switch to whatever state was active before the include file */
 			  yy_pop_state();
 			  /* now process the new file... */
 			}
 
 
-<<EOF>>			{     /* NOTE: We must not change the value of include_stack_ptr
-			       *       just yet. We must only decrement it if we are NOT
-			       *       at the end of the main file.
-			       *       If we have finished parsing the main file, then we
-			       *       must leave include_stack_ptr at 0, in case the 
-			       *       parser is called once again with a new file.
-			       *       (In fact, we currently do just that!)
+<<EOF>>			{     /* NOTE: Currently bison is incorrectly using END_OF_INPUT in many rules
+			       *       when checking for syntax errors in the input source code.
+			       *       This means that in reality flex will be asked to carry on reading the input
+			       *       even after it has reached the end of all (including the main) input files.
+			       *       In other owrds, we will be called to return more tokens, even after we have
+			       *       already returned an END_OF_INPUT token. In this case, we must carry on returning
+			       *       more END_OF_INPUT tokens.
+			       * 
+			       *       However, in the above case we will be asked to carry on reading more tokens 
+			       *       from the main input file, after we have reached the end. For this to work
+			       *       correctly, we cannot close the main input file!
+			       * 
+			       *       This is why we WILL be called with include_stack_ptr == 0 multiple times,
+			       *       and why we must handle it as a special case
+			       *       that leaves the include_stack_ptr unchanged, and returns END_OF_INPUT once again.
+			       * 
+			       *       As a corollory, flex can never safely close the main input file, and we must ask
+			       *       bison to close it!
 			       */
-			  free(current_tracking);
 			  if (include_stack_ptr == 0) {
+			      // fclose(yyin);           // Must not do this!!
+			      // free(current_tracking); // Must not do this!!
 			      /* yyterminate() terminates the scanner and returns a 0 to the 
 			       * scanner's  caller, indicating "all done".
 			       *	
@@ -925,8 +917,9 @@
 			       * calling yyterminate() is equivalent to doing that. 
 			       */ 	
 			    yyterminate();
-			  }      
- else {
+			  } else {
+			    fclose(yyin);
+			    free(current_tracking);
 			    --include_stack_ptr;
 			    yy_delete_buffer(YY_CURRENT_BUFFER);
 			    yy_switch_to_buffer((include_stack[include_stack_ptr]).buffer_state);
@@ -949,6 +942,8 @@
 			}
 
 <include_end>{file_include_pragma_end}	yy_pop_state();
+	/* handle the artificial file includes created by include_string(), which do not end with a '}' */
+<include_end>.				unput_text(0); yy_pop_state(); 
 
 
 	/*********************************/
@@ -1012,20 +1007,20 @@
 	/* body_state -> (il_state | st_state) */
 <body_state>{
 {st_whitespace_no_pragma}			/* Eat any whitespace */
-{qualified_identifier}{st_whitespace}":="	  unput_text(0); BEGIN(st_state);
-{direct_variable_standard}{st_whitespace}":="	  unput_text(0); BEGIN(st_state);
+{qualified_identifier}{st_whitespace}":="	unput_text(0); BEGIN(st_state);
+{direct_variable_standard}{st_whitespace}":="	unput_text(0); BEGIN(st_state);
 {qualified_identifier}"["			unput_text(0); BEGIN(st_state);
 
-RETURN					unput_text(0); BEGIN(st_state);
-IF							unput_text(0); BEGIN(st_state);
+RETURN						unput_text(0); BEGIN(st_state);
+IF						unput_text(0); BEGIN(st_state);
 CASE						unput_text(0); BEGIN(st_state);
-FOR							unput_text(0); BEGIN(st_state);
+FOR						unput_text(0); BEGIN(st_state);
 WHILE						unput_text(0); BEGIN(st_state);
-REPEAT					unput_text(0); BEGIN(st_state);
+REPEAT						unput_text(0); BEGIN(st_state);
 EXIT						unput_text(0); BEGIN(st_state);
 
 	/* ':=' occurs only in transitions, and not Function or FB bodies! */
-:=							unput_text(0); BEGIN(st_state);
+:=						unput_text(0); BEGIN(st_state);
 
 	/* Hopefully, the above rules (along with the last one),
          * used to distinguish ST from IL, are 
@@ -1677,6 +1672,60 @@
 %%
 
 
+/*************************/
+/* Tracking Functions... */
+/*************************/
+
+#define MAX_BUFFER_LENGTH 1000
+
+tracking_t *GetNewTracking(FILE* in_file) {
+  tracking_t* new_env = new tracking_t;
+  new_env->eof = 0;
+  new_env->lineNumber = 0;
+  new_env->currentChar = 0;
+  new_env->lineLength = 0;
+  new_env->currentTokenStart = 0;
+  new_env->buffer = (char*)malloc(MAX_BUFFER_LENGTH);
+  new_env->in_file = in_file;
+  return new_env;
+}
+
+
+/* GetNextChar: reads a character from input */
+int GetNextChar(char *b, int maxBuffer) {
+  char *p;
+  
+  if (  current_tracking->eof  )
+    return 0;
+  
+  while (  current_tracking->currentChar >= current_tracking->lineLength  ) {
+    current_tracking->currentChar = 0;
+    current_tracking->currentTokenStart = 1;
+    current_tracking->eof = false;
+    
+    p = fgets(current_tracking->buffer, MAX_BUFFER_LENGTH, current_tracking->in_file);
+    if (  p == NULL  ) {
+      if (  ferror(current_tracking->in_file)  )
+        return 0;
+      current_tracking->eof = true;
+      return 0;
+    }
+    
+    current_tracking->lineNumber++;
+    current_tracking->lineLength = strlen(current_tracking->buffer);
+  }
+  
+  b[0] = current_tracking->buffer[current_tracking->currentChar];
+  if (b[0] == ' ' || b[0] == '\t')
+    current_tracking->currentTokenStart++;
+  current_tracking->currentChar++;
+
+  return b[0]==0?0:1;
+}
+
+
+
+
 /***********************************/
 /* Utility function definitions... */
 /***********************************/
@@ -1692,6 +1741,79 @@
 }
 
 
+
+/* set the internal state variables of lexical analyser to process a new include file */
+void handle_include_file_(FILE *filehandle, const char *filename) {
+  if (include_stack_ptr >= MAX_INCLUDE_DEPTH) {
+    fprintf(stderr, "Includes nested too deeply\n");
+    exit( 1 );
+  }
+  
+  yyin = filehandle;
+  
+  include_stack[include_stack_ptr].buffer_state = YY_CURRENT_BUFFER;
+  include_stack[include_stack_ptr].env = current_tracking;
+  include_stack[include_stack_ptr].filename = current_filename;
+  
+  current_filename = strdup(filename);
+  current_tracking = GetNewTracking(yyin);
+  include_stack_ptr++;
+
+  /* switch input buffer to new file... */
+  yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+}
+
+
+
+/* insert the code (in <source_code>) into the source code we are parsing.
+ * This is done by creating an artificial file with that new source code, and then 'including' the file
+ */
+void include_string_(const char *source_code) {
+  FILE *tmp_file = tmpfile();
+  
+  if(tmp_file == NULL) {
+    perror("Error creating temp file.");
+    exit(EXIT_FAILURE);
+  }
+
+  fwrite((void *)source_code, 1, strlen(source_code), tmp_file);
+  rewind(tmp_file);
+
+  /* now parse the tmp file, by asking flex to handle it as if it had been included with the (*#include ... *) pragma... */
+  handle_include_file_(tmp_file, "");
+//fclose(tmp_file);  /* do NOT close file. It must only be closed when we finish reading from it! */
+}
+
+
+
+/* Open an include file, and set the internal state variables of lexical analyser to process a new include file */
+void include_file(const char *filename) {
+  FILE *filehandle = NULL;
+  
+  for (int i = 0; (INCLUDE_DIRECTORIES[i] != NULL) && (filehandle == NULL); i++) {
+    char *full_name;
+    full_name = strdup3(INCLUDE_DIRECTORIES[i], "/", filename);
+    if (full_name == NULL) {
+      fprintf(stderr, "Out of memory!\n");
+      exit( 1 );
+    }
+    filehandle = fopen(full_name, "r");
+    free(full_name);
+  }
+
+  if (NULL == filehandle) {
+    fprintf(stderr, "Error opening included file %s\n", filename);
+    exit( 1 );
+  }
+
+  /* now process the new file... */
+  handle_include_file_(filehandle, filename);
+}
+
+
+
+
+
 /* return all the text in the current token back to the input stream, except the first n chars. */
 void unput_text(unsigned int n) {
   /* it seems that flex has a bug in that it will not correctly count the line numbers
@@ -1736,17 +1858,46 @@
    *   return 0;
    */
 
-  /* to we stop processing...
-   *
+  /* to stop processing...
    *   return 1;
    */
 
-
   return 1;  /* Stop scanning at end of input file. */
 }
 
 
 
+/*******************************/
+/* Public Interface for Bison. */
+/*******************************/
+
+/* The following functions will be called from inside bison code! */
+
+void include_string(const char *source_code) {include_string_(source_code);}
+
+
+/* Tell flex which file to parse. This function will not imediately start parsing the file.
+ * To parse the file, you then need to call yyparse()
+ *
+ * Returns NULL on error opening the file (and a valid errno), or 0 on success.
+ * Caller must close the file!
+ */
+FILE *parse_file(const char *filename) {
+  FILE *filehandle = NULL;
+
+  if((filehandle = fopen(filename, "r")) != NULL) {
+    yyin = filehandle;
+    current_filename = strdup(filename);
+    current_tracking = GetNewTracking(yyin);
+  }
+  return filehandle;
+}
+
+
+
+
+
+
 /*************************************/
 /* Include a main() function to test */
 /* the token parsing by flex....     */
@@ -1758,7 +1909,6 @@
 yystype yylval;
 YYLTYPE yylloc;
 
-const char *current_filename;
 
 
 
--- a/stage1_2/stage1_2.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage1_2/stage1_2.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -46,35 +46,30 @@
 #include "stage1_2.hh"
 #include "iec_bison.h"
 #include "stage1_2_priv.hh"
-
-
-
-
-
-/**************************************/
-/* The name of the file being parsed. */
-/**************************************/
-/* The name of the file currently being parsed...
- * Note that flex accesses and updates this global variable
- * apropriately whenever it comes across an (*#include <filename> *)
- * directive...
- * ... and bison will use it when producing error messages.
- * Note that bison also sets this variable correctly to the first
- * file being parsed.
- */
-const char *current_filename = NULL;
-
-
-/******************************************************/
-/* whether we are suporting safe extensions           */
+#include "create_enumtype_conversion_functions.hh"
+
+
+
+
+
+
+/******************************************************/
+/* whether we are supporting safe extensions          */
 /* as defined in PLCopen - Technical Committee 5      */
 /* Safety Software Technical Specification,           */
 /* Part 1: Concepts and Function Blocks,              */
-/* Version 1.0 – Official Release                     */
+/* Version 1.0 – Official Release                   */
 /******************************************************/
 bool safe_extensions_ = false;
 bool get_opt_safe_extensions() {return safe_extensions_;}
 
+/******************************************************/
+/* whether we are supporting conversion functions     */
+/* for enumerate data types                           */
+/******************************************************/
+bool conversion_functions_ = false;
+
+
 /****************************************************/
 /* Controlling the entry to the body_state in flex. */
 /****************************************************/
@@ -213,59 +208,7 @@
   return strcat(strcat(strcpy(res, a), b), c);  /* safe, actually */
 }
 
-/*************************/
-/* Tracking Functions... */
-/*************************/
-
-extern tracking_t* current_tracking;
-
-/*--------------------------------------------------------------------
- * GetNextChar
- * 
- * reads a character from input for flex
- *------------------------------------------------------------------*/
-int GetNextChar(char *b, int maxBuffer) {
-  char *p;
-  
-  if (  current_tracking->eof  )
-    return 0;
-  
-  while (  current_tracking->currentChar >= current_tracking->lineLength  ) {
-    current_tracking->currentChar = 0;
-    current_tracking->currentTokenStart = 1;
-    current_tracking->eof = false;
-    
-    p = fgets(current_tracking->buffer, MAX_BUFFER_LENGTH, current_tracking->in_file);
-    if (  p == NULL  ) {
-      if (  ferror(current_tracking->in_file)  )
-        return 0;
-      current_tracking->eof = true;
-      return 0;
-    }
-    
-    current_tracking->lineNumber++;
-    current_tracking->lineLength = strlen(current_tracking->buffer);
-  }
-  
-  b[0] = current_tracking->buffer[current_tracking->currentChar];
-  if (b[0] == ' ' || b[0] == '\t')
-    current_tracking->currentTokenStart++;
-  current_tracking->currentChar++;
-
-  return b[0]==0?0:1;
-}
-
-tracking_t* GetNewTracking(FILE* in_file) {
-  tracking_t* new_env = new tracking_t;
-  new_env->eof = 0;
-  new_env->lineNumber = 0;
-  new_env->currentChar = 0;
-  new_env->lineLength = 0;
-  new_env->currentTokenStart = 0;
-  new_env->buffer = (char*)malloc(MAX_BUFFER_LENGTH);
-  new_env->in_file = in_file;
-  return new_env;
-}
+
 
 /***********************************************************************/
 /***********************************************************************/
@@ -297,8 +240,9 @@
        *       These callback functions will get their data from local (to this file) global variables...
        *       We now set those variables...
        */
+
   safe_extensions_ = options.safe_extensions;
-  
+  conversion_functions_ = options.conversion_functions;
   return stage2__(filename, options.includedir, tree_root_ref, options.full_token_loc);
 }
 
--- a/stage1_2/stage1_2.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage1_2/stage1_2.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -60,6 +60,8 @@
 		/* error messages specify full token location */
 	bool full_token_loc; 
 		/* Include directory, where included files will be searched for... */
+	bool conversion_functions;
+		/* Create a conversion function for derived datatype */
 	const char *includedir;
 } stage1_2_options_t;
 
--- a/stage1_2/stage1_2_priv.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage1_2/stage1_2_priv.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -105,35 +105,33 @@
 /* This is a service that flex provides to bison... */
 void print_include_stack(void);
 
-
-/**************************************/
-/* The name of the file being parsed. */
-/**************************************/
-/* The name of the file currently being parsed...
- * Note that flex accesses and updates this global variable
- * apropriately whenever it comes across an (*#include <filename> *)
- * directive...
- * ... and bison will use it when producing error messages.
- * Note that bison also sets this variable correctly to the first
- * file being parsed.
- */
-extern const char *current_filename;
-
-
-#define MAX_BUFFER_LENGTH 1000
-
-typedef struct {
-    int eof;
-    int lineNumber;
-    int currentChar;
-    int lineLength;
-    int currentTokenStart;
-    char* buffer;
-    FILE *in_file;
-  } tracking_t;
-
-int GetNextChar(char *b, int maxBuffer);
-tracking_t* GetNewTracking(FILE* in_file);
+/*****************************************************/
+/* Ask flex to include the source code in the string */
+/*****************************************************/
+/* This is a service that flex provides to bison... */
+/* The string should contain valid IEC 61131-3 source code. Bison will ask flex to insert source 
+ * code into the input stream of IEC code being parsed. The code to be inserted is typically
+ * generated automatically.
+ * Currently this is used to insert conversion functions ***_TO_*** (as defined by the standard)
+ * between user defined (i.e. derived) enumerated datatypes, and some basic datatypes 
+ * (e.g. INT, STRING, etc...)
+ */
+void include_string(const char *source_code);
+
+
+/**********************************/
+/* Tell flex which file to parse. */
+/**********************************/
+/* This is a service that flex provides to bison... */
+/* Tell flex which file to parse. This function will not imediately start parsing the file.
+ * To parse the file, you then need to call yyparse()
+ *
+ * Returns NULL on error opening the file (and a valid errno), or 0 on success.
+ * Caller must close the file!
+ */
+FILE *parse_file(const char *filename);
+
+
 
 /****************************************************/
 /* Controlling the entry to the body_state in flex. */
--- a/stage3/Makefile.am	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/Makefile.am	Fri Mar 08 01:01:15 2013 +0100
@@ -7,9 +7,12 @@
 	flow_control_analysis.cc \
 	fill_candidate_datatypes.cc \
 	narrow_candidate_datatypes.cc \
+	forced_narrow_candidate_datatypes.cc \
 	print_datatypes_error.cc \
 	datatype_functions.cc \
 	lvalue_check.cc \
 	array_range_check.cc \
-        constant_folding.cc
+        constant_folding.cc \
+        declaration_check.cc \
+        enum_declaration_check.cc
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,525 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in TODO
+subdir = stage3
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libstage3_a_AR = $(AR) $(ARFLAGS)
+libstage3_a_LIBADD =
+am_libstage3_a_OBJECTS = stage3.$(OBJEXT) \
+	flow_control_analysis.$(OBJEXT) \
+	fill_candidate_datatypes.$(OBJEXT) \
+	narrow_candidate_datatypes.$(OBJEXT) \
+	forced_narrow_candidate_datatypes.$(OBJEXT) \
+	print_datatypes_error.$(OBJEXT) datatype_functions.$(OBJEXT) \
+	lvalue_check.$(OBJEXT) array_range_check.$(OBJEXT) \
+	constant_folding.$(OBJEXT) declaration_check.$(OBJEXT) \
+	enum_declaration_check.$(OBJEXT)
+libstage3_a_OBJECTS = $(am_libstage3_a_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(libstage3_a_SOURCES)
+DIST_SOURCES = $(libstage3_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+lib_LIBRARIES = libstage3.a
+libstage3_a_SOURCES = \
+	stage3.cc \
+	flow_control_analysis.cc \
+	fill_candidate_datatypes.cc \
+	narrow_candidate_datatypes.cc \
+	forced_narrow_candidate_datatypes.cc \
+	print_datatypes_error.cc \
+	datatype_functions.cc \
+	lvalue_check.cc \
+	array_range_check.cc \
+        constant_folding.cc \
+        declaration_check.cc \
+        enum_declaration_check.cc
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign stage3/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign stage3/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  if test -f $$p; then \
+	    $(am__strip_dir) \
+	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libstage3.a: $(libstage3_a_OBJECTS) $(libstage3_a_DEPENDENCIES) $(EXTRA_libstage3_a_DEPENDENCIES) 
+	-rm -f libstage3.a
+	$(libstage3_a_AR) libstage3.a $(libstage3_a_OBJECTS) $(libstage3_a_LIBADD)
+	$(RANLIB) libstage3.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array_range_check.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constant_folding.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datatype_functions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/declaration_check.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enum_declaration_check.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fill_candidate_datatypes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flow_control_analysis.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forced_narrow_candidate_datatypes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lvalue_check.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/narrow_candidate_datatypes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_datatypes_error.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage3.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- a/stage3/array_range_check.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/array_range_check.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -89,6 +89,7 @@
 array_range_check_c::array_range_check_c(symbol_c *ignore) {
 	error_count = 0;
 	current_display_error_level = 0;
+	search_varfb_instance_type = NULL;
 }
 
 
@@ -133,36 +134,36 @@
     /* Check lower limit */
     if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE( int64, dimension->lower_limit))
       if ( GET_CVALUE( int64, l->elements[i]) < GET_CVALUE( int64, dimension->lower_limit) )
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRId64").", GET_CVALUE( int64, dimension->lower_limit)); continue;}
 
     if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE(uint64, dimension->lower_limit))
       if ( cmp_unsigned_signed( GET_CVALUE(uint64, dimension->lower_limit), GET_CVALUE( int64, l->elements[i])) > 0 )
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRIu64").", GET_CVALUE(uint64, dimension->lower_limit)); continue;}
 
     if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE(uint64, dimension->lower_limit))
       if ( GET_CVALUE(uint64, l->elements[i])   <  GET_CVALUE(uint64, dimension->lower_limit))
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRIu64").", GET_CVALUE(uint64, dimension->lower_limit)); continue;}
 
     if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE( int64, dimension->lower_limit))
       if ( cmp_unsigned_signed(GET_CVALUE(uint64, l->elements[i]), GET_CVALUE( int64, dimension->lower_limit)) < 0 )
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRId64").", GET_CVALUE( int64, dimension->lower_limit)); continue;}
 
     /* Repeat the same check, now for upper limit */
     if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE( int64, dimension->upper_limit))
       if ( GET_CVALUE( int64, l->elements[i])   >  GET_CVALUE( int64, dimension->upper_limit))
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRId64").", GET_CVALUE( int64, dimension->upper_limit)); continue;}
 
     if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE(uint64, dimension->upper_limit))
       if ( cmp_unsigned_signed( GET_CVALUE(uint64, dimension->upper_limit), GET_CVALUE( int64, l->elements[i])) < 0 )
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRIu64").", GET_CVALUE(uint64, dimension->upper_limit)); continue;}
 
     if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE(uint64, dimension->upper_limit))
       if ( GET_CVALUE(uint64, l->elements[i])   >  GET_CVALUE(uint64, dimension->upper_limit))
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRIu64").", GET_CVALUE(uint64, dimension->upper_limit)); continue;}
       
     if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE( int64, dimension->upper_limit))
       if ( cmp_unsigned_signed(GET_CVALUE(uint64, l->elements[i]), GET_CVALUE( int64, dimension->upper_limit)) > 0 )
-      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+      {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRId64").", GET_CVALUE( int64, dimension->upper_limit)); continue;}
       
   }
 }
--- a/stage3/array_range_check.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/array_range_check.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -41,8 +41,6 @@
 
   private:
     search_varfb_instance_type_c *search_varfb_instance_type;
-    // search_var_instance_decl_c *search_var_instance_decl;
-    search_base_type_c search_base_type;
     int error_count;
     int current_display_error_level;
 
--- a/stage3/constant_folding.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/constant_folding.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -32,6 +32,16 @@
 
 
 
+/* TODO: 
+ *         - Add support for comparison (= and !=) of enumeration literals!
+ *              We will need to add another const_value entry to the symbol_c, containing the 
+ *              possible enumeration value of the enum constant!
+ *              Doing this will allow us to more easily implement a constant_propagation_c later on!
+ *
+ *         - Add support for comparison (= and !=) of the exact same variable
+ *                (e.g. if (int_v = int_v) then ...)
+ */
+
 
 
 /* Do constant folding...
@@ -107,13 +117,24 @@
  * NOTE 2 
  *    This file does not print out any error messages!
  *    We cannot really print out error messages when we find an overflow. Since each operation
- *    (symbol in the absract syntax tree for that operation) will have up to 4 constant results,
+ *    (symbol in the abstract syntax tree for that operation) will have up to 4 constant results,
  *    it may happen that some of them overflow, while other do not.
  *    We must wait for data type checking to determine the exact data type of each expression
  *    before we can decide whether or not we should print out an overflow error message.
  *
  *    For this reason, this visitor merely annotates the abstract syntax tree, and leaves the
- *    actuall printing of errors for the print_datatype_errors_c class!
+ *    actually printing of errors for the print_datatype_errors_c class!
+ *
+ * NOTE 3
+ *    Constant Folding class is extended with a implementation constant propagation algorithm
+ *    by Mario de Sousa.
+ *    Main idea is not to implement a general constant propagation algorithm but to reinterpret it
+ *    for visitor classes.
+ *    We declared a hash map, it contains a variables list linked with current constant values.
+ *    During expression evaluation we can retrieve a constant value to symbolic variables getting it from the map.
+ *    Also at join source points we use a meet semilattice rules to merge current values between a block
+ *    and adjacent block.
+ *
  */
 
 #include "constant_folding.hh"
@@ -165,33 +186,59 @@
 
 
 
-#define SET_CVALUE(dtype, symbol, new_value)  ((symbol)->const_value._##dtype.value) = new_value; ((symbol)->const_value._##dtype.status) = symbol_c::cs_const_value;
+#define SET_CVALUE(dtype, symbol, new_value) {((symbol)->const_value._##dtype.value) = new_value; ((symbol)->const_value._##dtype.status) = symbol_c::cs_const_value;}
 #define GET_CVALUE(dtype, symbol)             ((symbol)->const_value._##dtype.value)
 #define SET_OVFLOW(dtype, symbol)             ((symbol)->const_value._##dtype.status) = symbol_c::cs_overflow
 #define SET_NONCONST(dtype, symbol)           ((symbol)->const_value._##dtype.status) = symbol_c::cs_non_const
 
 #define VALID_CVALUE(dtype, symbol)           (symbol_c::cs_const_value == (symbol)->const_value._##dtype.status)
+#define IS_OVFLOW(dtype, symbol)              (symbol_c::cs_overflow    == (symbol)->const_value._##dtype.status)
+#define IS_NONCONST(dtype, symbol)            (symbol_c::cs_non_const   == (symbol)->const_value._##dtype.status)
 #define ISZERO_CVALUE(dtype, symbol)          ((VALID_CVALUE(dtype, symbol)) && (GET_CVALUE(dtype, symbol) == 0))
 
 #define ISEQUAL_CVALUE(dtype, symbol1, symbol2) \
 	(VALID_CVALUE(dtype, symbol1) && VALID_CVALUE(dtype, symbol2) && (GET_CVALUE(dtype, symbol1) == GET_CVALUE(dtype, symbol2))) 
 
-#define DO_BINARY_OPER(dtype, oper, otype)\
-	if (VALID_CVALUE(dtype, symbol->r_exp) && VALID_CVALUE(dtype, symbol->l_exp)) {                                \
-		SET_CVALUE(otype, symbol, GET_CVALUE(dtype, symbol->l_exp) oper GET_CVALUE(dtype, symbol->r_exp));     \
-	}
-
-#define DO_BINARY_OPER_(oper_type, operation, res_type, operand1, operand2)\
-	if (VALID_CVALUE(oper_type, operand1) && VALID_CVALUE(oper_type, operand2)) {                                     \
-		SET_CVALUE(res_type, symbol, GET_CVALUE(oper_type, operand1) operation GET_CVALUE(oper_type, operand2));  \
-	}
-
-#define DO_UNARY_OPER(dtype, operation, operand)\
-	if (VALID_CVALUE(dtype, operand)) {                                                                               \
-		SET_CVALUE(dtype, symbol, operation GET_CVALUE(dtype, operand));                                          \
-	}
-
-
+#define DO_BINARY_OPER(oper_type, operation, res_type, operand1, operand2) {                                              \
+	if      (VALID_CVALUE(oper_type, operand1) && VALID_CVALUE(oper_type, operand2))                                  \
+		{SET_CVALUE(res_type, symbol, GET_CVALUE(oper_type, operand1) operation GET_CVALUE(oper_type, operand2));}\
+	else if (IS_OVFLOW   (oper_type, operand1) || IS_OVFLOW   (oper_type, operand2))                                  \
+		{SET_OVFLOW(res_type, symbol);}  /* does it really make sense to set OVFLOW when restype is boolean??  */ \
+	else if (IS_NONCONST (oper_type, operand1) || IS_NONCONST (oper_type, operand2))                                  \
+		{SET_NONCONST(res_type, symbol);}                                                                         \
+}
+
+#define DO_UNARY_OPER(dtype, operation, operand) {                                                                        \
+	if      (VALID_CVALUE(dtype, operand))                                                                            \
+		{SET_CVALUE(dtype, symbol, operation GET_CVALUE(dtype, operand));}                                        \
+	else if (IS_OVFLOW   (dtype, operand))                                                                            \
+		{SET_OVFLOW(dtype, symbol);}                                                                              \
+	else if (IS_NONCONST (dtype, operand))                                                                            \
+		{SET_NONCONST(dtype, symbol);}                                                                            \
+}
+
+/* Constant Propagation: Rules for Meet from "Cooper K., Torczon L. - Engineering a Compiler, Second Edition - 2011"
+ * at 9.3 Static Single-Assignment Form  page 517
+ * - any * undefined = any
+ * - any * non_const = non_const
+ * - constant * constant = constant  (if equal)
+ * - constant * constant = non_const (if not equal)
+ */
+#define COMPUTE_MEET_SEMILATTICE(dtype, c1, c2, resValue) {\
+		if (( c1._##dtype.value  != c2._##dtype.value && c2._##dtype.status == symbol_c::cs_const_value &&\
+              c1._##dtype.status == symbol_c::cs_const_value) ||\
+		    ( c1._##dtype.status == symbol_c::cs_non_const && c2._##dtype.status == symbol_c::cs_const_value ) ||\
+		    ( c2._##dtype.status == symbol_c::cs_non_const && c1._##dtype.status == symbol_c::cs_const_value  )) {\
+			resValue._##dtype.status = symbol_c::cs_non_const;\
+		} else {\
+			resValue._##dtype.status = symbol_c::cs_const_value;\
+			resValue._##dtype.value  = c1._##dtype.value;\
+		}\
+}
+
+typedef std::map <std::string, symbol_c::const_value_t> map_values_t;
+
+static map_values_t values;
 
 
 
@@ -215,7 +262,11 @@
    * by having it resolve the call to the overloaded function. For the C++ compiler to be able
    * to resolve this ambiguity, we need to add a dummy parameter to each function!
    *
-   * TODO: support platforms in which int64_t is mapped onto int !! Is this really needed?
+   * TODO: support platforms (where the compiler will run) in which int64_t is mapped onto int !!
+   *       Is this really needed?
+   *       Currently, when trying to compile matiec on sych a platform, the C++ compiler will not
+   *       find any apropriate matiec_strtoint64() to call, so matiec will not be able to be compiled.
+   *       If you need this, you are welcome to fix it yourself...
    */
 static  int64_t matiec_strtoint64 (         long      int *dummy, const char *nptr, char **endptr, int base) {return strtol  (nptr, endptr, base);}
 static  int64_t matiec_strtoint64 (         long long int *dummy, const char *nptr, char **endptr, int base) {return strtoll (nptr, endptr, base);}
@@ -234,7 +285,7 @@
   int64_t      ret;
   std::string  str = "";
   char        *endptr;
-  const char  *value;
+  const char  *value = NULL;
   int          base;
   integer_c         *integer;
   hex_integer_c     *hex_integer;
@@ -266,7 +317,7 @@
   uint64_t     ret;
   std::string  str = "";
   char        *endptr;
-  const char  *value;
+  const char  *value = NULL;
   int          base;
   integer_c         *integer;
   hex_integer_c     *hex_integer;
@@ -399,6 +450,8 @@
 	if (!VALID_CVALUE(uint64, res))
 		return;
 	/* Test by pre-condition: If (UINT64_MAX / a) < b => overflow! */
+	if (0 == GET_CVALUE(uint64, a))
+		return; // multiplying by 0 will always result in 0, a valid result!	  
 	if ((UINT64_MAX / GET_CVALUE(uint64, a)) < GET_CVALUE(uint64, b))
 		SET_OVFLOW(uint64, res);
 }
@@ -423,6 +476,18 @@
 }
 
 
+/* res = - a */
+static void CHECK_OVERFLOW_uint64_NEG(symbol_c *res, symbol_c *a) {
+	/* The only legal operation is res = -0, everything else is an overflow! */
+	if (VALID_CVALUE(uint64, a) && (GET_CVALUE(uint64, a) != 0))
+		SET_OVFLOW(uint64, res);
+}
+
+
+
+
+
+
 /* res = a + b */
 static void CHECK_OVERFLOW_int64_SUM(symbol_c *res, symbol_c *a_ptr, symbol_c *b_ptr) {
 	if (!VALID_CVALUE(int64, res))
@@ -494,16 +559,16 @@
 
 
 /* res = - a */
-static void CHECK_OVERFLOW_int64_NEG(symbol_c *res, symbol_c *a_ptr) {
+static void CHECK_OVERFLOW_int64_NEG(symbol_c *res, symbol_c *a) {
 	if (!VALID_CVALUE(int64, res))
 		return;
-	int64_t a = GET_CVALUE(int64, a_ptr);
-	if (a == INT64_MIN)
+	if (GET_CVALUE(int64, a) == INT64_MIN)
 		SET_OVFLOW(int64, res);
 }
 
 
 
+
 static void CHECK_OVERFLOW_real64(symbol_c *res_ptr) {
 	if (!VALID_CVALUE(real64, res_ptr))
 		return;
@@ -532,10 +597,10 @@
 /* static void *handle_cmp(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2, OPERATION) */
 #define handle_cmp(symbol, oper1, oper2, operation) {               \
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;        \
-	DO_BINARY_OPER_(  bool, operation, bool, oper1, oper2);     \
-	DO_BINARY_OPER_(uint64, operation, bool, oper1, oper2);     \
-	DO_BINARY_OPER_( int64, operation, bool, oper1, oper2);     \
-	DO_BINARY_OPER_(real64, operation, bool, oper1, oper2);     \
+	DO_BINARY_OPER(  bool, operation, bool, oper1, oper2);     \
+	DO_BINARY_OPER(uint64, operation, bool, oper1, oper2);     \
+	DO_BINARY_OPER( int64, operation, bool, oper1, oper2);     \
+	DO_BINARY_OPER(real64, operation, bool, oper1, oper2);     \
 	return NULL;                                                \
 }
 
@@ -550,7 +615,17 @@
 
 /* unary negation (multiply by -1) */
 static void *handle_neg(symbol_c *symbol, symbol_c *oper) {
-	DO_UNARY_OPER( int64, -, oper);	CHECK_OVERFLOW_int64_NEG(symbol, oper);
+	if (NULL == oper) return NULL;
+	/* NOTE: The oper may never be an integer/real literal, '-1' and '-2.2' are stored as an neg_integer_c/neg_real_c instead.
+	 *       Because of this, we MUST NOT handle the INT_MIN special situation that is handled in neg_integer_c visitor!
+	 *
+	 *       VAR v1, v2, v3 : UINT; END_VAR;
+	 *       v1 =  9223372036854775808 ; (* |INT64_MIN| == -INT64_MIN *)   <------ LEGAL
+	 *       v2 =  -(-v1);                                                 <------ ILLEGAL (since it -v1 is overflow!)
+	 *       v2 =  -(-9223372036854775808 );                               <------ MUST also be ILLEGAL 
+	 */
+	DO_UNARY_OPER(uint64, -, oper);	CHECK_OVERFLOW_uint64_NEG(symbol, oper);  /* handle the uint_v := -0 situation! */
+	DO_UNARY_OPER( int64, -, oper);	CHECK_OVERFLOW_int64_NEG (symbol, oper);
 	DO_UNARY_OPER(real64, -, oper);	CHECK_OVERFLOW_real64(symbol);
 	return NULL;
 }
@@ -567,60 +642,60 @@
 
 static void *handle_or (symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	DO_BINARY_OPER_(  bool, ||, bool  , oper1, oper2);
-	DO_BINARY_OPER_(uint64, | , uint64, oper1, oper2);
+	DO_BINARY_OPER(  bool, ||, bool  , oper1, oper2);
+	DO_BINARY_OPER(uint64, | , uint64, oper1, oper2);
 	return NULL;
 }
 
 
 static void *handle_xor(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	DO_BINARY_OPER_(  bool, ^, bool  , oper1, oper2);
-	DO_BINARY_OPER_(uint64, ^, uint64, oper1, oper2);
+	DO_BINARY_OPER(  bool, ^, bool  , oper1, oper2);
+	DO_BINARY_OPER(uint64, ^, uint64, oper1, oper2);
 	return NULL;
 }
 
 
 static void *handle_and(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	DO_BINARY_OPER_(  bool, &&, bool, oper1, oper2);
-	DO_BINARY_OPER_(uint64, & , uint64, oper1, oper2);
+	DO_BINARY_OPER(  bool, &&, bool, oper1, oper2);
+	DO_BINARY_OPER(uint64, & , uint64, oper1, oper2);
 	return NULL;
 }
 
 
 static void *handle_add(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	DO_BINARY_OPER_(uint64, +, uint64, oper1, oper2);   CHECK_OVERFLOW_uint64_SUM(symbol, oper1, oper2);
-	DO_BINARY_OPER_( int64, +,  int64, oper1, oper2);   CHECK_OVERFLOW_int64_SUM (symbol, oper1, oper2);
-	DO_BINARY_OPER_(real64, +, real64, oper1, oper2);   CHECK_OVERFLOW_real64    (symbol);
+	DO_BINARY_OPER(uint64, +, uint64, oper1, oper2);   CHECK_OVERFLOW_uint64_SUM(symbol, oper1, oper2);
+	DO_BINARY_OPER( int64, +,  int64, oper1, oper2);   CHECK_OVERFLOW_int64_SUM (symbol, oper1, oper2);
+	DO_BINARY_OPER(real64, +, real64, oper1, oper2);   CHECK_OVERFLOW_real64    (symbol);
 	return NULL;
 }
 
 
 static void *handle_sub(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	DO_BINARY_OPER_(uint64, -, uint64, oper1, oper2);   CHECK_OVERFLOW_uint64_SUB(symbol, oper1, oper2);
-	DO_BINARY_OPER_( int64, -,  int64, oper1, oper2);   CHECK_OVERFLOW_int64_SUB (symbol, oper1, oper2);
-	DO_BINARY_OPER_(real64, -, real64, oper1, oper2);   CHECK_OVERFLOW_real64    (symbol);
+	DO_BINARY_OPER(uint64, -, uint64, oper1, oper2);   CHECK_OVERFLOW_uint64_SUB(symbol, oper1, oper2);
+	DO_BINARY_OPER( int64, -,  int64, oper1, oper2);   CHECK_OVERFLOW_int64_SUB (symbol, oper1, oper2);
+	DO_BINARY_OPER(real64, -, real64, oper1, oper2);   CHECK_OVERFLOW_real64    (symbol);
 	return NULL;
 }
 
 
 static void *handle_mul(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	DO_BINARY_OPER_(uint64, *, uint64, oper1, oper2);   CHECK_OVERFLOW_uint64_MUL(symbol, oper1, oper2);
-	DO_BINARY_OPER_( int64, *,  int64, oper1, oper2);   CHECK_OVERFLOW_int64_MUL (symbol, oper1, oper2);
-	DO_BINARY_OPER_(real64, *, real64, oper1, oper2);   CHECK_OVERFLOW_real64    (symbol);
+	DO_BINARY_OPER(uint64, *, uint64, oper1, oper2);   CHECK_OVERFLOW_uint64_MUL(symbol, oper1, oper2);
+	DO_BINARY_OPER( int64, *,  int64, oper1, oper2);   CHECK_OVERFLOW_int64_MUL (symbol, oper1, oper2);
+	DO_BINARY_OPER(real64, *, real64, oper1, oper2);   CHECK_OVERFLOW_real64    (symbol);
 	return NULL;
 }
 
 
 static void *handle_div(symbol_c *symbol, symbol_c *oper1, symbol_c *oper2) {
 	if ((NULL == oper1) || (NULL == oper2)) return NULL;
-	if (ISZERO_CVALUE(uint64, oper2))  {SET_OVFLOW(uint64, symbol);} else {DO_BINARY_OPER_(uint64, /, uint64, oper1, oper2); CHECK_OVERFLOW_uint64_DIV(symbol, oper1, oper2);};
-	if (ISZERO_CVALUE( int64, oper2))  {SET_OVFLOW( int64, symbol);} else {DO_BINARY_OPER_( int64, /,  int64, oper1, oper2); CHECK_OVERFLOW_int64_DIV (symbol, oper1, oper2);};
-	if (ISZERO_CVALUE(real64, oper2))  {SET_OVFLOW(real64, symbol);} else {DO_BINARY_OPER_(real64, /, real64, oper1, oper2); CHECK_OVERFLOW_real64(symbol);};
+	if (ISZERO_CVALUE(uint64, oper2))  {SET_OVFLOW(uint64, symbol);} else {DO_BINARY_OPER(uint64, /, uint64, oper1, oper2); CHECK_OVERFLOW_uint64_DIV(symbol, oper1, oper2);};
+	if (ISZERO_CVALUE( int64, oper2))  {SET_OVFLOW( int64, symbol);} else {DO_BINARY_OPER( int64, /,  int64, oper1, oper2); CHECK_OVERFLOW_int64_DIV (symbol, oper1, oper2);};
+	if (ISZERO_CVALUE(real64, oper2))  {SET_OVFLOW(real64, symbol);} else {DO_BINARY_OPER(real64, /, real64, oper1, oper2); CHECK_OVERFLOW_real64(symbol);};
 	return NULL;
 }
 
@@ -633,8 +708,8 @@
 	 * Note that, when IN1 = INT64_MIN, and IN2 = -1, an overflow occurs in the division,
 	 * so although the MOD operation should be OK, acording to the above definition, we actually have an overflow!!
 	 */
-	if (ISZERO_CVALUE(uint64, oper2))  {SET_CVALUE(uint64, symbol, 0);} else {DO_BINARY_OPER_(uint64, %, uint64, oper1, oper2); CHECK_OVERFLOW_uint64_MOD(symbol, oper1, oper2);};
-	if (ISZERO_CVALUE( int64, oper2))  {SET_CVALUE( int64, symbol, 0);} else {DO_BINARY_OPER_( int64, %,  int64, oper1, oper2); CHECK_OVERFLOW_int64_MOD (symbol, oper1, oper2);};
+	if (ISZERO_CVALUE(uint64, oper2))  {SET_CVALUE(uint64, symbol, 0);} else {DO_BINARY_OPER(uint64, %, uint64, oper1, oper2); CHECK_OVERFLOW_uint64_MOD(symbol, oper1, oper2);};
+	if (ISZERO_CVALUE( int64, oper2))  {SET_CVALUE( int64, symbol, 0);} else {DO_BINARY_OPER( int64, %,  int64, oper1, oper2); CHECK_OVERFLOW_int64_MOD (symbol, oper1, oper2);};
 	return NULL;
 }
 
@@ -652,6 +727,30 @@
 	return NULL;
 }
 
+static map_values_t inner_left_join_values(map_values_t m1, map_values_t m2) {
+	map_values_t::const_iterator itr;
+	map_values_t ret;
+
+	itr = m1.begin();
+	for ( ; itr != m1.end(); ++itr) {
+		std::string name = itr->first;
+		symbol_c::const_value_t value;
+
+		if (m2.count(name) > 0) {
+			symbol_c::const_value_t c1 = itr->second;
+			symbol_c::const_value_t c2 = m2[name];
+			COMPUTE_MEET_SEMILATTICE (real64, c1, c2, value);
+			COMPUTE_MEET_SEMILATTICE (uint64, c1, c2, value);
+			COMPUTE_MEET_SEMILATTICE ( int64, c1, c2, value);
+			COMPUTE_MEET_SEMILATTICE (  bool, c1, c2, value);
+		} else
+			value = m1[name];
+		ret[name] = value;
+	}
+
+	return ret;
+}
+
 /***********************************************************************/
 /***********************************************************************/
 /***********************************************************************/
@@ -698,6 +797,9 @@
     error_count = 0;
     warning_found = false;
     current_display_error_level = 0;
+    il_operand = NULL;
+    search_varfb_instance_type = NULL;
+    prev_il_instruction = NULL;
     
     /* check whether the platform on which the compiler is being run implements IEC 559 floating point data types. */
     symbol_c null_symbol;
@@ -744,19 +846,39 @@
 
 void *constant_folding_c::visit(neg_real_c *symbol) {
 	symbol->exp->accept(*this);
-	DO_UNARY_OPER(real64, -, symbol->exp);
-	CHECK_OVERFLOW_real64(symbol);
-	return NULL;
-}
+	DO_UNARY_OPER(real64, -, symbol->exp); CHECK_OVERFLOW_real64(symbol);
+	if (IS_OVFLOW(real64, symbol->exp)) SET_OVFLOW(real64, symbol);
+	return NULL;
+}
+
+
 
 /* | '-' integer	{$$ = new neg_integer_c($2, locloc(@$));} */
 void *constant_folding_c::visit(neg_integer_c *symbol) {
 	symbol->exp->accept(*this);
-	DO_UNARY_OPER(int64, -, symbol->exp);
-	CHECK_OVERFLOW_int64_NEG(symbol, symbol->exp);
+	/* Note that due to syntax restrictions, the value of symbol->exp will always be positive. 
+	 * However, the following code does not depend on that restriction.
+	 */
+	/* The remainder of the code (for example, data type checking) considers the neg_integer_c as a leaf of the
+	 * abstract syntax tree, and therefore simply ignores the values of neg_integer_c->exp.
+	 * For this reason only, and in only this situation, we must guarantee that any 'overflow' situation in 
+	 * the cvalue of neg_integer_c->exp is also reflected back to this neg_integer_c symbol.
+	 * For the rest of the code we do NOT do this, as it would gurantee that a single overflow deep inside
+	 * an expression would imply that the expression itself would also be set to 'overflow' condition.
+	 * This in turn would then have the compiler produce a whole load of error messages where they are not wanted!
+	 */
+	DO_UNARY_OPER(uint64, -, symbol->exp); CHECK_OVERFLOW_uint64_NEG(symbol, symbol->exp);  /* handle the uintv := -0 situation */
+	if (IS_OVFLOW(uint64, symbol->exp)) SET_OVFLOW(uint64, symbol);
+	DO_UNARY_OPER( int64, -, symbol->exp); CHECK_OVERFLOW_int64_NEG (symbol, symbol->exp);
+	if (IS_OVFLOW( int64, symbol->exp)) SET_OVFLOW( int64, symbol);
 	/* NOTE 1: INT64_MIN = -(INT64_MAX + 1)   ---> assuming two's complement representation!!!
 	 * NOTE 2: if the user happens to want INT_MIN, that value will first be parsed as a positive integer, before being negated here.
 	 * However, the positive value cannot be stored inside an int64! So, in this case, we will get the value from the uint64 cvalue.
+	 *
+	 * This same situation is usually considered an overflow (check handle_neg() function). However, here we have a special
+	 * situation. If we do not allow this, then the user would never the able to use the following code:
+	 *  VAR v : LINT; END_VAR
+	 *    v := -9223372036854775809 ; (* - |INT64_MIN| == INT64_MIN *)
 	 */
 	// if (INT64_MIN == -INT64_MAX - 1) // We do not really need to check that the platform uses two's complement
 	if (VALID_CVALUE(uint64, symbol->exp) && (GET_CVALUE(uint64, symbol->exp) == (uint64_t)INT64_MAX+1)) {
@@ -852,6 +974,43 @@
 	return NULL;
 }
 
+/*********************/
+/* B 1.4 - Variables */
+/*********************/
+#if DO_CONSTANT_PROPAGATION__
+void *constant_folding_c::visit(symbolic_variable_c *symbol) {
+	std::string varName;
+
+	varName = get_var_name_c::get_name(symbol->var_name)->value;
+	if (values.count(varName) > 0) {
+		symbol->const_value = values[varName];
+	}
+	return NULL;
+}
+#endif  // DO_CONSTANT_PROPAGATION__
+
+
+/**********************/
+/* B 1.5.3 - Programs */
+/**********************/
+#if DO_CONSTANT_PROPAGATION__
+void *constant_folding_c::visit(program_declaration_c *symbol) {
+	symbol_c *var_name;
+
+	symbol->var_declarations->accept(*this);
+	values.clear(); /* Clear global map */
+	search_var_instance_decl_c search_var_instance_decl(symbol);
+	function_param_iterator_c fpi(symbol);
+	while((var_name = fpi.next()) != NULL) {
+		std::string varName = get_var_name_c::get_name(var_name)->value;
+		symbol_c   *varDecl = search_var_instance_decl.get_decl(var_name);
+		values[varName] = varDecl->const_value;
+	}
+	/* Add all variables declared into Values map and put them to initial value */
+	symbol->function_block_body->accept(*this);
+	return NULL;
+}
+#endif  // DO_CONSTANT_PROPAGATION__
 
 
 /****************************************/
@@ -918,8 +1077,9 @@
 void *constant_folding_c::visit(il_expression_c *symbol) {
   symbol_c *prev_il_instruction_backup = prev_il_instruction;
   
-  if (NULL != symbol->il_operand)
-    symbol->il_operand->accept(*this);
+  /* Stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list if necessary. We can therefore ignore the 'il_operand' entry! */
+  // if (NULL != symbol->il_operand)
+  //   symbol->il_operand->accept(*this);
 
   if(symbol->simple_instr_list != NULL)
     symbol->simple_instr_list->accept(*this);
@@ -932,6 +1092,16 @@
   
   /* This object has (inherits) the same cvalues as the il_instruction */
   symbol->const_value = symbol->il_expr_operator->const_value;
+  
+  /* Since stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list when an 'il_operand' exists, we know
+   * that if (symbol->il_operand != NULL), then the first IL instruction in the simple_instr_list will be the equivalent and artificial
+   * 'LD <il_operand>' IL instruction.
+   * Just to be cosistent, we will copy the constant info back into the il_operand, even though this should not be necessary!
+   */
+  if ((NULL != symbol->il_operand) && ((NULL == symbol->simple_instr_list) || (0 == ((list_c *)symbol->simple_instr_list)->n))) ERROR; // stage2 is not behaving as we expect it to!
+  if  (NULL != symbol->il_operand)
+    symbol->il_operand->const_value = ((list_c *)symbol->simple_instr_list)->elements[0]->const_value;
+
   return NULL;
 }
 
@@ -1110,3 +1280,129 @@
 
 /* TODO: handle function invocations... */
 // void *fill_candidate_datatypes_c::visit(function_invocation_c *symbol) {}
+
+
+
+#if DO_CONSTANT_PROPAGATION__
+/*********************************/
+/* B 3.2.1 Assignment Statements */
+/*********************************/
+void *constant_folding_c::visit(assignment_statement_c *symbol) {
+	std::string varName;
+
+	symbol->r_exp->accept(*this);
+	symbol->l_exp->const_value = symbol->r_exp->const_value;
+	varName = get_var_name_c::get_name(symbol->l_exp)->value;
+	values[varName] = symbol->l_exp->const_value;
+
+	return NULL;
+}
+
+/********************************/
+/* B 3.2.3 Selection Statements */
+/********************************/
+void *constant_folding_c::visit(if_statement_c *symbol) {
+	map_values_t values_incoming;
+	map_values_t values_statement_result;
+	map_values_t values_elsestatement_result;
+	map_values_t::iterator itr;
+
+	/* Optimize dead code */
+	symbol->expression->accept(*this);
+	if (VALID_CVALUE(bool, symbol->expression) && GET_CVALUE(bool, symbol->expression) == false)
+		return NULL;
+
+	values_incoming = values; /* save incoming status */
+	symbol->statement_list->accept(*this);
+	values_statement_result = values;
+	if (NULL != symbol->else_statement_list) {
+		values = values_incoming;
+		symbol->else_statement_list->accept(*this);
+		values_elsestatement_result = values;
+	} else
+		values_elsestatement_result = values_incoming;
+	values = inner_left_join_values(values_statement_result, values_elsestatement_result);
+
+	return NULL;
+}
+
+/********************************/
+/* B 3.2.4 Iteration Statements */
+/********************************/
+void *constant_folding_c::visit(for_statement_c *symbol) {
+	map_values_t values_incoming;
+	map_values_t values_statement_result;
+	std::string varName;
+
+	values_incoming = values; /* save incoming status */
+	symbol->beg_expression->accept(*this);
+	symbol->end_expression->accept(*this);
+	varName =  get_var_name_c::get_name(symbol->control_variable)->value;
+	values[varName]._int64.status = symbol_c::cs_non_const;
+
+	/* Optimize dead code */
+	if (NULL != symbol->by_expression) {
+		symbol->by_expression->accept(*this);
+		if (VALID_CVALUE(int64, symbol->by_expression ) &&   GET_CVALUE(int64, symbol->by_expression ) > 0 &&
+			VALID_CVALUE(int64, symbol->beg_expression) && VALID_CVALUE(int64, symbol->end_expression)     &&
+			  GET_CVALUE(int64, symbol->beg_expression) >    GET_CVALUE(int64, symbol->end_expression))
+			return NULL;
+
+		if (VALID_CVALUE(int64, symbol->by_expression ) &&   GET_CVALUE(int64, symbol->by_expression ) < 0 &&
+			VALID_CVALUE(int64, symbol->beg_expression) && VALID_CVALUE(int64, symbol->end_expression)    &&
+			  GET_CVALUE(int64, symbol->beg_expression) <    GET_CVALUE(int64, symbol->end_expression))
+			return NULL;
+
+	} else {
+		if (VALID_CVALUE(int64, symbol->beg_expression) && VALID_CVALUE(int64, symbol->end_expression)     &&
+			  GET_CVALUE(int64, symbol->beg_expression) >    GET_CVALUE(int64, symbol->end_expression))
+			return NULL;
+
+	}
+
+
+	symbol->statement_list->accept(*this);
+	values_statement_result = values;
+	values = inner_left_join_values(values_statement_result, values_incoming);
+
+	return NULL;
+}
+
+void *constant_folding_c::visit(while_statement_c *symbol) {
+	map_values_t values_incoming;
+	map_values_t values_statement_result;
+
+	/* Optimize dead code */
+	symbol->expression->accept(*this);
+	if (VALID_CVALUE(bool, symbol->expression) && GET_CVALUE(bool, symbol->expression) == false)
+		return NULL;
+
+	values_incoming = values; /* save incoming status */
+	symbol->statement_list->accept(*this);
+	values_statement_result = values;
+	values = inner_left_join_values(values_statement_result, values_incoming);
+
+	return NULL;
+}
+
+void *constant_folding_c::visit(repeat_statement_c *symbol) {
+	map_values_t values_incoming;
+	map_values_t values_statement_result;
+
+	values_incoming = values; /* save incoming status */
+	symbol->statement_list->accept(*this);
+
+	/* Optimize dead code */
+	symbol->expression->accept(*this);
+	if (VALID_CVALUE(bool, symbol->expression) && GET_CVALUE(bool, symbol->expression) == true)
+		return NULL;
+
+	values_statement_result = values;
+	values = inner_left_join_values(values_statement_result, values_incoming);
+
+	return NULL;
+}
+
+#endif  // DO_CONSTANT_PROPAGATION__
+
+
--- a/stage3/constant_folding.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/constant_folding.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -30,7 +30,7 @@
  *
  */
 
-/* Determine the data type of an constant expression.
+/* Determine the value of an constant expression.
  * A reference to the relevant type definition is returned.
  *
  * For example:
@@ -44,10 +44,15 @@
 
 
 
+/* For the moment we disable constant propagation algorithm as it is not yet complete, 
+ * and due to this is currently brocken and producing incorrect results!
+ */
+#define DO_CONSTANT_PROPAGATION__ 0
+
+
+
 class constant_folding_c : public iterator_visitor_c {
-  private:
     search_varfb_instance_type_c *search_varfb_instance_type;
-    search_base_type_c search_base_type;
     int error_count;
     bool warning_found;
     int current_display_error_level;
@@ -87,6 +92,20 @@
     /********* **************/
     void *visit(fixed_point_c *symbol);
 
+    /*********************/
+    /* B 1.4 - Variables */
+    /*********************/
+    #if DO_CONSTANT_PROPAGATION__
+    void *visit(symbolic_variable_c *symbol);
+    #endif
+
+    /**********************/
+    /* B 1.5.3 - Programs */
+    /**********************/
+    #if DO_CONSTANT_PROPAGATION__
+    void *visit(program_declaration_c *symbol);
+    #endif
+
     /****************************************/
     /* B.2 - Language IL (Instruction List) */
     /****************************************/
@@ -179,6 +198,25 @@
     void *visit(   neg_expression_c *symbol);
     void *visit(   not_expression_c *symbol);
     //void *visit(function_invocation_c *symbol); /* TODO */
+
     
+    #if DO_CONSTANT_PROPAGATION__
+    /*********************************/
+    /* B 3.2.1 Assignment Statements */
+    /*********************************/
+    void *visit(assignment_statement_c *symbol);
+
+    /********************************/
+    /* B 3.2.3 Selection Statements */
+    /********************************/
+    void *visit(if_statement_c *symbol);
+
+    /********************************/
+    /* B 3.2.4 Iteration Statements */
+    /********************************/
+    void *visit(for_statement_c *symbol);
+    void *visit(while_statement_c *symbol);
+    void *visit(repeat_statement_c *symbol);
+    #endif // DO_CONSTANT_PROPAGATION__
 };
 
--- a/stage3/datatype_functions.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/datatype_functions.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -31,19 +31,6 @@
 
 
 
-elementary_type_c *elementary_type_c::singleton = NULL;
-
-const char *elementary_type_c::to_string(symbol_c *symbol) {
-  if (NULL == singleton)    singleton = new elementary_type_c;
-  if (NULL == singleton)    ERROR;
-  const char *res           = (const char *)symbol->accept(*singleton);
-  if (NULL == res)          ERROR;
-  return res;
-}
-
-
-
-
 
 /* Macro that expand to subtypes */
 /* copied from matiec/lib/create_standard_functions_txt.sh */
@@ -101,10 +88,10 @@
 
 const struct widen_entry widen_ADD_table[] = {
 #define __add(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_NUM(__add)
 #undef __add
 
@@ -113,54 +100,54 @@
     /*** Operations with TIME, DT and TOD... ***/
     /*******************************************/
     /*******************************************/ 
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,         widen_entry::ok                 },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::time_type_name,          &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::time_type_name,          &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::time_type_name,            &get_datatype_info_c::time_type_name,         widen_entry::ok                 },
+    { &get_datatype_info_c::tod_type_name,           &get_datatype_info_c::time_type_name,            &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::tod_type_name,             &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::dt_type_name,            &get_datatype_info_c::time_type_name,            &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::dt_type_name,              &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
 
     /*******************************/
     /* SAFE version on the left... */
     /*******************************/
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,         widen_entry::ok                 },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::time_type_name,            &get_datatype_info_c::time_type_name,         widen_entry::ok                 },
+    { &get_datatype_info_c::safetod_type_name,       &get_datatype_info_c::time_type_name,            &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::tod_type_name,             &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safedt_type_name,        &get_datatype_info_c::time_type_name,            &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::dt_type_name,              &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
 
     /********************************/
     /* SAFE version on the right... */
     /********************************/
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,        &search_constant_type_c::time_type_name,         widen_entry::ok         },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetod_type_name,         &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::time_type_name,          &search_constant_type_c::safedt_type_name,          &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::time_type_name,         widen_entry::ok         },
+    { &get_datatype_info_c::tod_type_name,           &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::safetod_type_name,         &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::dt_type_name,            &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::safedt_type_name,          &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },         
 
     /*************************************/
     /* SAFE version on left and right... */
     /*************************************/
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name,     widen_entry::ok                 },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name,      ANYTIME_OPER_DEPRECATION_STATUS },
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetod_type_name,      ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name,       ANYTIME_OPER_DEPRECATION_STATUS },         
-    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
-    /* not currently supported by stage4, so it is best no tto add it for now... */
-//  { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safedt_type_name,       ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safetime_type_name,     widen_entry::ok                 },
+    { &get_datatype_info_c::safetod_type_name,       &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safetod_type_name,      ANYTIME_OPER_DEPRECATION_STATUS },
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::safetod_type_name,         &get_datatype_info_c::safetod_type_name,      ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safedt_type_name,        &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safedt_type_name,       ANYTIME_OPER_DEPRECATION_STATUS },         
+    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
+    /* not currently supported by stage4, so it is best no tto add it for now... */
+//  { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::safedt_type_name,          &get_datatype_info_c::safedt_type_name,       ANYTIME_OPER_DEPRECATION_STATUS },
    
     { NULL, NULL, NULL, widen_entry::ok },
 };
@@ -173,10 +160,10 @@
 
 const struct widen_entry widen_SUB_table[] = {
 #define __sub(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_NUM(__sub)
 #undef __sub
 
@@ -185,42 +172,42 @@
     /*** Operations with TIME, DT and TOD... ***/
     /*******************************************/
     /*******************************************/ 
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,         widen_entry::ok                 },
-    { &search_constant_type_c::date_type_name,          &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },        
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::time_type_name,            &get_datatype_info_c::time_type_name,         widen_entry::ok                 },
+    { &get_datatype_info_c::date_type_name,          &get_datatype_info_c::date_type_name,            &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::tod_type_name,           &get_datatype_info_c::time_type_name,            &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::tod_type_name,           &get_datatype_info_c::tod_type_name,             &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::dt_type_name,            &get_datatype_info_c::time_type_name,            &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::dt_type_name,            &get_datatype_info_c::dt_type_name,              &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },        
 
     /*******************************/
     /* SAFE version on the left... */
     /*******************************/
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,         widen_entry::ok                 },
-    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },        
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::time_type_name,            &get_datatype_info_c::time_type_name,         widen_entry::ok                 },
+    { &get_datatype_info_c::safedate_type_name,      &get_datatype_info_c::date_type_name,            &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safetod_type_name,       &get_datatype_info_c::time_type_name,            &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safetod_type_name,       &get_datatype_info_c::tod_type_name,             &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safedt_type_name,        &get_datatype_info_c::time_type_name,            &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safedt_type_name,        &get_datatype_info_c::dt_type_name,              &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },        
 
     /********************************/
     /* SAFE version on the right... */
     /********************************/
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,        &search_constant_type_c::time_type_name,         widen_entry::ok                 },
-    { &search_constant_type_c::date_type_name,          &search_constant_type_c::safedate_type_name,        &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetod_type_name,         &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safedt_type_name,          &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },        
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::time_type_name,         widen_entry::ok                 },
+    { &get_datatype_info_c::date_type_name,          &get_datatype_info_c::safedate_type_name,        &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::tod_type_name,           &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::tod_type_name,          ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::tod_type_name,           &get_datatype_info_c::safetod_type_name,         &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::dt_type_name,            &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::dt_type_name,           ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::dt_type_name,            &get_datatype_info_c::safedt_type_name,          &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS },        
 
     /*************************************/
     /* SAFE version on left and right... */
     /*************************************/
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name,     widen_entry::ok                 },
-    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::safedate_type_name,        &search_constant_type_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name,      ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name,       ANYTIME_OPER_DEPRECATION_STATUS },
-    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },        
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safetime_type_name,     widen_entry::ok                 },
+    { &get_datatype_info_c::safedate_type_name,      &get_datatype_info_c::safedate_type_name,        &get_datatype_info_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safetod_type_name,       &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safetod_type_name,      ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safetod_type_name,       &get_datatype_info_c::safetod_type_name,         &get_datatype_info_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safedt_type_name,        &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safedt_type_name,       ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::safedt_type_name,        &get_datatype_info_c::safedt_type_name,          &get_datatype_info_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },        
 
     { NULL, NULL, NULL, widen_entry::ok },
 };
@@ -233,10 +220,10 @@
 
 const struct widen_entry widen_MUL_table[] = {
 #define __mul(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_NUM(__mul)
 #undef __mul
 
@@ -246,15 +233,15 @@
     /*******************************************/
     /*******************************************/ 
 #define __multime(TYPE)       \
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS }, \
     /* NOTE: the standard des not explicitly support the following semantics. However, since 'multiplication' is supposed to be commutative, we add it anyway... */                 \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::time_type_name,            &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::time_type_name,            &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safetime_type_name,        &get_datatype_info_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
     __ANY_NUM(__multime)
 #undef __multime
 
@@ -267,10 +254,10 @@
 
 const struct widen_entry widen_DIV_table[] = {
 #define __div(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_NUM(__div)
 #undef __div
 
@@ -280,10 +267,10 @@
     /*******************************************/
     /*******************************************/ 
 #define __divtime(TYPE)       \
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
-    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::time_type_name,          &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::time_type_name,         ANYTIME_OPER_DEPRECATION_STATUS }, \
+    { &get_datatype_info_c::safetime_type_name,      &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safetime_type_name,     ANYTIME_OPER_DEPRECATION_STATUS },
     __ANY_NUM(__divtime)
 #undef __divtime
 
@@ -295,10 +282,10 @@
 
 const struct widen_entry widen_MOD_table[] = {
 #define __mod(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_NUM(__mod)
 #undef __mod
 
@@ -310,10 +297,10 @@
 
 const struct widen_entry widen_EXPT_table[] = {
 #define __expt(IN2TYPE, IN1TYPE)       \
-    { &search_constant_type_c::IN1TYPE##_type_name,        &search_constant_type_c::IN2TYPE##_type_name,          &search_constant_type_c::IN1TYPE##_type_name,       widen_entry::ok        }, \
-    { &search_constant_type_c::safe##IN1TYPE##_type_name,  &search_constant_type_c::IN2TYPE##_type_name,          &search_constant_type_c::IN1TYPE##_type_name,       widen_entry::ok        }, \
-    { &search_constant_type_c::IN1TYPE##_type_name,        &search_constant_type_c::safe##IN2TYPE##_type_name,    &search_constant_type_c::IN1TYPE##_type_name,       widen_entry::ok        }, \
-    { &search_constant_type_c::safe##IN1TYPE##_type_name,  &search_constant_type_c::safe##IN2TYPE##_type_name,    &search_constant_type_c::safe##IN1TYPE##_type_name, widen_entry::ok        },
+    { &get_datatype_info_c::IN1TYPE##_type_name,        &get_datatype_info_c::IN2TYPE##_type_name,          &get_datatype_info_c::IN1TYPE##_type_name,       widen_entry::ok        }, \
+    { &get_datatype_info_c::safe##IN1TYPE##_type_name,  &get_datatype_info_c::IN2TYPE##_type_name,          &get_datatype_info_c::IN1TYPE##_type_name,       widen_entry::ok        }, \
+    { &get_datatype_info_c::IN1TYPE##_type_name,        &get_datatype_info_c::safe##IN2TYPE##_type_name,    &get_datatype_info_c::IN1TYPE##_type_name,       widen_entry::ok        }, \
+    { &get_datatype_info_c::safe##IN1TYPE##_type_name,  &get_datatype_info_c::safe##IN2TYPE##_type_name,    &get_datatype_info_c::safe##IN1TYPE##_type_name, widen_entry::ok        },
 #define __IN2_anynum_(IN1_TYPENAME)   __ANY_NUM_1(__expt,IN1_TYPENAME)
     __ANY_REAL(__IN2_anynum_)
 #undef __expt
@@ -335,10 +322,10 @@
 /* table used by AND and ANDN operators, and and_expression */
 const struct widen_entry widen_AND_table[] = {
 #define __and(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_BIT(__and)
 #undef __and
 
@@ -348,10 +335,10 @@
 /* table used by OR and ORN operators, and or_expression */
 const struct widen_entry widen_OR_table[] = {
 #define __or(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_BIT(__or)
 #undef __or
 
@@ -362,10 +349,10 @@
 /* table used by XOR and XORN operators, and xor_expression */
 const struct widen_entry widen_XOR_table[] = {
 #define __xor(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::TYPE##_type_name,       widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safe##TYPE##_type_name, widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::TYPE##_type_name,       widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safe##TYPE##_type_name, widen_entry::ok                 },
     __ANY_BIT(__xor)
 #undef __xor
 
@@ -384,10 +371,10 @@
 /* table used by GT, GE, EQ, LE, LT, and NE  operators, and equivalent ST expressions. */
 const struct widen_entry widen_CMP_table[] = {
 #define __cmp(TYPE)       \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::bool_type_name,         widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::bool_type_name,         widen_entry::ok                 }, \
-    { &search_constant_type_c::TYPE##_type_name,        &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::bool_type_name,         widen_entry::ok                 }, \
-    { &search_constant_type_c::safe##TYPE##_type_name,  &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safebool_type_name,     widen_entry::ok                 },
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::bool_type_name,         widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::TYPE##_type_name,          &get_datatype_info_c::bool_type_name,         widen_entry::ok                 }, \
+    { &get_datatype_info_c::TYPE##_type_name,        &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::bool_type_name,         widen_entry::ok                 }, \
+    { &get_datatype_info_c::safe##TYPE##_type_name,  &get_datatype_info_c::safe##TYPE##_type_name,    &get_datatype_info_c::safebool_type_name,     widen_entry::ok                 },
     __ANY_ELEMENTARY(__cmp)
 #undef __cmp
 
@@ -403,7 +390,7 @@
 		return -1;
 
 	for(unsigned int i = 0; i < candidate_datatypes.size(); i++)
-		if (is_type_equal(datatype, candidate_datatypes[i]))
+		if (get_datatype_info_c::is_type_equal(datatype, candidate_datatypes[i]))
 			return i;
 	/* Not found ! */
 	return -1;
@@ -461,346 +448,6 @@
 
 
 
-/* A helper function... */
-bool is_ANY_ELEMENTARY_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  return is_ANY_MAGNITUDE_type(type_symbol)
-      || is_ANY_BIT_type      (type_symbol)
-      || is_ANY_STRING_type   (type_symbol)
-      || is_ANY_DATE_type     (type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_SAFEELEMENTARY_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  return is_ANY_SAFEMAGNITUDE_type(type_symbol)
-      || is_ANY_SAFEBIT_type      (type_symbol)
-      || is_ANY_SAFESTRING_type   (type_symbol)
-      || is_ANY_SAFEDATE_type     (type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_ELEMENTARY_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  /* NOTE: doing
-   *          return is_ANY_SAFEELEMENTARY_type() || is_ANY_ELEMENTARY_type()
-   *       is incorrect, as the literals would never be considered compatible...
-   */
-  return is_ANY_MAGNITUDE_compatible(type_symbol)
-      || is_ANY_BIT_compatible      (type_symbol)
-      || is_ANY_STRING_compatible   (type_symbol)
-      || is_ANY_DATE_compatible     (type_symbol);
-}
-
-
-/* A helper function... */
-bool is_ANY_MAGNITUDE_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;}
-  return is_ANY_NUM_type(type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_signed_MAGNITUDE_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;}
-  return is_ANY_signed_NUM_type(type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_SAFEMAGNITUDE_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;}
-  return is_ANY_SAFENUM_type(type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_signed_SAFEMAGNITUDE_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;}
-  return is_ANY_signed_SAFENUM_type(type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_MAGNITUDE_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_MAGNITUDE_type    (type_symbol))              {return true;}
-  if (is_ANY_SAFEMAGNITUDE_type(type_symbol))              {return true;}
-  return is_ANY_NUM_compatible(type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_signed_MAGNITUDE_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_signed_MAGNITUDE_type    (type_symbol))       {return true;}
-  if (is_ANY_signed_SAFEMAGNITUDE_type(type_symbol))       {return true;}
-  return is_ANY_signed_NUM_compatible(type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_NUM_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_REAL_type(type_symbol))                       {return true;}
-  if (is_ANY_INT_type(type_symbol))                        {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_signed_NUM_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_REAL_type(type_symbol))                       {return true;}
-  if (is_ANY_signed_INT_type(type_symbol))                 {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_SAFENUM_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  return is_ANY_SAFEREAL_type(type_symbol)
-      || is_ANY_SAFEINT_type (type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_signed_SAFENUM_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  return is_ANY_SAFEREAL_type(type_symbol)
-      || is_ANY_signed_SAFEINT_type (type_symbol);
-}
-
-/* A helper function... */
-bool is_ANY_NUM_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_REAL_compatible(type_symbol))                       {return true;}
-  if (is_ANY_INT_compatible(type_symbol))                        {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_signed_NUM_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_REAL_compatible(type_symbol))                       {return true;}
-  if (is_ANY_signed_INT_compatible(type_symbol))                 {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_DATE_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(date_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(tod_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(dt_type_name_c))   {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_SAFEDATE_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safedate_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safetod_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safedt_type_name_c))   {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_DATE_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_DATE_type    (type_symbol))              {return true;}
-  if (is_ANY_SAFEDATE_type(type_symbol))              {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_STRING_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(string_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(wstring_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_SAFESTRING_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safestring_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safewstring_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_STRING_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_STRING_type    (type_symbol))              {return true;}
-  if (is_ANY_SAFESTRING_type(type_symbol))              {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_INT_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(sint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(int_type_name_c))   {return true;}
-  if (typeid(*type_symbol) == typeid(dint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(lint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(usint_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(uint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(udint_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(ulint_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_signed_INT_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(sint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(int_type_name_c))   {return true;}
-  if (typeid(*type_symbol) == typeid(dint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(lint_type_name_c))  {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_signed_SAFEINT_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safesint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeint_type_name_c))   {return true;}
-  if (typeid(*type_symbol) == typeid(safedint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safelint_type_name_c))  {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_SAFEINT_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safesint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeint_type_name_c))   {return true;}
-  if (typeid(*type_symbol) == typeid(safedint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safelint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeusint_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safeuint_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safeudint_type_name_c)) {return true;}
-  if (typeid(*type_symbol) == typeid(safeulint_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_signed_INT_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_signed_INT_type    (type_symbol))              {return true;}
-  if (is_ANY_signed_SAFEINT_type(type_symbol))              {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_INT_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_INT_type    (type_symbol))              {return true;}
-  if (is_ANY_SAFEINT_type(type_symbol))              {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_REAL_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(real_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(lreal_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_SAFEREAL_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safereal_type_name_c))  {return true;}
-  if (typeid(*type_symbol) == typeid(safelreal_type_name_c)) {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_REAL_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_REAL_type    (type_symbol))              {return true;}
-  if (is_ANY_SAFEREAL_type(type_symbol))              {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_BIT_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(bool_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(byte_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(word_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(dword_type_name_c))    {return true;}
-  if (typeid(*type_symbol) == typeid(lword_type_name_c))    {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_SAFEBIT_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safebool_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safebyte_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safeword_type_name_c))     {return true;}
-  if (typeid(*type_symbol) == typeid(safedword_type_name_c))    {return true;}
-  if (typeid(*type_symbol) == typeid(safelword_type_name_c))    {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_BIT_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_ANY_BIT_type    (type_symbol))              {return true;}
-  if (is_ANY_SAFEBIT_type(type_symbol))              {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_BOOL_type(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(bool_type_name_c))      {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_SAFEBOOL_type(symbol_c *type_symbol){
-  if (type_symbol == NULL) {return false;}
-  if (typeid(*type_symbol) == typeid(safebool_type_name_c))  {return true;}
-  return false;
-}
-
-/* A helper function... */
-bool is_ANY_BOOL_compatible(symbol_c *type_symbol) {
-  if (type_symbol == NULL) {return false;}
-  if (is_BOOL_type    (type_symbol))              {return true;}
-  if (is_SAFEBOOL_type(type_symbol))              {return true;}
-  return false;
-}
-
-
-
-
-
-bool is_type_equal(symbol_c *first_type, symbol_c *second_type) {
-  if ((NULL == first_type) || (NULL == second_type))
-      return false;
-  if (typeid(* first_type) == typeid(invalid_type_name_c))
-      return false;
-  if (typeid(*second_type) == typeid(invalid_type_name_c))
-      return false;
-    
-  if (is_ANY_ELEMENTARY_type(first_type)) {
-      if (typeid(*first_type) == typeid(*second_type))
-          return true;
-  } else   /* ANY_DERIVED */
-      return (first_type == second_type);
-
-  return false;
-}
-
-
-
-bool is_type_valid(symbol_c *type) {
-  if (NULL == type)
-      return false;
-  if (typeid(*type) == typeid(invalid_type_name_c))
-      return false;
-
-  return true;
-}
+
+
+
--- a/stage3/datatype_functions.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/datatype_functions.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -47,71 +47,6 @@
 
 
 
-/* A small helper class, to transform elementary data type to string.
- * this allows us to generate more relevant error messages...
- */
-
-class elementary_type_c: public null_visitor_c {
-  protected:
-    elementary_type_c(void)  {};
-    ~elementary_type_c(void) {};
-
-  private:
-    /* singleton class! */
-    static elementary_type_c *singleton;
-
-  public:
-    static const char * to_string(symbol_c *symbol);
-
-
-    /***********************************/
-    /* B 1.3.1 - Elementary Data Types */
-    /***********************************/
-    void *visit(time_type_name_c        *symbol) {return (void *)"TIME";        };
-    void *visit(bool_type_name_c        *symbol) {return (void *)"BOOL";        };
-    void *visit(sint_type_name_c        *symbol) {return (void *)"SINT";        };
-    void *visit(int_type_name_c         *symbol) {return (void *)"INT";         };
-    void *visit(dint_type_name_c        *symbol) {return (void *)"DINT";        };
-    void *visit(lint_type_name_c        *symbol) {return (void *)"LINT";        };
-    void *visit(usint_type_name_c       *symbol) {return (void *)"USINT";       };
-    void *visit(uint_type_name_c        *symbol) {return (void *)"UINT";        };
-    void *visit(udint_type_name_c       *symbol) {return (void *)"UDINT";       };
-    void *visit(ulint_type_name_c       *symbol) {return (void *)"ULINT";       };
-    void *visit(real_type_name_c        *symbol) {return (void *)"REAL";        };
-    void *visit(lreal_type_name_c       *symbol) {return (void *)"LREAL";       };
-    void *visit(date_type_name_c        *symbol) {return (void *)"DATE";        };
-    void *visit(tod_type_name_c         *symbol) {return (void *)"TOD";         };
-    void *visit(dt_type_name_c          *symbol) {return (void *)"DT";          };
-    void *visit(byte_type_name_c        *symbol) {return (void *)"BYTE";        };
-    void *visit(word_type_name_c        *symbol) {return (void *)"WORD";        };
-    void *visit(lword_type_name_c       *symbol) {return (void *)"LWORD";       };
-    void *visit(dword_type_name_c       *symbol) {return (void *)"DWORD";       };
-    void *visit(string_type_name_c      *symbol) {return (void *)"STRING";      };
-    void *visit(wstring_type_name_c     *symbol) {return (void *)"WSTRING";     };
-
-    void *visit(safetime_type_name_c    *symbol) {return (void *)"SAFETIME";    };
-    void *visit(safebool_type_name_c    *symbol) {return (void *)"SAFEBOOL";    };
-    void *visit(safesint_type_name_c    *symbol) {return (void *)"SAFESINT";    };
-    void *visit(safeint_type_name_c     *symbol) {return (void *)"SAFEINT";     };
-    void *visit(safedint_type_name_c    *symbol) {return (void *)"SAFEDINT";    };
-    void *visit(safelint_type_name_c    *symbol) {return (void *)"SAFELINT";    };
-    void *visit(safeusint_type_name_c   *symbol) {return (void *)"SAFEUSINT";   };
-    void *visit(safeuint_type_name_c    *symbol) {return (void *)"SAFEUINT";    };
-    void *visit(safeudint_type_name_c   *symbol) {return (void *)"SAFEUDINT";   };
-    void *visit(safeulint_type_name_c   *symbol) {return (void *)"SAFEULINT";   };
-    void *visit(safereal_type_name_c    *symbol) {return (void *)"SAFEREAL";    };
-    void *visit(safelreal_type_name_c   *symbol) {return (void *)"SAFELREAL";   };
-    void *visit(safedate_type_name_c    *symbol) {return (void *)"SAFEDATE";    };
-    void *visit(safetod_type_name_c     *symbol) {return (void *)"SAFETOD";     };
-    void *visit(safedt_type_name_c      *symbol) {return (void *)"SAFEDT";      };
-    void *visit(safebyte_type_name_c    *symbol) {return (void *)"SAFEBYTE";    };
-    void *visit(safeword_type_name_c    *symbol) {return (void *)"SAFEWORD";    };
-    void *visit(safelword_type_name_c   *symbol) {return (void *)"SAFELWORD";   };
-    void *visit(safedword_type_name_c   *symbol) {return (void *)"SAFEDWORD";   };
-    void *visit(safestring_type_name_c  *symbol) {return (void *)"SAFESTRING";  };
-    void *visit(safewstring_type_name_c *symbol) {return (void *)"SAFEWSTRING"; };
-};
-
 
 
 
@@ -161,60 +96,6 @@
 
 
 
-/* A helper function... */
-bool is_ANY_ELEMENTARY_type                (symbol_c *type_symbol);
-bool is_ANY_SAFEELEMENTARY_type            (symbol_c *type_symbol);
-bool is_ANY_ELEMENTARY_compatible          (symbol_c *type_symbol);
-
-bool is_ANY_MAGNITUDE_type                 (symbol_c *type_symbol);
-bool is_ANY_SAFEMAGNITUDE_type             (symbol_c *type_symbol);
-bool is_ANY_MAGNITUDE_compatible           (symbol_c *type_symbol);
-
-bool is_ANY_signed_MAGNITUDE_type          (symbol_c *type_symbol);
-bool is_ANY_signed_SAFEMAGNITUDE_type      (symbol_c *type_symbol);
-bool is_ANY_signed_MAGNITUDE_compatible    (symbol_c *type_symbol);
-
-bool is_ANY_DATE_type                      (symbol_c *type_symbol);
-bool is_ANY_SAFEDATE_type                  (symbol_c *type_symbol);
-bool is_ANY_DATE_compatible                (symbol_c *type_symbol);
-
-bool is_ANY_STRING_type                    (symbol_c *type_symbol);
-bool is_ANY_SAFESTRING_type                (symbol_c *type_symbol);
-bool is_ANY_STRING_compatible              (symbol_c *type_symbol);
-
-bool is_ANY_INT_type                       (symbol_c *type_symbol);
-bool is_ANY_SAFEINT_type                   (symbol_c *type_symbol);
-bool is_ANY_INT_compatible                 (symbol_c *type_symbol);
-
-bool is_ANY_signed_INT_type                (symbol_c *type_symbol);
-bool is_ANY_signed_SAFEINT_type            (symbol_c *type_symbol);
-bool is_ANY_signed_INT_compatible          (symbol_c *type_symbol);
-
-bool is_ANY_REAL_type                      (symbol_c *type_symbol);
-bool is_ANY_SAFEREAL_type                  (symbol_c *type_symbol);
-bool is_ANY_REAL_compatible                (symbol_c *type_symbol);
-
-bool is_ANY_NUM_type                       (symbol_c *type_symbol);
-bool is_ANY_SAFENUM_type                   (symbol_c *type_symbol);
-bool is_ANY_NUM_compatible                 (symbol_c *type_symbol);
-
-bool is_ANY_signed_NUM_type                (symbol_c *type_symbol);
-bool is_ANY_signed_SAFENUM_type            (symbol_c *type_symbol);
-bool is_ANY_signed_NUM_compatible          (symbol_c *type_symbol);
-
-bool is_ANY_BIT_type                       (symbol_c *type_symbol);
-bool is_ANY_SAFEBIT_type                   (symbol_c *type_symbol);
-bool is_ANY_BIT_compatible                 (symbol_c *type_symbol);
-
-bool is_BOOL_type                          (symbol_c *type_symbol);
-bool is_SAFEBOOL_type                      (symbol_c *type_symbol);
-bool is_ANY_BOOL_compatible                (symbol_c *type_symbol);
-
-
-bool is_type_equal(symbol_c *first_type, symbol_c *second_type);
-bool is_type_valid(symbol_c *type);
-
-
 
 
 #endif /* _HELPER_FUNCTIONS_HH_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/declaration_check.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,178 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2003-2012  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2012       Manuele Conti (conti.ma@alice.it)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/* Declaration sequence is a source code part needed to declare variables.
+ * There are some checks we need to do before start with other analysis:
+ *
+ *   - Check external option redefinition.
+ *   - Check external data type redefinition.
+ *   - Check initial values consistently with the data types of the variables/data types being declared.
+ *   - Check whether a function block uses a CONSTANT qualifier as described in 2.5.2.1.
+ *
+ */
+
+
+#include "declaration_check.hh"
+#include "datatype_functions.hh"
+
+#define FIRST_(symbol1, symbol2) (((symbol1)->first_order < (symbol2)->first_order)   ? (symbol1) : (symbol2))
+#define  LAST_(symbol1, symbol2) (((symbol1)->last_order  > (symbol2)->last_order)    ? (symbol1) : (symbol2))
+
+#define STAGE3_ERROR(error_level, symbol1, symbol2, ...) {                                                                  \
+  if (current_display_error_level >= error_level) {                                                                         \
+    fprintf(stderr, "%s:%d-%d..%d-%d: error: ",                                                                             \
+            FIRST_(symbol1,symbol2)->first_file, FIRST_(symbol1,symbol2)->first_line, FIRST_(symbol1,symbol2)->first_column,\
+                                                 LAST_(symbol1,symbol2) ->last_line,  LAST_(symbol1,symbol2) ->last_column);\
+    fprintf(stderr, __VA_ARGS__);                                                                                           \
+    fprintf(stderr, "\n");                                                                                                  \
+    error_count++;                                                                                                     \
+  }                                                                                                                         \
+}
+
+
+#define STAGE3_WARNING(symbol1, symbol2, ...) {                                                                             \
+    fprintf(stderr, "%s:%d-%d..%d-%d: warning: ",                                                                           \
+            FIRST_(symbol1,symbol2)->first_file, FIRST_(symbol1,symbol2)->first_line, FIRST_(symbol1,symbol2)->first_column,\
+                                                 LAST_(symbol1,symbol2) ->last_line,  LAST_(symbol1,symbol2) ->last_column);\
+    fprintf(stderr, __VA_ARGS__);                                                                                           \
+    fprintf(stderr, "\n");                                                                                                  \
+    warning_found = true;                                                                                                   \
+}
+
+
+declaration_check_c::declaration_check_c(symbol_c *ignore) {
+  current_display_error_level = 0;
+  current_pou_decl = NULL;
+  error_count = 0;
+}
+
+declaration_check_c::~declaration_check_c(void) {
+
+}
+
+int declaration_check_c::get_error_count() {
+  return error_count;
+}
+
+void declaration_check_c::check_global_decl(symbol_c *p_decl) {
+	symbol_c *var_name;
+
+	search_var_instance_decl_c search_var_instance_glo_decl(current_pou_decl);
+	search_var_instance_decl_c search_var_instance_ext_decl(p_decl);
+	function_param_iterator_c fpi(p_decl);
+	while((var_name = fpi.next()) != NULL) {
+      if (fpi.param_direction() == function_param_iterator_c::direction_extref) {
+     	 /* found an external reference parameter. */
+     	symbol_c *glo_decl = search_var_instance_glo_decl.get_decl(var_name);
+        symbol_c *ext_decl = search_var_instance_ext_decl.get_decl(var_name);
+    	if (glo_decl == NULL) {
+    	  STAGE3_ERROR(0, ext_decl, ext_decl, "Declaration error an external doesn't mach with any global var.");
+    	  continue;
+    	}
+        if (search_var_instance_glo_decl.get_option(var_name) != search_var_instance_ext_decl.get_option(var_name))
+          STAGE3_ERROR(0, glo_decl, glo_decl, "Declaration error an external redefinition option.");
+
+        /* TODO: Check redefinition data type.
+         *       We need a new class (like search_base_type class) to get type id by variable declaration.
+         *  symbol_c *glo_type = ????;
+         *  symbol_c *ext_type = fpi.param_type();
+	 */
+	/* For the moment, we will just use search_base_type_c instead... */
+        symbol_c *glo_type = search_base_type_c::get_basetype_decl(glo_decl);
+        symbol_c *ext_type = search_base_type_c::get_basetype_decl(ext_decl);
+        if (! get_datatype_info_c::is_type_equal(glo_type, ext_type))
+          STAGE3_ERROR(0, ext_decl, ext_decl, "Declaration error an external redefinition data type.");
+      }
+	}
+
+}
+
+
+
+/*****************************/
+/* B 1.5.2 - Function Blocks */
+/*****************************/
+/*  FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */
+// SYM_REF3(function_block_declaration_c, fblock_name, var_declarations, fblock_body)
+void *declaration_check_c::visit(function_block_declaration_c *symbol) {
+  current_pou_decl = symbol;
+  /* check if any FB declared as a VAR has any incompatible VAR_EXTERNAL declarations */
+  if (NULL != symbol->var_declarations)
+    symbol->var_declarations->accept(*this);
+  return NULL;
+}
+
+/******************************************/
+/* B 1.5.3 - Declaration & Initialisation */
+/******************************************/
+/*  PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */
+// SYM_REF3(program_declaration_c, program_type_name, var_declarations, function_block_body)
+void *declaration_check_c::visit(program_declaration_c *symbol) {
+  current_pou_decl = symbol;
+  /* check if any FB declared as a VAR has any incompatible VAR_EXTERNAL declarations */
+  if (NULL != symbol->var_declarations)
+    symbol->var_declarations->accept(*this);
+  return NULL;
+}
+
+/********************************/
+/* B 1.7 Configuration elements */
+/********************************/
+/*
+ * CONFIGURATION configuration_name
+ *    optional_global_var_declarations
+ *    (resource_declaration_list | single_resource_declaration)
+ *    optional_access_declarations
+ *    optional_instance_specific_initializations
+ * END_CONFIGURATION
+ */
+//SYM_REF5(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations)
+void *declaration_check_c::visit(configuration_declaration_c *symbol) {
+  current_pou_decl = symbol;
+  /* check if any FB declared as a VAR has any incompatible VAR_EXTERNAL declarations */
+  if (NULL != symbol->resource_declarations)
+    symbol->resource_declarations->accept(*this);
+  return NULL;
+}
+
+void *declaration_check_c::visit(program_configuration_c *symbol) {
+  symbol_c *p_decl = program_type_symtable.find_value(symbol->program_type_name);
+  if (p_decl == program_type_symtable.end_value())
+    p_decl = function_block_type_symtable.find_value(symbol->program_type_name);
+  /* stage1_2 guarantees that we are sure to find a declaration in FB or Program symtable. */
+  if (p_decl == function_block_type_symtable.end_value())
+    ERROR;
+  check_global_decl(p_decl);
+  return NULL;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/declaration_check.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,65 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2003-2012  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2012       Manuele Conti (conti.ma@alice.it)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+#include <vector>
+
+#include "../absyntax_utils/absyntax_utils.hh"
+
+
+class declaration_check_c : public iterator_visitor_c {
+    int error_count;
+    int current_display_error_level;
+    symbol_c *current_pou_decl;
+
+public:
+    declaration_check_c(symbol_c *ignore);
+    virtual ~declaration_check_c(void);
+    int get_error_count();
+
+    void check_global_decl(symbol_c *p_decl);
+
+    /*****************************/
+    /* B 1.5.2 - Function Blocks */
+    /*****************************/
+    void *visit(function_block_declaration_c *symbol);
+
+    /******************************************/
+    /* B 1.5.3 - Declaration & Initialisation */
+    /******************************************/
+    void *visit(program_declaration_c *symbol);
+
+    /********************************/
+    /* B 1.7 Configuration elements */
+    /********************************/
+    void *visit(configuration_declaration_c *symbol);
+    void *visit(program_configuration_c *symbol);
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/enum_declaration_check.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,254 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2012  Mario de Sousa (msousa@fe.up.pt)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/* Declaration sequence is a source code part needed to declare variables.
+ * There are some checks we need to do before start with other analysis:
+ *
+ *   - Check external option redefinition.
+ *   - Check external data type redefinition.
+ *   - Check initial values consistently with the data types of the variables/data types being declared.
+ *   - Check whether a function block uses a CONSTANT qualifier as described in 2.5.2.1.
+ *
+ */
+
+
+#include "enum_declaration_check.hh"
+
+
+
+#define FIRST_(symbol1, symbol2) (((symbol1)->first_order < (symbol2)->first_order)   ? (symbol1) : (symbol2))
+#define  LAST_(symbol1, symbol2) (((symbol1)->last_order  > (symbol2)->last_order)    ? (symbol1) : (symbol2))
+
+#define STAGE3_ERROR(error_level, symbol1, symbol2, ...) {                                                                  \
+  if (current_display_error_level >= error_level) {                                                                         \
+    fprintf(stderr, "%s:%d-%d..%d-%d: error: ",                                                                             \
+            FIRST_(symbol1,symbol2)->first_file, FIRST_(symbol1,symbol2)->first_line, FIRST_(symbol1,symbol2)->first_column,\
+                                                 LAST_(symbol1,symbol2) ->last_line,  LAST_(symbol1,symbol2) ->last_column);\
+    fprintf(stderr, __VA_ARGS__);                                                                                           \
+    fprintf(stderr, "\n");                                                                                                  \
+    error_count++;                                                                                                     \
+  }                                                                                                                         \
+}
+
+
+#define STAGE3_WARNING(symbol1, symbol2, ...) {                                                                             \
+    fprintf(stderr, "%s:%d-%d..%d-%d: warning: ",                                                                           \
+            FIRST_(symbol1,symbol2)->first_file, FIRST_(symbol1,symbol2)->first_line, FIRST_(symbol1,symbol2)->first_column,\
+                                                 LAST_(symbol1,symbol2) ->last_line,  LAST_(symbol1,symbol2) ->last_column);\
+    fprintf(stderr, __VA_ARGS__);                                                                                           \
+    fprintf(stderr, "\n");                                                                                                  \
+    warning_found = true;                                                                                                   \
+}
+
+
+
+
+
+
+
+
+/*****************************************************/
+/*                                                   */
+/*  A small helper class...                          */
+/*                                                   */
+/*****************************************************/
+
+/* Add to the local_enumerated_value_symtable the local enum value constants */
+ 
+
+class populate_enumvalue_symtable_c: public iterator_visitor_c {
+  private:
+    symbol_c                        *current_enumerated_type;
+    symbol_c::enumvalue_symtable_t  *enumvalue_symtable;
+
+  private:
+    int &error_count;
+    int &current_display_error_level;    
+
+  public:
+     populate_enumvalue_symtable_c(int &error_count_, int &current_display_error_level_) 
+       : error_count(error_count_), current_display_error_level(current_display_error_level_) {
+       current_enumerated_type = NULL;  
+       enumvalue_symtable = NULL;
+     };
+    ~populate_enumvalue_symtable_c(void) {}
+    
+    void populate(symbol_c::enumvalue_symtable_t *symtable, symbol_c *symbol) {
+       enumvalue_symtable = symtable;
+       symbol->accept(*this);
+       enumvalue_symtable = NULL;
+     }
+
+  protected:
+  /*************************/
+  /* B.1 - Common elements */
+  /*************************/
+  /**********************/
+  /* B.1.3 - Data types */
+  /**********************/
+  /********************************/
+  /* B 1.3.3 - Derived data types */
+  /********************************/
+  /*  enumerated_type_name ':' enumerated_spec_init */
+  void *visit(enumerated_type_declaration_c *symbol) {
+    current_enumerated_type = symbol;
+    symbol->enumerated_spec_init->accept(*this);
+    current_enumerated_type = NULL;
+    return NULL;
+  }
+
+  /* enumerated_specification ASSIGN enumerated_value */
+  void *visit(enumerated_spec_init_c *symbol) {
+    if (NULL == current_enumerated_type)
+      current_enumerated_type = symbol;
+    symbol->enumerated_specification->accept(*this);
+    /* DO NOT visit the symbol->enumerated_value   !!! */
+    current_enumerated_type = NULL;
+    return NULL;
+  }
+
+  /* [enumerated_type_name '#'] identifier */
+  void *visit(enumerated_value_c *symbol) {
+    token_c *value = dynamic_cast <token_c *>(symbol->value);
+    if (NULL == value) ERROR;
+    const char *value_str = value->value;
+
+    if (current_enumerated_type == NULL) ERROR;  
+    /* this is really an ERROR! The initial value may use the syntax NUM_TYPE#enum_value, but in that case we should not have reached this visit method !! */
+    if (symbol->type != NULL) ERROR;  
+
+    symbol_c::enumvalue_symtable_t::iterator lower = enumvalue_symtable->lower_bound(value_str);
+    symbol_c::enumvalue_symtable_t::iterator upper = enumvalue_symtable->upper_bound(value_str);
+    for (; lower != upper; lower++)
+      if (lower->second == current_enumerated_type) {
+        /*  The same identifier is used more than once as an enumerated value/constant inside the same enumerated datat type! */
+        STAGE3_ERROR(0, symbol, symbol, "Duplicate identifier in enumerated data type.");
+        return NULL; /* No need to insert it! It is already in the table! */
+      }
+    
+    /* add it to the local symbol table. */
+    enumvalue_symtable->insert(std::pair<const char *, symbol_c *>(value_str, current_enumerated_type));
+    return NULL;
+  }
+}; // class populate_enumvalue_symtable_c
+
+
+
+
+
+
+
+
+
+
+
+enum_declaration_check_c::enum_declaration_check_c(symbol_c *ignore) {
+  error_count = 0;
+  current_display_error_level = 0;
+  global_enumvalue_symtable = NULL;
+  populate_enumvalue_symtable = new populate_enumvalue_symtable_c(error_count, current_display_error_level);
+}
+
+enum_declaration_check_c::~enum_declaration_check_c(void) {}
+
+int enum_declaration_check_c::get_error_count() {return error_count;}
+
+
+/***************************/
+/* B 0 - Programming Model */
+/***************************/
+void *enum_declaration_check_c::visit(library_c *symbol) {
+  global_enumvalue_symtable = &(symbol->enumvalue_symtable);
+  iterator_visitor_c::visit(symbol); // fall back to base class
+  return NULL;
+}
+
+
+
+/**********************/
+/* B.1.3 - Data types */
+/**********************/
+void *enum_declaration_check_c::visit(data_type_declaration_c *symbol) {
+  if (NULL == global_enumvalue_symtable) ERROR;
+  populate_enumvalue_symtable->populate(global_enumvalue_symtable, symbol);
+  return NULL;
+}
+
+/*********************/
+/* B 1.5.1 Functions */
+/*********************/
+void *enum_declaration_check_c::visit(function_declaration_c *symbol) {
+  populate_enumvalue_symtable->populate(&(symbol->enumvalue_symtable), symbol->var_declarations_list);
+  return NULL;
+}
+
+/***************************/
+/* B 1.5.2 Function blocks */
+/***************************/
+void *enum_declaration_check_c::visit(function_block_declaration_c *symbol) {
+  populate_enumvalue_symtable->populate(&(symbol->enumvalue_symtable), symbol->var_declarations);
+  return NULL;
+}
+
+/**********************/
+/* B 1.5.3 - Programs */
+/**********************/
+void *enum_declaration_check_c::visit(program_declaration_c *symbol) {
+  populate_enumvalue_symtable->populate(&(symbol->enumvalue_symtable), symbol->var_declarations);
+  return NULL;
+}
+
+/********************************/
+/* B 1.7 Configuration elements */
+/********************************/
+void *enum_declaration_check_c::visit(configuration_declaration_c *symbol) {
+  if (NULL != symbol->global_var_declarations)
+    populate_enumvalue_symtable->populate(&(symbol->enumvalue_symtable), symbol->global_var_declarations);
+  if (NULL != symbol->resource_declarations)
+    /* May reference either a list of resource_declaration_c, or a single_resource_declaration_c */
+    populate_enumvalue_symtable->populate(&(symbol->enumvalue_symtable), symbol->resource_declarations);
+  
+  return NULL;
+}
+
+
+void *enum_declaration_check_c::visit(resource_declaration_c *symbol) {
+  if (NULL != symbol->global_var_declarations)
+    populate_enumvalue_symtable->populate(&(symbol->enumvalue_symtable), symbol->global_var_declarations);
+  return NULL;
+}
+
+
+void *enum_declaration_check_c::visit(single_resource_declaration_c *symbol) {
+  /* do NOT visit! */
+  return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/enum_declaration_check.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,81 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2012  Mario de Sousa (msousa@fe.up.pt)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+#include "../absyntax_utils/absyntax_utils.hh"
+
+class populate_enumvalue_symtable_c;
+
+class enum_declaration_check_c : public iterator_visitor_c {
+  private:
+    int error_count;
+    int current_display_error_level;
+    populate_enumvalue_symtable_c *populate_enumvalue_symtable;
+    symbol_c::enumvalue_symtable_t *global_enumvalue_symtable;
+    
+  public:
+     enum_declaration_check_c(symbol_c *ignore);
+    ~enum_declaration_check_c(void);
+    int get_error_count();
+
+    
+    /***************************/
+    /* B 0 - Programming Model */
+    /***************************/
+    void *visit(library_c *symbol);
+
+    /**********************/
+    /* B.1.3 - Data types */
+    /**********************/
+    void *visit(data_type_declaration_c *symbol);
+  
+    /***********************/
+    /* B 1.5.1 - Functions */
+    /***********************/
+    void *visit(function_declaration_c *symbol);
+   
+    /*****************************/
+    /* B 1.5.2 - Function Blocks */
+    /*****************************/
+    void *visit(function_block_declaration_c *symbol);
+
+    /******************************************/
+    /* B 1.5.3 - Declaration & Initialisation */
+    /******************************************/
+    void *visit(program_declaration_c *symbol);
+
+    /********************************/
+    /* B 1.7 Configuration elements */
+    /********************************/
+    void *visit(configuration_declaration_c *symbol);
+    void *visit(resource_declaration_c *symbol);
+    void *visit(single_resource_declaration_c *symbol);    
+};
--- a/stage3/fill_candidate_datatypes.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/fill_candidate_datatypes.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -53,6 +53,10 @@
  *  The candidate datatype list will be filled with a list of all the data types that expression may legally take.
  *  For example, the very simple literal '0' (as in foo := 0), may represent a:
  *    BOOL, BYTE, WORD, DWORD, LWORD, USINT, SINT, UINT, INT, UDINT, DINT, ULINT, LINT (as well as the SAFE versions of these data tyes too!)
+ *
+ * WARNING: This visitor class starts off by building a map of all enumeration constants that are defined in the source code (i.e. a library_c symbol),
+ *          and this map is later used to determine the datatpe of each use of an enumeration constant. By implication, the fill_candidate_datatypes_c 
+ *          visitor class will only work corretly if it is asked to visit a symbol of class library_c!!
  */
 
 #include <../main.hh>         /* required for UINT64_MAX, INT64_MAX, INT64_MIN, ... */
@@ -68,15 +72,218 @@
 #define VALID_CVALUE(dtype, symbol)           (symbol_c::cs_const_value == (symbol)->const_value._##dtype.status)
 #define IS_OVERFLOW(dtype, symbol)            (symbol_c::cs_overflow == (symbol)->const_value._##dtype.status)
 
+
+
+
 /* set to 1 to see debug info during execution */
 static int debug = 0;
 
+
+
+/*****************************************************/
+/*                                                   */
+/*  A small helper class...                          */
+/*                                                   */
+/*****************************************************/
+
+/* Add to the global_enumerated_value_symtable the global enum value constants, i.e. the enum constants used in the enumerated
+ * datatypes that are defined inside a TYPE ... END_TYPE declaration.
+ */
+/* NOTE: we do not store any NULL values in this symbol table, so we can safely use NULL and the null value. */
+
+symbol_c null_enumvalue_symbol; /* cannot be static, so it may be used in the template!! */
+typedef dsymtable_c<symbol_c *, &null_enumvalue_symbol> enumerated_value_symtable_t;
+static enumerated_value_symtable_t global_enumerated_value_symtable;
+ 
+ 
+class populate_globalenumvalue_symtable_c: public iterator_visitor_c {
+  private:
+    symbol_c *current_enumerated_type;
+
+  public:
+     populate_globalenumvalue_symtable_c(void) {current_enumerated_type = NULL;};
+    ~populate_globalenumvalue_symtable_c(void) {}
+
+  public:
+  /*************************/
+  /* B.1 - Common elements */
+  /*************************/
+  /**********************/
+  /* B.1.3 - Data types */
+  /**********************/
+  /********************************/
+  /* B 1.3.3 - Derived data types */
+  /********************************/
+  /*  enumerated_type_name ':' enumerated_spec_init */
+  void *visit(enumerated_type_declaration_c *symbol) {
+  //current_enumerated_type = symbol->enumerated_type_name;
+    current_enumerated_type = symbol;
+    symbol->enumerated_spec_init->accept(*this);
+    current_enumerated_type = NULL;
+    return NULL;
+  }
+
+  /* enumerated_specification ASSIGN enumerated_value */
+  void *visit(enumerated_spec_init_c *symbol) {
+    return symbol->enumerated_specification->accept(*this);
+  }
+
+  /* [enumerated_type_name '#'] identifier */
+  void *visit(enumerated_value_c *symbol) {
+    if (current_enumerated_type == NULL) ERROR;
+    if (symbol->type != NULL) ERROR;
+
+    enumerated_value_symtable_t::iterator lower = global_enumerated_value_symtable.lower_bound(symbol->value);
+    enumerated_value_symtable_t::iterator upper = global_enumerated_value_symtable.upper_bound(symbol->value);
+    for (; lower != upper; lower++)
+      if (lower->second == current_enumerated_type) {
+        /*  The same identifier is used more than once as an enumerated value/constant inside the same enumerated datat type! */
+        return NULL; /* No need to insert it! It is already in the table! */
+      }
+
+    global_enumerated_value_symtable.insert(symbol->value, current_enumerated_type);
+    return NULL;
+  }
+
+  /**************************************/
+  /* B.1.5 - Program organization units */
+  /**************************************/
+  /* B 1.5.1 - Functions */
+  void *visit(function_declaration_c *symbol) {return NULL;}
+  /* B 1.5.2 - Function Blocks */
+  void *visit(function_block_declaration_c *symbol) {return NULL;}
+  /* B 1.5.3 - Programs */
+  void *visit(program_declaration_c *symbol) {return NULL;}
+  
+}; /* populate_globalenumvalue_symtable_c */
+
+static populate_globalenumvalue_symtable_c populate_globalenumvalue_symtable;
+
+
+/*****************************************************/
+/*                                                   */
+/*  A small helper class...                          */
+/*                                                   */
+/*****************************************************/
+
+/* Add to the local_enumerated_value_symtable the local enum value constants */
+/* Notes:
+ * Some enumerations are 
+ *   (A) declared anonymously inside a VAR ... END_VAR declaration
+ *       (e.g. VAR enum_var : (enumvalue1, enumvalue2); END_VAR)
+ *  while others are 
+ *   (B) declared (with a name) inside a TYPE .. END_TYPE declaration.
+ *
+ *  Values in (A) are added to the enumerated_value_symtable in absyntaxt_utils.cc.
+ *  Values in (B) are only in scope inside the POU with the VAR END_VAR declaration.
+ *
+ * This class will add the enum values in (B) to the local_enumerated_value_symtable.
+ *
+ * If a locally defined enum value is identical to another locally defined enum_value, a 
+ *  duplicate entry is created.
+ *  However, if a locally defined enum value is identical to another globally defined enum_value, the
+ *  corresponding entry in local_enumerated_value_symtable is also set to the local datatype.
+ *  This is because anonynous locally feined enum datatypes are anonymous, and its enum values cannot therefore
+ *  be disambiguated using EnumType#enum_value (since the enum type does not have a name, it is anonymous!).
+ *  For this reason we implement the semantics where locally defined enum values, when in scope, will 'cover'
+ *  the globally defined enum value with the same name/identifier.
+ *  For example:
+ *
+ *  TYPE  GlobalEnumT: (xxx1, xxx2, xxx3) END_TYPE
+ * 
+ *   FUNCTION_BLOCK FOO
+ *    VAR_INPUT
+ *       GlobalEnumVar: GlobalEnumT;
+ *      LocalEnumVar : (xxx1, yyy2, yyy3);
+ *     END_VAR
+ *     LocalEnumVar  := xxx1;   <-- We consider it OK!!!     xxx1 will reference the anonymous type used for LocalEnumVar
+ *     GlobalEnumVar := xxx1;   <-- We consider it an error. xxx1 will reference the anonymous type used for LocalEnumVar
+ *     GlobalEnumVar := GlobalEnumT#xxx1;
+ *     END_FUNCTION_BLOCK
+ */
+ 
+static enumerated_value_symtable_t local_enumerated_value_symtable;
+
+
+class populate_localenumvalue_symtable_c: public iterator_visitor_c {
+  private:
+    symbol_c *current_enumerated_type;
+
+  public:
+     populate_localenumvalue_symtable_c(void) {current_enumerated_type = NULL;};
+    ~populate_localenumvalue_symtable_c(void) {}
+
+  public:
+  /*************************/
+  /* B.1 - Common elements */
+  /*************************/
+  /**********************/
+  /* B.1.3 - Data types */
+  /**********************/
+  /********************************/
+  /* B 1.3.3 - Derived data types */
+  /********************************/
+  /*  TYPE type_declaration_list END_TYPE */
+  void *visit(data_type_declaration_c *symbol) {return NULL;} // do not visit the type declarations!!
+  
+  /* enumerated_specification ASSIGN enumerated_value */
+  void *visit(enumerated_spec_init_c *symbol) {
+    current_enumerated_type = symbol;
+    symbol->enumerated_specification->accept(*this);
+    /* DO NOT visit the symbol->enumerated_value   !!! */
+    current_enumerated_type = NULL;
+    return NULL;
+  }
+
+  /* [enumerated_type_name '#'] identifier */
+  void *visit(enumerated_value_c *symbol) {
+    /* if the enumerated_value_c is not inside a enumerated_spec_init_c (e.g. used as the inital value of a variable), we simply return */
+    if (current_enumerated_type == NULL) return NULL;  
+    /* this is really an ERROR! The initial value may use the syntax NUM_TYPE#enum_value, but in that case we should have return'd in the above statement !! */
+    if (symbol->type != NULL) ERROR;  
+
+    enumerated_value_symtable_t::iterator lower = local_enumerated_value_symtable.lower_bound(symbol->value);
+    enumerated_value_symtable_t::iterator upper = local_enumerated_value_symtable.upper_bound(symbol->value);
+    for (; lower != upper; lower++)
+      if (lower->second == current_enumerated_type) {
+        /*  The same identifier is used more than once as an enumerated value/constant inside the same enumerated datat type! */
+        return NULL; /* No need to insert it! It is already in the table! */
+      }
+    
+    /* add it to the local symbol table. */
+    local_enumerated_value_symtable.insert(symbol->value, current_enumerated_type);
+    return NULL;
+  }
+}; // class populate_enumvalue_symtable_c
+
+static populate_localenumvalue_symtable_c populate_enumvalue_symtable;
+
+
+
+
+/*****************************************************/
+/*                                                   */
+/*  Main  FILL candidate datatypes algorithm...      */
+/*                                                   */
+/*****************************************************/
+
+
 fill_candidate_datatypes_c::fill_candidate_datatypes_c(symbol_c *ignore) {
+	il_operand = NULL;
+	prev_il_instruction = NULL;
+	search_varfb_instance_type = NULL;
+	current_enumerated_spec_type = NULL;
 }
 
 fill_candidate_datatypes_c::~fill_candidate_datatypes_c(void) {
 }
 
+
+
+
+
+
+
 symbol_c *fill_candidate_datatypes_c::widening_conversion(symbol_c *left_type, symbol_c *right_type, const struct widen_entry widen_table[]) {
 	int k;
 	/* find a widening table entry compatible */
@@ -93,7 +300,7 @@
   /* If it is an invalid data type, do not insert!
    * NOTE: it reduces overall code size to do this test here, instead of doing every time before calling the add_datatype_to_candidate_list() function. 
    */
-  if (!is_type_valid(datatype)) /* checks for NULL and invalid_type_name_c */
+  if (!get_datatype_info_c::is_type_valid(datatype)) /* checks for NULL and invalid_type_name_c */
     return false;
 
   if (search_in_candidate_datatype_list(datatype, symbol->candidate_datatypes) >= 0) 
@@ -119,8 +326,8 @@
     #error __REMOVE__ macro already exists. Choose another name!
   #endif
   #define __REMOVE__(datatype)\
-      remove_from_candidate_datatype_list(&search_constant_type_c::datatype,       symbol->candidate_datatypes);\
-      remove_from_candidate_datatype_list(&search_constant_type_c::safe##datatype, symbol->candidate_datatypes);
+      remove_from_candidate_datatype_list(&get_datatype_info_c::datatype,       symbol->candidate_datatypes);\
+      remove_from_candidate_datatype_list(&get_datatype_info_c::safe##datatype, symbol->candidate_datatypes);
   
   {/* Remove unsigned data types */
     uint64_t value = 0;
@@ -183,7 +390,6 @@
 			if(param_name == NULL) return false;
 		} while ((strcmp(param_name->value, "EN") == 0) || (strcmp(param_name->value, "ENO") == 0));
 
-		/* TODO: verify if it is lvalue when INOUT or OUTPUT parameters! */
 		/* Get the parameter type */
 		param_datatype = base_type(fp_iterator.param_type());
 		
@@ -314,7 +520,7 @@
 	 * expressions inside the function call will themselves have erros and will  guarantee that 
 	 * compilation is aborted in stage3 (in print_datatypes_error_c).
 	 */
-	if (function_symtable.multiplicity(fcall_data.function_name) == 1) {
+	if (function_symtable.count(fcall_data.function_name) == 1) {
 		f_decl = function_symtable.get_value(lower);
 		returned_parameter_type = base_type(f_decl->type_name);
 		if (add_datatype_to_candidate_list(fcall, returned_parameter_type))
@@ -403,6 +609,7 @@
 }
 
 
+
 /* handle a binary ST expression, like '+', '-', etc... */
 void *fill_candidate_datatypes_c::handle_binary_expression(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr) {
 	l_expr->accept(*this);
@@ -412,15 +619,40 @@
 
 
 
+/* handle the two equality comparison operations, i.e. = (euqal) and != (not equal) */
+/* This function is special, as it will also allow enumeration data types to be compared, with the result being a BOOL data type!
+ * This possibility os not expressed in the 'widening' tables, so we need to hard code it here
+ */
+void *fill_candidate_datatypes_c::handle_equality_comparison(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr) {
+	handle_binary_expression(widen_table, symbol, l_expr, r_expr);
+	for(unsigned int i = 0; i < l_expr->candidate_datatypes.size(); i++)
+		for(unsigned int j = 0; j < r_expr->candidate_datatypes.size(); j++) {
+			if ((l_expr->candidate_datatypes[i] == r_expr->candidate_datatypes[j]) && search_base_type_c::type_is_enumerated(l_expr->candidate_datatypes[i]))
+				add_datatype_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name);
+		}
+	return NULL;
+}
+
+
 
 /* a helper function... */
 symbol_c *fill_candidate_datatypes_c::base_type(symbol_c *symbol) {
-	/* NOTE: symbol == NULL is valid. It will occur when, for e.g., an undefined/undeclared symbolic_variable is used
-	 *       in the code.
-	 */
+	/* NOTE: symbol == NULL is valid. It will occur when, for e.g., an undefined/undeclared symbolic_variable is used in the code. */
 	if (symbol == NULL) return NULL;
-	return (symbol_c *)symbol->accept(search_base_type);
-}
+	return search_base_type_c::get_basetype_decl(symbol);
+}
+
+
+/***************************/
+/* B 0 - Programming Model */
+/***************************/
+/* main entry function! */
+void *fill_candidate_datatypes_c::visit(library_c *symbol) {
+  symbol->accept(populate_globalenumvalue_symtable);
+  /* Now let the base class iterator_visitor_c iterate through all the library elements */
+  return iterator_visitor_c::visit(symbol);  
+}
+
 
 /*********************/
 /* B 1.2 - Constants */
@@ -431,19 +663,19 @@
 #define sizeoftype(symbol) get_sizeof_datatype_c::getsize(symbol)
 
 void *fill_candidate_datatypes_c::handle_any_integer(symbol_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::bool_type_name,  &search_constant_type_c::safebool_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::byte_type_name,  &search_constant_type_c::safebyte_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::word_type_name,  &search_constant_type_c::safeword_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::dword_type_name, &search_constant_type_c::safedword_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::lword_type_name, &search_constant_type_c::safelword_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::sint_type_name,  &search_constant_type_c::safesint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::int_type_name,   &search_constant_type_c::safeint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::dint_type_name,  &search_constant_type_c::safedint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::lint_type_name,  &search_constant_type_c::safelint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::usint_type_name, &search_constant_type_c::safeusint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::uint_type_name,  &search_constant_type_c::safeuint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::udint_type_name, &search_constant_type_c::safeudint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::ulint_type_name, &search_constant_type_c::safeulint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name,  &get_datatype_info_c::safebool_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::byte_type_name,  &get_datatype_info_c::safebyte_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::word_type_name,  &get_datatype_info_c::safeword_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::dword_type_name, &get_datatype_info_c::safedword_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::lword_type_name, &get_datatype_info_c::safelword_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::sint_type_name,  &get_datatype_info_c::safesint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::int_type_name,   &get_datatype_info_c::safeint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::dint_type_name,  &get_datatype_info_c::safedint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::lint_type_name,  &get_datatype_info_c::safelint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::usint_type_name, &get_datatype_info_c::safeusint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::uint_type_name,  &get_datatype_info_c::safeuint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::udint_type_name, &get_datatype_info_c::safeudint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::ulint_type_name, &get_datatype_info_c::safeulint_type_name);
 	remove_incompatible_datatypes(symbol);
 	if (debug) std::cout << "ANY_INT [" << symbol->candidate_datatypes.size()<< "]" << std::endl;
 	return NULL;
@@ -452,8 +684,8 @@
 
 
 void *fill_candidate_datatypes_c::handle_any_real(symbol_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::real_type_name,  &search_constant_type_c::safereal_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::lreal_type_name, &search_constant_type_c::safelreal_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::real_type_name,  &get_datatype_info_c::safereal_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::lreal_type_name, &get_datatype_info_c::safelreal_type_name);
 	remove_incompatible_datatypes(symbol);
 	if (debug) std::cout << "ANY_REAL [" << symbol->candidate_datatypes.size() << "]" << std::endl;
 	return NULL;
@@ -466,7 +698,7 @@
 	if (search_in_candidate_datatype_list(symbol_type, symbol_value->candidate_datatypes) >= 0)
 		add_datatype_to_candidate_list(symbol, symbol_type);
 	remove_incompatible_datatypes(symbol);
-	if (debug) std::cout << "XXX_LITERAL [" << symbol->candidate_datatypes.size() << "]\n";
+	if (debug) std::cout << "ANY_LITERAL [" << symbol->candidate_datatypes.size() << "]\n";
 	return NULL;
 }
 
@@ -478,10 +710,11 @@
 
 
 void *fill_candidate_datatypes_c::visit(neg_integer_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::int_type_name, &search_constant_type_c::safeint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::sint_type_name, &search_constant_type_c::safesint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::dint_type_name, &search_constant_type_c::safedint_type_name);
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::lint_type_name, &search_constant_type_c::safelint_type_name);
+	/* Please read the comment in neg_expression_c method, as it also applies here */
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::int_type_name, &get_datatype_info_c::safeint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::sint_type_name, &get_datatype_info_c::safesint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::dint_type_name, &get_datatype_info_c::safedint_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::lint_type_name, &get_datatype_info_c::safelint_type_name);
 	remove_incompatible_datatypes(symbol);
 	if (debug) std::cout << "neg ANY_INT [" << symbol->candidate_datatypes.size() << "]" << std::endl;
 	return NULL;
@@ -518,12 +751,12 @@
 
 
 void *fill_candidate_datatypes_c::visit(boolean_true_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::bool_type_name, &search_constant_type_c::safebool_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name, &get_datatype_info_c::safebool_type_name);
 	return NULL;
 }
 
 void *fill_candidate_datatypes_c::visit(boolean_false_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::bool_type_name, &search_constant_type_c::safebool_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name, &get_datatype_info_c::safebool_type_name);
 	return NULL;
 }
 
@@ -531,12 +764,12 @@
 /* B.1.2.2   Character Strings */
 /*******************************/
 void *fill_candidate_datatypes_c::visit(double_byte_character_string_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::wstring_type_name, &search_constant_type_c::safewstring_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::wstring_type_name, &get_datatype_info_c::safewstring_type_name);
 	return NULL;
 }
 
 void *fill_candidate_datatypes_c::visit(single_byte_character_string_c *symbol) {
-	add_2datatypes_to_candidate_list(symbol, &search_constant_type_c::string_type_name, &search_constant_type_c::safestring_type_name);
+	add_2datatypes_to_candidate_list(symbol, &get_datatype_info_c::string_type_name, &get_datatype_info_c::safestring_type_name);
 	return NULL;
 }
 
@@ -547,8 +780,6 @@
 /* B 1.2.3.1 - Duration */
 /************************/
 void *fill_candidate_datatypes_c::visit(duration_c *symbol) {
-	/* TODO: check whether the literal follows the rules specified in section '2.2.3.1 Duration' of the standard! */
-	
 	add_datatype_to_candidate_list(symbol, symbol->type_name);
 	if (debug) std::cout << "TIME_LITERAL [" << symbol->candidate_datatypes.size() << "]\n";
 	return NULL;
@@ -567,6 +798,17 @@
 /********************************/
 /* B 1.3.3 - Derived data types */
 /********************************/
+/*  TYPE type_declaration_list END_TYPE */
+// SYM_REF1(data_type_declaration_c, type_declaration_list)
+/* NOTE: Not required. already handled by iterator_visitor_c base class */
+
+/* helper symbol for data_type_declaration */
+// SYM_LIST(type_declaration_list_c)
+/* NOTE: Not required. already handled by iterator_visitor_c base class */
+
+/*  simple_type_name ':' simple_spec_init */
+// SYM_REF2(simple_type_declaration_c, simple_type_name, simple_spec_init)
+/* NOTE: Not required. already handled by iterator_visitor_c base class */
 
 /* simple_specification ASSIGN constant */
 // SYM_REF2(simple_spec_init_c, simple_specification, constant)
@@ -583,40 +825,138 @@
 	return NULL;
 }
 
+
+/*  subrange_type_name ':' subrange_spec_init */
+// SYM_REF2(subrange_type_declaration_c, subrange_type_name, subrange_spec_init)
+
+/* subrange_specification ASSIGN signed_integer */
+// SYM_REF2(subrange_spec_init_c, subrange_specification, signed_integer)
+
+/*  integer_type_name '(' subrange')' */
+// SYM_REF2(subrange_specification_c, integer_type_name, subrange)
+
 /*  signed_integer DOTDOT signed_integer */
-// SYM_REF2(subrange_c, lower_limit, upper_limit)
+/* dimension will be filled in during stage 3 (array_range_check_c) with the number of elements in this subrange */
+// SYM_REF2(subrange_c, lower_limit, upper_limit, unsigned long long int dimension;)
 void *fill_candidate_datatypes_c::visit(subrange_c *symbol) {
 	symbol->lower_limit->accept(*this);
 	symbol->upper_limit->accept(*this);
 	
 	for (unsigned int u = 0; u < symbol->upper_limit->candidate_datatypes.size(); u++) {
 		for(unsigned int l = 0; l < symbol->lower_limit->candidate_datatypes.size(); l++) {
-			if (is_type_equal(symbol->upper_limit->candidate_datatypes[u], symbol->lower_limit->candidate_datatypes[l]))
+			if (get_datatype_info_c::is_type_equal(symbol->upper_limit->candidate_datatypes[u], symbol->lower_limit->candidate_datatypes[l]))
 				add_datatype_to_candidate_list(symbol, symbol->lower_limit->candidate_datatypes[l]);
 		}
 	}
 	return NULL;
 }
 
-/*  TYPE type_declaration_list END_TYPE */
-// SYM_REF1(data_type_declaration_c, type_declaration_list)
-/* NOTE: Not required. already handled by iterator_visitor_c base class */
-/*
-void *fill_candidate_datatypes_c::visit(data_type_declaration_c *symbol) {
-	symbol->type_declaration_list->accept(*this);
-	return NULL;
-}
-*/
-
+
+/*  enumerated_type_name ':' enumerated_spec_init */
+// SYM_REF2(enumerated_type_declaration_c, enumerated_type_name, enumerated_spec_init)
+void *fill_candidate_datatypes_c::visit(enumerated_type_declaration_c *symbol) {
+  current_enumerated_spec_type = base_type(symbol);
+  add_datatype_to_candidate_list(symbol,                       current_enumerated_spec_type);
+  add_datatype_to_candidate_list(symbol->enumerated_type_name, current_enumerated_spec_type);
+  symbol->enumerated_spec_init->accept(*this);
+  current_enumerated_spec_type = NULL;  
+  return NULL;
+}
+
+
+/* enumerated_specification ASSIGN enumerated_value */
+// SYM_REF2(enumerated_spec_init_c, enumerated_specification, enumerated_value)
+void *fill_candidate_datatypes_c::visit(enumerated_spec_init_c *symbol) {
+  /* If we are handling an anonymous datatype (i.e. a datatype implicitly declared inside a VAR ... END_VAR declaration)
+   * then the symbol->datatype has not yet been set by the previous visit(enumerated_spec_init_c) method!
+   */
+  if (NULL == current_enumerated_spec_type)
+    current_enumerated_spec_type = base_type(symbol);  
+  add_datatype_to_candidate_list(symbol, current_enumerated_spec_type);
+  symbol->enumerated_specification->accept(*this); /* calls enumerated_value_list_c (or identifier_c, which we ignore!) visit method */
+  current_enumerated_spec_type = NULL;  
+  if (NULL != symbol->enumerated_value) symbol->enumerated_value->accept(*this);
+  return NULL;
+}
+
+/* helper symbol for enumerated_specification->enumerated_spec_init */
+/* enumerated_value_list ',' enumerated_value */
+// SYM_LIST(enumerated_value_list_c)
+void *fill_candidate_datatypes_c::visit(enumerated_value_list_c *symbol) {
+  if (NULL == current_enumerated_spec_type) ERROR;  
+  add_datatype_to_candidate_list(symbol, current_enumerated_spec_type);
+  
+  /* We already know the datatype of the enumerated_value(s) in the list, so we set them directly instead of recursively calling the enumerated_value_c visit method! */
+  for(int i = 0; i < symbol->n; i++)
+    add_datatype_to_candidate_list(symbol->elements[i], current_enumerated_spec_type);
+
+  return NULL;  
+}
+
+
+/* enumerated_type_name '#' identifier */
+// SYM_REF2(enumerated_value_c, type, value)
+/* WARNING: The enumerated_value_c is used when delcaring an enumerated datatype
+ *          (e.g.   TYPE enumT: (xxx1, xxx2); END_TYPE ---> xxx1 and xxx2 will be enumerated_value_c)
+ *          as well as in the source code of POU bodies
+ *          (e.g.    enumVar := xxx1    ---> xxx1 will be enumerated_value_c)
+ *
+ *          The following method will only be used to visit enumerated_value_c that show up inside the 
+ *          source code of POU bodies (or the initial values of an enumerated type). When used inside an 
+ *          enumerated type declaration to list the possible enum values (whether inside
+ *          a TYPE ... END_TYPE, or inside a VAR .. END_VAR), the visitor method for enumerated_value_list_c
+ *          will NOT recursively call the following enumerated_value_c visitor method!
+ */
 void *fill_candidate_datatypes_c::visit(enumerated_value_c *symbol) {
-	symbol_c *enumerated_type;
-
-	if (NULL != symbol->type)
-		enumerated_type = symbol->type;
+	symbol_c *global_enumerated_type;
+	symbol_c *local_enumerated_type;
+	symbol_c *enumerated_type = NULL;
+
+	if (NULL != symbol->type) {
+		/* NOTE: This code must take into account the following situation:
+		 *
+		 *        TYPE  
+		 *           base_enum_t: (x1, x2, x3);
+		 *           enum_t1 : base_enum_t := x1;
+		 *           enum_t2 : base_enum_t := x2;
+		 *           enum_t12: enum_t1     := x2;
+		 *        END_TYPE
+		 *
+		 *     considering the above, ALL of the following are correct!
+		 *         base_enum_t#x1
+		 *             enum_t1#x1
+		 *             enum_t2#x1
+		 *            enum_t12#x1
+		 */
+		/* check whether the value really belongs to that datatype!! */
+		/* All local enum values are declared inside anonymous enumeration datatypes (i.e. inside a VAR ... END_VAR declaration, with
+		 * the enum type having no type name), so thay cannot possibly be referenced using a datatype_t#enumvalue syntax.
+		 * Because of this, we only look for the datatype identifier in the global enum value symbol table!
+		 */
+		enumerated_type = NULL;  // assume error...
+		enumerated_value_symtable_t::iterator lower = global_enumerated_value_symtable.lower_bound(symbol->value);
+		enumerated_value_symtable_t::iterator upper = global_enumerated_value_symtable.upper_bound(symbol->value);
+		for (; lower != upper; lower++)
+			if (get_datatype_info_c::is_type_equal(base_type(lower->second), base_type(symbol->type)))
+				enumerated_type = symbol->type; 
+	}
 	else {
-		enumerated_type = enumerated_value_symtable.find_value(symbol->value);
-		if (enumerated_type == enumerated_value_symtable.end_value())
-			enumerated_type = NULL;
+		symbol_c *global_enumerated_type = global_enumerated_value_symtable.find_value  (symbol->value);
+		symbol_c * local_enumerated_type =  local_enumerated_value_symtable.find_value  (symbol->value);
+		int       global_multiplicity    = global_enumerated_value_symtable.count(symbol->value);
+		int        local_multiplicity    =  local_enumerated_value_symtable.count(symbol->value);
+
+		if      (( local_multiplicity == 0) && (global_multiplicity == 0))
+		  enumerated_type = NULL; // not found!
+		else if (  local_multiplicity  > 1)
+			enumerated_type = NULL; // Local duplicate, so it is ambiguous!
+		else if (  local_multiplicity == 1)
+			enumerated_type = local_enumerated_type;
+		else if ( global_multiplicity  > 1)
+			enumerated_type = NULL; // Global duplicate, so it is ambiguous!
+		else if ( global_multiplicity == 1)
+			enumerated_type = global_enumerated_type;
+		else ERROR;
 	}
 	enumerated_type = base_type(enumerated_type);
 	if (NULL != enumerated_type)
@@ -627,6 +967,58 @@
 }
 
 
+/*  identifier ':' array_spec_init */
+// SYM_REF2(array_type_declaration_c, identifier, array_spec_init)
+
+/* array_specification [ASSIGN array_initialization} */
+/* array_initialization may be NULL ! */
+// SYM_REF2(array_spec_init_c, array_specification, array_initialization)
+
+/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+// SYM_REF2(array_specification_c, array_subrange_list, non_generic_type_name)
+
+/* helper symbol for array_specification */
+/* array_subrange_list ',' subrange */
+// SYM_LIST(array_subrange_list_c)
+
+/* array_initialization:  '[' array_initial_elements_list ']' */
+/* helper symbol for array_initialization */
+/* array_initial_elements_list ',' array_initial_elements */
+// SYM_LIST(array_initial_elements_list_c)
+
+/* integer '(' [array_initial_element] ')' */
+/* array_initial_element may be NULL ! */
+// SYM_REF2(array_initial_elements_c, integer, array_initial_element)
+
+/*  structure_type_name ':' structure_specification */
+// SYM_REF2(structure_type_declaration_c, structure_type_name, structure_specification)
+
+/* structure_type_name ASSIGN structure_initialization */
+/* structure_initialization may be NULL ! */
+// SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
+
+/* helper symbol for structure_declaration */
+/* structure_declaration:  STRUCT structure_element_declaration_list END_STRUCT */
+/* structure_element_declaration_list structure_element_declaration ';' */
+// SYM_LIST(structure_element_declaration_list_c)
+
+/*  structure_element_name ':' *_spec_init */
+// SYM_REF2(structure_element_declaration_c, structure_element_name, spec_init)
+
+/* helper symbol for structure_initialization */
+/* structure_initialization: '(' structure_element_initialization_list ')' */
+/* structure_element_initialization_list ',' structure_element_initialization */
+// SYM_LIST(structure_element_initialization_list_c)
+
+/*  structure_element_name ASSIGN value */
+// SYM_REF2(structure_element_initialization_c, structure_element_name, value)
+
+/*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+// SYM_REF4(string_type_declaration_c, string_type_name, elementary_string_type_name, string_type_declaration_size, string_type_declaration_init/* may be == NULL! */) 
+
+
+
+
 /*********************/
 /* B 1.4 - Variables */
 /*********************/
@@ -650,13 +1042,13 @@
 	 * if (symbol->value[1] == '\0') ERROR;
 	 */
 	switch (symbol->value[2]) {
-		case 'x': case 'X': /* bit   -  1 bit  */ add_datatype_to_candidate_list(symbol, &search_constant_type_c::bool_type_name);  break;
-		case 'b': case 'B': /* byte  -  8 bits */ add_datatype_to_candidate_list(symbol, &search_constant_type_c::byte_type_name);  break;
-		case 'w': case 'W': /* word  - 16 bits */ add_datatype_to_candidate_list(symbol, &search_constant_type_c::word_type_name);  break;
-		case 'd': case 'D': /* dword - 32 bits */ add_datatype_to_candidate_list(symbol, &search_constant_type_c::dword_type_name); break;
-		case 'l': case 'L': /* lword - 64 bits */ add_datatype_to_candidate_list(symbol, &search_constant_type_c::lword_type_name); break;
+		case 'x': case 'X': /* bit   -  1 bit  */ add_datatype_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name);  break;
+		case 'b': case 'B': /* byte  -  8 bits */ add_datatype_to_candidate_list(symbol, &get_datatype_info_c::byte_type_name);  break;
+		case 'w': case 'W': /* word  - 16 bits */ add_datatype_to_candidate_list(symbol, &get_datatype_info_c::word_type_name);  break;
+		case 'd': case 'D': /* dword - 32 bits */ add_datatype_to_candidate_list(symbol, &get_datatype_info_c::dword_type_name); break;
+		case 'l': case 'L': /* lword - 64 bits */ add_datatype_to_candidate_list(symbol, &get_datatype_info_c::lword_type_name); break;
         	          /* if none of the above, then the empty string was used <=> boolean */
-		default:                        add_datatype_to_candidate_list(symbol, &search_constant_type_c::bool_type_name);  break;
+		default:                        add_datatype_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name);  break;
 	}
 	return NULL;
 }
@@ -710,11 +1102,12 @@
 /******************************************/
 
 void *fill_candidate_datatypes_c::visit(var1_list_c *symbol) {
-#if 0   /* We don't really need to set the datatype of each variable. We just check the declaration itself! */
   for(int i = 0; i < symbol->n; i++) {
-    add_datatype_to_candidate_list(symbol->elements[i], search_varfb_instance_type->get_basetype_decl(symbol->elements[i])); /* will only add if non NULL */
+    /* We don't really need to set the datatype of each variable. We just check the declaration itself! 
+    add_datatype_to_candidate_list(symbol->elements[i], search_varfb_instance_type->get_basetype_decl(symbol->elements[i])); // will only add if non NULL 
+    */
+    symbol->elements[i]->accept(*this); // handle the extensible_input_parameter_c, etc...
   }
-#endif
   return NULL;
 }  
 
@@ -755,44 +1148,44 @@
 	for (unsigned int i = 0; i < symbol->direct_variable->candidate_datatypes.size(); i++) {
         	switch (get_sizeof_datatype_c::getsize(symbol->direct_variable->candidate_datatypes[i])) {
 			case  1: /* bit   -  1 bit  */
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::bool_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safebool_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::bool_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safebool_type_name);
 					break;
 			case  8: /* byte  -  8 bits */
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::byte_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safebyte_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::sint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safesint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::usint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safeusint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::byte_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safebyte_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::sint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safesint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::usint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safeusint_type_name);
 					break;
 			case 16: /* word  - 16 bits */
-	 				add_datatype_to_candidate_list(symbol, &search_constant_type_c::word_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safeword_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::int_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safeint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::uint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safeuint_type_name);
+	 				add_datatype_to_candidate_list(symbol, &get_datatype_info_c::word_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safeword_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::int_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safeint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::uint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safeuint_type_name);
 					break;
 			case 32: /* dword - 32 bits */
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::dword_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safedword_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::dint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safedint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::udint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safeudint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::real_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safereal_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::dword_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safedword_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::dint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safedint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::udint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safeudint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::real_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safereal_type_name);
 					break;
 			case 64: /* lword - 64 bits */
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::lword_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safelword_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::lint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safelint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::ulint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safeulint_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::lreal_type_name);
-					add_datatype_to_candidate_list(symbol, &search_constant_type_c::safelreal_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::lword_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safelword_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::lint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safelint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::ulint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safeulint_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::lreal_type_name);
+					add_datatype_to_candidate_list(symbol, &get_datatype_info_c::safelreal_type_name);
 					break;
 			default: /* if none of the above, then no valid datatype allowed... */
 					break;
@@ -828,11 +1221,16 @@
 /*********************/
 void *fill_candidate_datatypes_c::visit(function_declaration_c *symbol) {
 	if (debug) printf("Filling candidate data types list of function %s\n", ((token_c *)(symbol->derived_function_name))->value);
+	local_enumerated_value_symtable.reset();
+	symbol->var_declarations_list->accept(populate_enumvalue_symtable);
+
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
 	symbol->var_declarations_list->accept(*this);
 	symbol->function_body->accept(*this);
 	delete search_varfb_instance_type;
 	search_varfb_instance_type = NULL;
+
+	local_enumerated_value_symtable.reset();
 	return NULL;
 }
 
@@ -841,11 +1239,16 @@
 /***************************/
 void *fill_candidate_datatypes_c::visit(function_block_declaration_c *symbol) {
 	if (debug) printf("Filling candidate data types list of FB %s\n", ((token_c *)(symbol->fblock_name))->value);
+	local_enumerated_value_symtable.reset();
+	symbol->var_declarations->accept(populate_enumvalue_symtable);
+
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
 	symbol->var_declarations->accept(*this);
 	symbol->fblock_body->accept(*this);
 	delete search_varfb_instance_type;
 	search_varfb_instance_type = NULL;
+
+	local_enumerated_value_symtable.reset();
 	return NULL;
 }
 
@@ -854,11 +1257,16 @@
 /**********************/
 void *fill_candidate_datatypes_c::visit(program_declaration_c *symbol) {
 	if (debug) printf("Filling candidate data types list in program %s\n", ((token_c *)(symbol->program_type_name))->value);
+	local_enumerated_value_symtable.reset();
+	symbol->var_declarations->accept(populate_enumvalue_symtable);
+	
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
 	symbol->var_declarations->accept(*this);
 	symbol->function_block_body->accept(*this);
 	delete search_varfb_instance_type;
 	search_varfb_instance_type = NULL;
+
+	local_enumerated_value_symtable.reset();
 	return NULL;
 }
 
@@ -999,12 +1407,22 @@
 void *fill_candidate_datatypes_c::visit(il_expression_c *symbol) {
   symbol_c *prev_il_instruction_backup = prev_il_instruction;
   
-  if (NULL != symbol->il_operand)
-    symbol->il_operand->accept(*this);
+  /* Stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list if necessary. We can therefore ignore the 'il_operand' entry! */
+  // if (NULL != symbol->il_operand)
+  //   symbol->il_operand->accept(*this);
 
   if(symbol->simple_instr_list != NULL)
     symbol->simple_instr_list->accept(*this);
 
+  /* Since stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list when an 'il_operand' exists, we know
+   * that if (symbol->il_operand != NULL), then the first IL instruction in the simple_instr_list will be the equivalent and artificial
+   * 'LD <il_operand>' IL instruction.
+   * Just to be cosistent, we will copy the datatype info back into the il_operand, even though this should not be necessary!
+   */
+  if ((NULL != symbol->il_operand) && ((NULL == symbol->simple_instr_list) || (0 == ((list_c *)symbol->simple_instr_list)->n))) ERROR; // stage2 is not behaving as we expect it to!
+  if  (NULL != symbol->il_operand)
+    symbol->il_operand->candidate_datatypes = ((list_c *)symbol->simple_instr_list)->elements[0]->candidate_datatypes;
+  
   /* Now check the if the data type semantics of operation are correct,  */
   il_operand = symbol->simple_instr_list;
   prev_il_instruction = prev_il_instruction_backup;
@@ -1154,7 +1572,7 @@
 
 void *fill_candidate_datatypes_c::visit(LDN_operator_c *symbol) {
 	for(unsigned int i = 0; i < il_operand->candidate_datatypes.size(); i++) {
-		if      (is_ANY_BIT_compatible(il_operand->candidate_datatypes[i]))
+		if      (get_datatype_info_c::is_ANY_BIT_compatible(il_operand->candidate_datatypes[i]))
 			add_datatype_to_candidate_list(symbol, il_operand->candidate_datatypes[i]);
 	}
 	if (debug) std::cout << "LDN [" << il_operand->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
@@ -1169,7 +1587,7 @@
 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
 			operand_type = il_operand->candidate_datatypes[j];
-			if (is_type_equal(prev_instruction_type, operand_type))
+			if (get_datatype_info_c::is_type_equal(prev_instruction_type, operand_type))
 				add_datatype_to_candidate_list(symbol, prev_instruction_type);
 		}
 	}
@@ -1185,7 +1603,7 @@
 		for(unsigned int j = 0; j < il_operand->candidate_datatypes.size(); j++) {
 			prev_instruction_type = prev_il_instruction->candidate_datatypes[i];
 			operand_type = il_operand->candidate_datatypes[j];
-			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BIT_compatible(operand_type))
+			if (get_datatype_info_c::is_type_equal(prev_instruction_type,operand_type) && get_datatype_info_c::is_ANY_BIT_compatible(operand_type))
 				add_datatype_to_candidate_list(symbol, prev_instruction_type);
 		}
 	}
@@ -1202,7 +1620,7 @@
 	 */
 	if (NULL == prev_il_instruction) return NULL;
 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
-		if (is_ANY_BIT_compatible(prev_il_instruction->candidate_datatypes[i]))
+		if (get_datatype_info_c::is_ANY_BIT_compatible(prev_il_instruction->candidate_datatypes[i]))
 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
 	}
 	if (debug) std::cout <<  "NOT_operator [" << prev_il_instruction->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
@@ -1223,7 +1641,7 @@
 			 * the prev_instruction_type MUST be BOOL compatible.
 			 * I am not too sure about operand_type, does it have to be BOOL compatible, or can it be ANY_BIT compatible? Must check!
 			 */
-			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type))
+			if (get_datatype_info_c::is_type_equal(prev_instruction_type,operand_type) && get_datatype_info_c::is_BOOL_compatible(operand_type))
 				add_datatype_to_candidate_list(symbol, prev_instruction_type);
 		}
 	}
@@ -1245,7 +1663,7 @@
 			 * the prev_instruction_type MUST be BOOL compatible.
 			 * I am not too sure about operand_type, does it have to be BOOL compatible, or can it be ANY_BIT compatible? Must check!
 			 */
-			if (is_type_equal(prev_instruction_type,operand_type) && is_ANY_BOOL_compatible(operand_type))
+			if (get_datatype_info_c::is_type_equal(prev_instruction_type,operand_type) && get_datatype_info_c::is_BOOL_compatible(operand_type))
 				add_datatype_to_candidate_list(symbol, prev_instruction_type);
 		}
 	}
@@ -1288,7 +1706,7 @@
 void *fill_candidate_datatypes_c::handle_conditional_il_flow_control_operator(symbol_c *symbol) {
 	if (NULL == prev_il_instruction) return NULL;
 	for (unsigned int i = 0; i < prev_il_instruction->candidate_datatypes.size(); i++) {
-		if (is_ANY_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
+		if (get_datatype_info_c::is_BOOL_compatible(prev_il_instruction->candidate_datatypes[i]))
 			add_datatype_to_candidate_list(symbol, prev_il_instruction->candidate_datatypes[i]);
 	}
 	return NULL;
@@ -1318,45 +1736,23 @@
 /***********************/
 /* B 3.1 - Expressions */
 /***********************/
-void *fill_candidate_datatypes_c::visit(   or_expression_c  *symbol) {return handle_binary_expression(widen_OR_table,  symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(   xor_expression_c *symbol) {return handle_binary_expression(widen_XOR_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(   and_expression_c *symbol) {return handle_binary_expression(widen_AND_table, symbol, symbol->l_exp, symbol->r_exp);}
-
-void *fill_candidate_datatypes_c::visit(   equ_expression_c *symbol) {return handle_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(notequ_expression_c *symbol) {return handle_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(    lt_expression_c *symbol) {return handle_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(    gt_expression_c *symbol) {return handle_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(    le_expression_c *symbol) {return handle_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(    ge_expression_c *symbol) {return handle_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-
-
-/* The following code is correct when handling the addition of 2 symbolic_variables
- * In this case, adding two variables (e.g. USINT_var1 + USINT_var2) will always yield
- * the same data type, even if the result of the adition could not fit inside the same
- * data type (due to overflowing)
- *
- * However, when adding two literals (e.g. USINT#42 + USINT#3)
- * we should be able to detect overflows of the result, and therefore not consider
- * that the result may be of type USINT.
- * Currently we do not yet detect these overflows, and allow handling the sum of two USINTs
- * as always resulting in an USINT, even in the following expression
- * (USINT#65535 + USINT#2).
- *
- * In the future we can add some code to reduce
- * all the expressions that are based on literals into the resulting literal
- * value (maybe some visitor class that will run before or after data type
- * checking). Since this class will have to be very careful to make sure it implements the same mathematical
- * details (e.g. how to round and truncate numbers) as defined in IEC 61131-3, we will leave this to the future.
- * Also, the question will arise if we should also replace calls to standard
- * functions if the input parameters are all literals (e.g. ADD(42, 42)). This
- * means this class will be more difficult than it appears at first.
- */
-void *fill_candidate_datatypes_c::visit(  add_expression_c *symbol) {return handle_binary_expression(widen_ADD_table,  symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(  sub_expression_c *symbol) {return handle_binary_expression(widen_SUB_table,  symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(  mul_expression_c *symbol) {return handle_binary_expression(widen_MUL_table,  symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(  div_expression_c *symbol) {return handle_binary_expression(widen_DIV_table,  symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(  mod_expression_c *symbol) {return handle_binary_expression(widen_MOD_table,  symbol, symbol->l_exp, symbol->r_exp);}
-void *fill_candidate_datatypes_c::visit(power_expression_c *symbol) {return handle_binary_expression(widen_EXPT_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   or_expression_c  *symbol) {return handle_binary_expression  (widen_OR_table,  symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   xor_expression_c *symbol) {return handle_binary_expression  (widen_XOR_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   and_expression_c *symbol) {return handle_binary_expression  (widen_AND_table, symbol, symbol->l_exp, symbol->r_exp);}
+
+void *fill_candidate_datatypes_c::visit(   equ_expression_c *symbol) {return handle_equality_comparison(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(notequ_expression_c *symbol) {return handle_equality_comparison(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(    lt_expression_c *symbol) {return handle_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(    gt_expression_c *symbol) {return handle_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(    le_expression_c *symbol) {return handle_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(    ge_expression_c *symbol) {return handle_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+ 
+void *fill_candidate_datatypes_c::visit(   add_expression_c *symbol) {return handle_binary_expression  (widen_ADD_table,  symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   sub_expression_c *symbol) {return handle_binary_expression  (widen_SUB_table,  symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   mul_expression_c *symbol) {return handle_binary_expression  (widen_MUL_table,  symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   div_expression_c *symbol) {return handle_binary_expression  (widen_DIV_table,  symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit(   mod_expression_c *symbol) {return handle_binary_expression  (widen_MOD_table,  symbol, symbol->l_exp, symbol->r_exp);}
+void *fill_candidate_datatypes_c::visit( power_expression_c *symbol) {return handle_binary_expression  (widen_EXPT_table, symbol, symbol->l_exp, symbol->r_exp);}
 
 
 void *fill_candidate_datatypes_c::visit(neg_expression_c *symbol) {
@@ -1371,11 +1767,19 @@
    *
    *       However, this would then mean that the following ST code would be 
    *       syntactically and semantically correct:
+   *       VAR uint_var : UINT END_VAR;
    *       uint_var := - (uint_var);
    *
-   *       According to the standard, the above code should result in a 
-   *       runtime error, when we try to apply a negative value to the
-   *       UINT typed variable 'uint_var'.
+   *       Assuming uint_var is not 0, the standard states that the above code should result in a 
+   *       runtime error since the operation will result in an overflow. Since the above operation
+   *       is only valid when uint_var=0, it would probably make more sense for the programmer to
+   *       use if (uint_var=0) ..., so we will simply assume that the above statement simply
+   *       does not make sense in any situation (whether or not uint_var is 0), and therefore
+   *       we will not allow it.
+   *       (Notice that doing so does not ago against the standard, as the standard does not
+   *       explicitly define the semantics of the NEG operator, nor the data types it may accept
+   *       as input. We are simply assuming that the NEG operator may not be applied to unsigned
+   *       ANY_NUM data types!).
    *
    *       It is much easier for the compiler to detect this at compile time,
    *       and it is probably safer to the resulting code too.
@@ -1383,10 +1787,12 @@
    *       To detect these tyes of errors at compile time, the easisest solution
    *       is to only allow ANY_NUM datatytpes that are signed.
    *        So, that is what we do here!
+   *
+   * NOTE: The above argument also applies to the neg_integer_c method!
    */
 	symbol->exp->accept(*this);
 	for (unsigned int i = 0; i < symbol->exp->candidate_datatypes.size(); i++) {
-		if (is_ANY_signed_MAGNITUDE_compatible(symbol->exp->candidate_datatypes[i]))
+		if (get_datatype_info_c::is_ANY_signed_MAGNITUDE_compatible(symbol->exp->candidate_datatypes[i]))
 			add_datatype_to_candidate_list(symbol, symbol->exp->candidate_datatypes[i]);
 	}
 	if (debug) std::cout << "neg [" << symbol->exp->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
@@ -1397,7 +1803,7 @@
 void *fill_candidate_datatypes_c::visit(not_expression_c *symbol) {
 	symbol->exp->accept(*this);
 	for (unsigned int i = 0; i < symbol->exp->candidate_datatypes.size(); i++) {
-		if      (is_ANY_BIT_compatible(symbol->exp->candidate_datatypes[i]))
+		if      (get_datatype_info_c::is_ANY_BIT_compatible(symbol->exp->candidate_datatypes[i]))
 			add_datatype_to_candidate_list(symbol, symbol->exp->candidate_datatypes[i]);
 	}
 	if (debug) std::cout << "not [" << symbol->exp->candidate_datatypes.size() << "] ==> "  << symbol->candidate_datatypes.size() << " result.\n";
@@ -1411,14 +1817,15 @@
 	else ERROR;
 
 	generic_function_call_t fcall_param = {
-		/* fcall_param.function_name               = */ symbol->function_name,
-		/* fcall_param.nonformal_operand_list      = */ symbol->nonformal_param_list,
-		/* fcall_param.formal_operand_list         = */ symbol->formal_param_list,
-		/* enum {POU_FB, POU_function} POU_type    = */ generic_function_call_t::POU_function,
-		/* fcall_param.candidate_functions         = */ symbol->candidate_functions,
-		/* fcall_param.called_function_declaration = */ symbol->called_function_declaration,
-		/* fcall_param.extensible_param_count      = */ symbol->extensible_param_count
+			  function_name:                symbol->function_name,
+			  nonformal_operand_list:       symbol->nonformal_param_list,
+			  formal_operand_list:          symbol->formal_param_list,
+			  POU_type:                     generic_function_call_t::POU_function,
+			  candidate_functions:          symbol->candidate_functions,
+			  called_function_declaration:  symbol->called_function_declaration,
+			  extensible_param_count:       symbol->extensible_param_count
 	};
+
 	handle_function_call(symbol, fcall_param);
 
 	if (debug) std::cout << "function_invocation_c [" << symbol->candidate_datatypes.size() << "] result.\n";
@@ -1449,7 +1856,7 @@
 		for(unsigned int j = 0; j < symbol->r_exp->candidate_datatypes.size(); j++) {
 			left_type = symbol->l_exp->candidate_datatypes[i];
 			right_type = symbol->r_exp->candidate_datatypes[j];
-			if (is_type_equal(left_type, right_type))
+			if (get_datatype_info_c::is_type_equal(left_type, right_type))
 				add_datatype_to_candidate_list(symbol, left_type);
 		}
 	}
--- a/stage3/fill_candidate_datatypes.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/fill_candidate_datatypes.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -43,6 +43,10 @@
  *  The candidate datatype list will be filled with a list of all the data types that expression may legally take.
  *  For example, the very simple literal '0' (as in foo := 0), may represent a:
  *    BOOL, BYTE, WORD, DWORD, LWORD, USINT, SINT, UINT, INT, UDINT, DINT, ULINT, LINT (as well as the SAFE versions of these data tyes too!)
+ *
+ * WARNING: This visitor class starts off by building a map of all enumeration constants that are defined in the source code (i.e. a library_c symbol),
+ *          and this map is later used to determine the datatpe of each use of an enumeration constant. By implication, the fill_candidate_datatypes_c 
+ *          visitor class will only work corretly if it is asked to visit a symbol of class library_c!!
  */
 
 
@@ -53,7 +57,6 @@
 
   private:
     search_varfb_instance_type_c *search_varfb_instance_type;
-    search_base_type_c search_base_type;
     /* When calling a function block, we must first find it's type,
      * by searching through the declarations of the variables currently
      * in scope.
@@ -70,23 +73,11 @@
     //     search_var_instance_decl_c *search_var_instance_decl;
 
     /* This variable was created to pass information from
-     * fill_candidate_datatypes_c::visit(case_statement_c *symbol) function to
-     * fill_candidate_datatypes_c::visit(case_list_c *symbol) function.
+     * fill_candidate_datatypes_c::visit(enumerated_spec_init_c *symbol) function to
+     * fill_candidate_datatypes_c::visit(enumerated_value_list_c *symbol) function.
      */
-//     symbol_c *case_expression_type;
-
-    /* In IL code, once we find a type mismatch error, it is best to
-     * ignore any further errors until the end of the logical operation,
-     * i.e. until the next LD.
-     * However, we cannot clear the il_error flag on all LD operations,
-     * as these may also be used within parenthesis. LD operations
-     * within parenthesis may not clear the error flag.
-     * We therefore need a counter to know how deep inside a parenthesis
-     * structure we are.
-     */
-//     int  il_parenthesis_level;
-//     bool error_found;
-
+    symbol_c *current_enumerated_spec_type;
+    
     /* Pointer to the previous IL instruction, which contains the current data type (actually, the list of candidate data types) of the data stored in the IL stack, i.e. the default variable, a.k.a. accumulator */
     symbol_c *prev_il_instruction;
     /* the current IL operand being analyzed */
@@ -99,8 +90,9 @@
     bool  match_formal_call   (symbol_c *f_call, symbol_c *f_decl, symbol_c **first_param_datatype = NULL);
     void  handle_function_call(symbol_c *fcall, generic_function_call_t fcall_data);
     void *handle_implicit_il_fb_call(symbol_c *il_instruction, const char *param_name, symbol_c *&called_fb_declaration);
-    void *handle_binary_expression(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr);
-    void *handle_binary_operator  (const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr);
+    void *handle_equality_comparison(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr);
+    void *handle_binary_expression  (const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr);
+    void *handle_binary_operator    (const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr);
     void *handle_conditional_il_flow_control_operator(symbol_c *symbol);
     
     /* a helper function... */
@@ -117,6 +109,11 @@
     fill_candidate_datatypes_c(symbol_c *ignore);
     virtual ~fill_candidate_datatypes_c(void);
 
+    
+    /***************************/
+    /* B 0 - Programming Model */
+    /***************************/
+    void *visit(library_c *symbol);
 
     /*********************/
     /* B 1.2 - Constants */
@@ -170,11 +167,33 @@
     /********************************/
     /* B 1.3.3 - Derived data types */
     /********************************/
+//  void *visit(data_type_declaration_c *symbol);   /* Not required. already handled by iterator_visitor_c base class */
+//  void *visit(type_declaration_list_c *symbol);   /* Not required. already handled by iterator_visitor_c base class */
+//  void *visit(simple_type_declaration_c *symbol); /* Not required. already handled by iterator_visitor_c base class */
     void *visit(simple_spec_init_c *symbol);
+//  void *visit(subrange_type_declaration_c *symbol);
+//  void *visit(subrange_spec_init_c *symbol);
+//  void *visit(subrange_specification_c *symbol);
     void *visit(subrange_c *symbol);
-//  void *visit(data_type_declaration_c *symbol);
+    void *visit(enumerated_type_declaration_c *symbol);
+    void *visit(enumerated_spec_init_c *symbol);
+    void *visit(enumerated_value_list_c *symbol);
     void *visit(enumerated_value_c *symbol);
-
+//  void *visit(array_type_declaration_c *symbol);
+//  void *visit(array_spec_init_c *symbol);
+//  void *visit(array_specification_c *symbol);
+//  void *visit(array_subrange_list_c *symbol);
+//  void *visit(array_initial_elements_list_c *symbol);
+//  void *visit(array_initial_elements_c *symbol);
+//  void *visit(structure_type_declaration_c *symbol);
+//  void *visit(initialized_structure_c *symbol);
+//  void *visit(structure_element_declaration_list_c *symbol);
+//  void *visit(structure_element_declaration_c *symbol);
+//  void *visit(structure_element_initialization_list_c *symbol);
+//  void *visit(structure_element_initialization_c *symbol);
+//  void *visit(string_type_declaration_c *symbol);
+
+    
     /*********************/
     /* B 1.4 - Variables */
     /*********************/
--- a/stage3/flow_control_analysis.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/flow_control_analysis.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -123,12 +123,39 @@
 flow_control_analysis_c::flow_control_analysis_c(symbol_c *ignore) {
   prev_il_instruction = NULL;
   curr_il_instruction = NULL;
+  prev_il_instruction_is_JMP_or_RET = false;
+  search_il_label = NULL;
 }
 
 flow_control_analysis_c::~flow_control_analysis_c(void) {
 }
 
 
+void flow_control_analysis_c::link_insert(symbol_c *prev_instruction, symbol_c *next_instruction) {
+	il_instruction_c        *next_a = dynamic_cast<il_instruction_c        *>(next_instruction);
+	il_instruction_c        *prev_a = dynamic_cast<il_instruction_c        *>(prev_instruction);
+	il_simple_instruction_c *next_b = dynamic_cast<il_simple_instruction_c *>(next_instruction);
+	il_simple_instruction_c *prev_b = dynamic_cast<il_simple_instruction_c *>(prev_instruction);
+	
+	if       (NULL != next_a)  next_a->prev_il_instruction.insert(next_a->prev_il_instruction.begin(), prev_instruction);
+	else if  (NULL != next_b)  next_b->prev_il_instruction.insert(next_b->prev_il_instruction.begin(), prev_instruction);
+	else ERROR;
+	
+	if       (NULL != prev_a)  prev_a->next_il_instruction.insert(prev_a->next_il_instruction.begin(), next_instruction);
+	else if  (NULL != prev_b)  prev_b->next_il_instruction.insert(prev_b->next_il_instruction.begin(), next_instruction);
+	else ERROR;
+}
+
+
+void flow_control_analysis_c::link_pushback(symbol_c *prev_instruction, symbol_c *next_instruction) {
+	il_instruction_c *next = dynamic_cast<il_instruction_c *>(next_instruction);
+	il_instruction_c *prev = dynamic_cast<il_instruction_c *>(prev_instruction);
+	if ((NULL == next) || (NULL == prev)) ERROR;
+
+	next->prev_il_instruction.push_back(prev);
+	prev->next_il_instruction.push_back(next);
+}
+
 
 /************************************/
 /* B 1.5 Program organization units */
@@ -207,7 +234,7 @@
 		/* We try to guarantee that the previous il instruction that is in the previous line, will occupy the first element of the vector.
 		 * In order to do that, we use insert() instead of push_back()
 		 */
-		symbol->prev_il_instruction.insert(symbol->prev_il_instruction.begin() , prev_il_instruction);
+		link_insert(prev_il_instruction, symbol);
 
 	/* check if it is an il_expression_c, a JMP[C[N]], or a RET, and if so, handle it correctly */
 	prev_il_instruction_is_JMP_or_RET = false;
@@ -238,7 +265,9 @@
 		return NULL;
   
 	symbol_c *save_prev_il_instruction = prev_il_instruction;
-	prev_il_instruction = symbol->il_operand;
+	/* Stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list if necessary. We can therefore ignore the 'il_operand' entry! */
+	// prev_il_instruction = symbol->il_operand;
+	prev_il_instruction = NULL;
 	symbol->simple_instr_list->accept(*this);
 	prev_il_instruction = save_prev_il_instruction;
 	return NULL;
@@ -253,9 +282,8 @@
 
   /* give the visit(JMP_operator *) an oportunity to set the prev_il_instruction_is_JMP_or_RET flag! */
   symbol->il_jump_operator->accept(*this);
-  /* add, to that il_instruction's list of prev_il_intsructions, the curr_il_instruction */
   if (NULL != destination)
-    destination->prev_il_instruction.push_back(curr_il_instruction);
+    link_pushback(curr_il_instruction, destination);
   return NULL;
 }
 
@@ -295,7 +323,8 @@
 		/* We try to guarantee that the previous il instruction that is in the previous line, will occupy the first element of the vector.
 		 * In order to do that, we use insert() instead of push_back()
 		 */
-		symbol->prev_il_instruction.insert(symbol->prev_il_instruction.begin() , prev_il_instruction);
+		link_insert(prev_il_instruction, symbol);
+
 	return NULL;
 }
 
--- a/stage3/flow_control_analysis.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/flow_control_analysis.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -49,10 +49,14 @@
 
   private:
     search_il_label_c *search_il_label;
-    symbol_c *prev_il_instruction;
-    symbol_c *curr_il_instruction;
+    symbol_c          *prev_il_instruction;
+    symbol_c          *curr_il_instruction;
     bool      prev_il_instruction_is_JMP_or_RET;
 
+  private:
+    void link_insert  (symbol_c *prev_instruction, symbol_c *next_instruction);
+    void link_pushback(symbol_c *prev_instruction, symbol_c *next_instruction);
+
   public:
     flow_control_analysis_c(symbol_c *ignore);
     virtual ~flow_control_analysis_c(void);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/forced_narrow_candidate_datatypes.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,259 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2012  Mario de Sousa (msousa@fe.up.pt)
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ *  Data type analysis of IL code may leave some IL instructions with an undefined datatype.
+ *  This visitor will set the datatype for all these symbols, so that all symbols have a well 
+ *  defined datatype when we reach stage4.
+ *
+ *  Example:
+ * =========
+ *
+ *  VAR 
+ *     N   : INT := 99 ;    
+ *     tonv: TON;
+ *     byte_var: BYTE;
+ *     tonv : TON;
+ *     a : BYTE;
+ *     t : time;
+ *     tod1: tod;
+ *  END_VAR
+ *  
+ * (0) --> Data type before executing forced_narrow_candidate_datatypes_c
+ * (1) --> Data type after executing 1st pass of forced_narrow_candidate_datatypes_c
+ * (2) --> Data type after executing 2nd pass of forced_narrow_candidate_datatypes_c
+ * 
+ * --- --> NULL (undefined datatype)
+ * *** --> invalid_type_name_c (invalid datatype)
+ *
+ * (0)   PASS1   (1)    PASS2   (2)
+ *      
+ * ---     (e)   ***            ***       CAL tonv (                          
+ *                                               PT := T#1s                   
+ *                                            )                               
+ * ---     (e)   ***            ***       JMP l4                              
+ *
+ * ---     (e)   sint           sint  l0: LD  1                               
+ * ---     (e)   sint           sint      ADD 2                               
+ * ---  (c)      sint           sint      CAL tonv (                          
+ *                                            PT := T#1s                      
+ *                                            )                               
+ *                                                                            
+ * ---     (e)   sint           sint      LD  45                              
+ * ---  (c)      sint           sint      ADD 45                              
+ *
+ *
+ * ---     (e)   sint           sint      LD  3                               
+ * ---     (e)   sint           sint  l1:                                     
+ * ---  (c)      sint           sint  l2: ADD 4                               
+ * int           int            int       LD  5                               
+ * int           int            int       ST  n                               
+ * int           int            int       JMP l3                              
+ *                                                                            
+ * ---  (d)      ---      (e)   sint      LD  5                               
+ * ---  (d)      ---      (e)   sint      SUB 6                               
+ * ---  (d)(e)   sint           sint      JMP l1                              
+ *
+ * ---     (e)   bool           bool      LD  FALSE                           
+ * ---     (e)   bool           bool      NOT                                 
+ * ---  (b)      bool           bool      RET                                 
+ *
+ * int           int            int   l3:                                     
+ * int           int            int       ST  n                               
+ * ---  (b)      int            int       RET                                 
+ *
+ * ---     (e)   ***            ***   l4:                                     
+ * ---     (e)   ***            ***       CAL tonv (                          
+ *                                               PT := T#1s                   
+ *                                            )                               
+ * ---  (a)      ***            ***       JMP l0                              
+ * ---  (b)      byte           byte      LD  88                              
+ *
+ *
+ *   
+ */
+
+
+
+#include "forced_narrow_candidate_datatypes.hh"
+#include "datatype_functions.hh"
+
+
+/* set to 1 to see debug info during execution */
+static int debug = 0;
+
+forced_narrow_candidate_datatypes_c::forced_narrow_candidate_datatypes_c(symbol_c *ignore) 
+ :narrow_candidate_datatypes_c(ignore) {
+}
+
+forced_narrow_candidate_datatypes_c::~forced_narrow_candidate_datatypes_c(void) {
+}
+
+
+
+void forced_narrow_candidate_datatypes_c::forced_narrow_il_instruction(symbol_c *symbol, std::vector <symbol_c *> &next_il_instruction) {
+  if (NULL == symbol->datatype) {
+    if (symbol->candidate_datatypes.empty()) {
+      symbol->datatype = &(get_datatype_info_c::invalid_type_name); // This will occur in the situations (a) in the above example
+      // return NULL; // No need to return control to the visit() method of the base class... But we do so, just to be safe (called at the end of this function)!
+    } else {
+      if (next_il_instruction.empty()) {
+        symbol->datatype = symbol->candidate_datatypes[0]; // This will occur in the situations (b) in the above example
+      } else {
+        symbol_c *next_datatype = NULL;
+
+        /* find the datatype of the following IL instructions (they should all be identical by now, but we don't have an assertion checking for this. */
+        for (unsigned int i=0; i < next_il_instruction.size(); i++)
+          if (NULL != next_il_instruction[i]->datatype)
+            next_datatype = next_il_instruction[i]->datatype;
+        if (get_datatype_info_c::is_type_valid(next_datatype)) {
+          //  This will occur in the situations (c) in the above example
+          symbol->datatype = symbol->candidate_datatypes[0]; 
+        } else {
+          //  This will occur in the situations (d) in the above example
+          // it is not possible to determine the exact situation in the current pass, so we can't do anything just yet. Leave it for the next time around!
+        }
+      }
+    }
+  }
+}
+
+
+
+/****************************************/
+/* B.2 - Language IL (Instruction List) */
+/****************************************/
+/***********************************/
+/* B 2.1 Instructions and Operands */
+/***********************************/
+
+/*| instruction_list il_instruction */
+// SYM_LIST(instruction_list_c)
+void *forced_narrow_candidate_datatypes_c::visit(instruction_list_c *symbol) {
+  for(int j = 0; j < 2; j++) {
+    for(int i = symbol->n-1; i >= 0; i--) {
+      symbol->elements[i]->accept(*this);
+    }
+  }
+
+  /* Assert that this algorithm managed to remove all NULL datatypes! */
+  /* NOTE: The forced_narrow_candidate_datatypes_c assumes that the original IEC 61131-3 source code does not have any bugs!
+   *       This means we cannot run this assertion here, as the compiler will bork in the presence of bug in the code being compiled! Not good!!
+   */
+  /*
+  for(int i = symbol->n-1; i >= 0; i--) {
+    if (NULL == symbol->elements[i]->datatype)
+      ERROR;
+  }
+  */
+  
+  return NULL;
+}
+
+
+  
+/* | label ':' [il_incomplete_instruction] eol_list */
+// SYM_REF2(il_instruction_c, label, il_instruction)
+// void *visit(instruction_list_c *symbol);
+void *forced_narrow_candidate_datatypes_c::visit(il_instruction_c *symbol) {
+  forced_narrow_il_instruction(symbol, symbol->next_il_instruction);
+  
+  /* return control to the visit() method of the base class! */
+  return narrow_candidate_datatypes_c::visit(symbol);  //  This handles the situations (e) in the above example
+}
+
+
+
+
+
+/* | il_simple_operator [il_operand] */
+// SYM_REF2(il_simple_operation_c, il_simple_operator, il_operand)
+// void *forced_narrow_candidate_datatypes_c::visit(il_simple_operation_c *symbol)
+
+/* | function_name [il_operand_list] */
+/* NOTE: The parameters 'called_function_declaration' and 'extensible_param_count' are used to pass data between the stage 3 and stage 4. */
+// SYM_REF2(il_function_call_c, function_name, il_operand_list, symbol_c *called_function_declaration; int extensible_param_count;)
+// void *forced_narrow_candidate_datatypes_c::visit(il_function_call_c *symbol) 
+
+/* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
+// SYM_REF3(il_expression_c, il_expr_operator, il_operand, simple_instr_list);
+// void *forced_narrow_candidate_datatypes_c::visit(il_expression_c *symbol)
+
+/*  il_jump_operator label */
+// SYM_REF2(il_jump_operation_c, il_jump_operator, label)
+// void *forced_narrow_candidate_datatypes_c::visit(il_jump_operation_c *symbol)
+
+/*   il_call_operator prev_declared_fb_name
+ * | il_call_operator prev_declared_fb_name '(' ')'
+ * | il_call_operator prev_declared_fb_name '(' eol_list ')'
+ * | il_call_operator prev_declared_fb_name '(' il_operand_list ')'
+ * | il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')'
+ */
+/* NOTE: The parameter 'called_fb_declaration'is used to pass data between stage 3 and stage4 (although currently it is not used in stage 4 */
+// SYM_REF4(il_fb_call_c, il_call_operator, fb_name, il_operand_list, il_param_list, symbol_c *called_fb_declaration)
+// void *forced_narrow_candidate_datatypes_c::visit(il_fb_call_c *symbol)
+
+/* | function_name '(' eol_list [il_param_list] ')' */
+/* NOTE: The parameter 'called_function_declaration' is used to pass data between the stage 3 and stage 4. */
+// SYM_REF2(il_formal_funct_call_c, function_name, il_param_list, symbol_c *called_function_declaration; int extensible_param_count;)
+// void *forced_narrow_candidate_datatypes_c::visit(il_formal_funct_call_c *symbol)
+
+// void *visit(il_operand_list_c *symbol);
+// void *forced_narrow_candidate_datatypes_c::visit(simple_instr_list_c *symbol)
+
+// SYM_REF1(il_simple_instruction_c, il_simple_instruction, symbol_c *prev_il_instruction;)
+void *forced_narrow_candidate_datatypes_c::visit(il_simple_instruction_c*symbol) {
+  forced_narrow_il_instruction(symbol, symbol->next_il_instruction);
+  
+  /* return control to the visit() method of the base class! */
+  return narrow_candidate_datatypes_c::visit(symbol);  //  This handle the situations (e) in the above example
+}
+
+
+/*
+    void *visit(il_param_list_c *symbol);
+    void *visit(il_param_assignment_c *symbol);
+    void *visit(il_param_out_assignment_c *symbol);
+ */
+
+
+
+/***************************************/
+/* B.3 - Language ST (Structured Text) */
+/***************************************/
+// SYM_LIST(statement_list_c)
+/* The normal narrow_candidate_datatypes_c algorithm does not leave any symbol, in an ST code, with an undefined datatype.
+ * There is therefore no need to re-run the narrow algorithm here, so we overide the narrow_candidate_datatypes_c visitor,
+ * and simply bug out!
+ */
+void *forced_narrow_candidate_datatypes_c::visit(statement_list_c *symbol) {return NULL;}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage3/forced_narrow_candidate_datatypes.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,91 @@
+/*
+ *  matiec - a compiler for the programming languages defined in IEC 61131-3
+ *
+ *  Copyright (C) 2012  Mario de Sousa (msousa@fe.up.pt)
+ *
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * This code is made available on the understanding that it will not be
+ * used in safety-critical situations without a full and competent review.
+ */
+
+/*
+ * An IEC 61131-3 compiler.
+ *
+ * Based on the
+ * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
+ *
+ */
+
+
+/*
+ *  forced_narrow_candidate_datatypes_c
+ *
+ */
+
+
+
+#include "../absyntax_utils/absyntax_utils.hh"
+#include "narrow_candidate_datatypes.hh"
+
+
+
+class forced_narrow_candidate_datatypes_c: public narrow_candidate_datatypes_c {
+
+  private:
+    void forced_narrow_il_instruction(symbol_c *symbol, std::vector <symbol_c *> &next_il_instruction);
+    
+  public:
+    forced_narrow_candidate_datatypes_c(symbol_c *ignore);
+    virtual ~forced_narrow_candidate_datatypes_c(void);
+   
+    /****************************************/
+    /* B.2 - Language IL (Instruction List) */
+    /****************************************/
+    /***********************************/
+    /* B 2.1 Instructions and Operands */
+    /***********************************/
+    void *visit(instruction_list_c *symbol);
+    void *visit(il_instruction_c *symbol);
+//  void *visit(il_simple_operation_c *symbol);
+//  void *visit(il_function_call_c *symbol);
+//  void *visit(il_expression_c *symbol);
+//  void *visit(il_jump_operation_c *symbol);
+//  void *visit(il_fb_call_c *symbol);
+//  void *visit(il_formal_funct_call_c *symbol);
+//  void *visit(il_operand_list_c *symbol);
+//  void *visit(simple_instr_list_c *symbol);
+    void *visit(il_simple_instruction_c*symbol);
+//  void *visit(il_param_list_c *symbol);
+//  void *visit(il_param_assignment_c *symbol);
+//  void *visit(il_param_out_assignment_c *symbol);
+//  void *visit(il_assign_operator_c *symbol);
+//  void *visit(il_assign_operator_c *symbol);
+ 
+    /***************************************/
+    /* B.3 - Language ST (Structured Text) */
+    /***************************************/
+    void *visit(statement_list_c *symbol);
+}; // forced_narrow_candidate_datatypes_c
+
+
+
+
+
+
+
+
+
--- a/stage3/lvalue_check.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/lvalue_check.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -73,6 +73,8 @@
 	error_count = 0;
 	current_display_error_level = 0;
 	current_il_operand = NULL;
+	search_varfb_instance_type = NULL;
+	search_var_instance_decl = NULL;
 }
 
 lvalue_check_c::~lvalue_check_c(void) {
@@ -105,7 +107,6 @@
  */
 void lvalue_check_c::check_assignment_to_output(symbol_c *lvalue) {
 	decompose_var_instance_name_c decompose_lvalue(lvalue);
-	search_base_type_c            search_base_type;
 
 	/* Get the first element/record of the potentially structured variable symbol */
 	/* Note that if symbol is pointing to an expression (or simply a literal value), it will return a NULL.
@@ -118,7 +119,7 @@
 	
 	symbol_c *type_decl   = search_var_instance_decl->get_decl(struct_elem);
 	// symbol_c *type_id  = spec_init_sperator_c::get_spec(type_decl); /* this is not required! search_base_type_c can handle spec_init symbols! */
-	symbol_c *basetype_id = search_base_type.get_basetype_id(/*type_id*/ type_decl);
+	symbol_c *basetype_id = search_base_type_c::get_basetype_id(/*type_id*/ type_decl);
 	/* If we can not determine the data type of the element, then the code must have a data type semantic error.
 	 * This will have been caught by the data type semantic verifier, so we do not bother with this anymore!
 	 */
@@ -143,7 +144,7 @@
 
 		/* prepare for any possible further record/structure elements */
 		type_decl   = fb_search_var_instance_decl.get_decl(struct_elem);
-		basetype_id = search_base_type.get_basetype_id(type_decl);
+		basetype_id = search_base_type_c::get_basetype_id(type_decl);
 		if (NULL == basetype_id) return; /* same comment as above... */
 		fb_decl = function_block_type_symtable.find_value(basetype_id);
 		if (function_block_type_symtable.end_value() == fb_decl) return; /* same comment as above... */
--- a/stage3/lvalue_check.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/lvalue_check.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -50,7 +50,6 @@
   private:
     search_varfb_instance_type_c *search_varfb_instance_type;
     search_var_instance_decl_c *search_var_instance_decl;
-    search_base_type_c search_base_type;
     int error_count;
     int current_display_error_level;
     std::vector <token_c *> control_variables;
--- a/stage3/narrow_candidate_datatypes.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/narrow_candidate_datatypes.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -66,6 +66,10 @@
 static int debug = 0;
 
 narrow_candidate_datatypes_c::narrow_candidate_datatypes_c(symbol_c *ignore) {
+	search_varfb_instance_type = NULL;
+	fake_prev_il_instruction = NULL;
+	current_il_instruction   = NULL;
+	il_operand = NULL;
 }
 
 narrow_candidate_datatypes_c::~narrow_candidate_datatypes_c(void) {
@@ -85,15 +89,15 @@
 	if ((NULL == datatype) && (NULL == symbol->datatype)) return;
 	
 	if (search_in_candidate_datatype_list(datatype, symbol->candidate_datatypes) < 0)
-		symbol->datatype = &(search_constant_type_c::invalid_type_name);   
+		symbol->datatype = &(get_datatype_info_c::invalid_type_name);   
 	else {
 		if (NULL == symbol->datatype)   
 			/* not yet set to anything, so we set it to the requested data type */
 			symbol->datatype = datatype; 
 		else {
 			/* had already been set previously to some data type. Let's check if they are the same! */
-			if (!is_type_equal(symbol->datatype, datatype))
-				symbol->datatype = &(search_constant_type_c::invalid_type_name);
+			if (!get_datatype_info_c::is_type_equal(symbol->datatype, datatype))
+				symbol->datatype = &(get_datatype_info_c::invalid_type_name);
 // 			else 
 				/* we leave it unchanged, as it is the same as the requested data type! */
 		}
@@ -269,7 +273,7 @@
 
 	/* set the called_function_declaration taking into account the datatype that we need to return */
 	for(unsigned int i = 0; i < fcall->candidate_datatypes.size(); i++) {
-		if (is_type_equal(fcall->candidate_datatypes[i], fcall->datatype)) {
+		if (get_datatype_info_c::is_type_equal(fcall->candidate_datatypes[i], fcall->datatype)) {
 			fcall_data.called_function_declaration = fcall_data.candidate_functions[i];
 			break;
 		}
@@ -394,10 +398,10 @@
 	 *     FB call for any datatype. In that case, then the datatype required to pass to the first parameter of the
 	 *     FB call must be left unchanged!
 	 */
-	if ((NULL == il_instruction->datatype) || (is_type_equal(param_value.datatype, il_instruction->datatype))) {
+	if ((NULL == il_instruction->datatype) || (get_datatype_info_c::is_type_equal(param_value.datatype, il_instruction->datatype))) {
 		set_datatype_in_prev_il_instructions(param_value.datatype, fake_prev_il_instruction);
 	} else {
-		set_datatype_in_prev_il_instructions(&search_constant_type_c::invalid_type_name, fake_prev_il_instruction);
+		set_datatype_in_prev_il_instructions(&get_datatype_info_c::invalid_type_name, fake_prev_il_instruction);
 	}
 	return NULL;
 }
@@ -405,23 +409,86 @@
 
 /* a helper function... */
 symbol_c *narrow_candidate_datatypes_c::base_type(symbol_c *symbol) {
-	/* NOTE: symbol == NULL is valid. It will occur when, for e.g., an undefined/undeclared symbolic_variable is used
-	 *       in the code.
-	 */
+	/* NOTE: symbol == NULL is valid. It will occur when, for e.g., an undefined/undeclared symbolic_variable is used in the code. */
 	if (symbol == NULL) return NULL;
-	return (symbol_c *)symbol->accept(search_base_type);	
-}
-
-/*********************/
-/* B 1.2 - Constants */
-/*********************/
+	return search_base_type_c::get_basetype_decl(symbol);
+}
+
+
+
 
 /**********************/
 /* B 1.3 - Data types */
 /**********************/
+/***********************************/
+/* B 1.3.1 - Elementary Data Types */
+/***********************************/
+/* NOTE: elementary datatypes are their own basetype ! */
+void *narrow_candidate_datatypes_c::visit(    time_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    bool_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    sint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    int_type_name_c     *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    dint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    lint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    usint_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    uint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    udint_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    ulint_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    real_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    lreal_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    date_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    tod_type_name_c     *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    dt_type_name_c      *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    byte_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    word_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    dword_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    lword_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    string_type_name_c  *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(    wstring_type_name_c *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+
+void *narrow_candidate_datatypes_c::visit(safetime_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safebool_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safesint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safeint_type_name_c     *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safedint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safelint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safeusint_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safeuint_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safeudint_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safeulint_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safereal_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safelreal_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safedate_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safetod_type_name_c     *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safedt_type_name_c      *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safebyte_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safeword_type_name_c    *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safedword_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safelword_type_name_c   *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safestring_type_name_c  *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+void *narrow_candidate_datatypes_c::visit(safewstring_type_name_c *symbol) {symbol->datatype = search_base_type_c::get_basetype_decl(symbol); return NULL;} 
+
+
+/********************************/
+/* B.1.3.2 - Generic data types */
+/********************************/
+/* empty!! */
+
 /********************************/
 /* B 1.3.3 - Derived data types */
 /********************************/
+/*  TYPE type_declaration_list END_TYPE */
+// SYM_REF1(data_type_declaration_c, type_declaration_list)
+/* NOTE: Not required. already handled by iterator_visitor_c base class */
+
+/* helper symbol for data_type_declaration */
+// SYM_LIST(type_declaration_list_c)
+/* NOTE: Not required. already handled by iterator_visitor_c base class */
+
+/*  simple_type_name ':' simple_spec_init */
+// SYM_REF2(simple_type_declaration_c, simple_type_name, simple_spec_init)
+/* NOTE: Not required. already handled by iterator_visitor_c base class */
+
 /* simple_specification ASSIGN constant */
 // SYM_REF2(simple_spec_init_c, simple_specification, constant)
 void *narrow_candidate_datatypes_c::visit(simple_spec_init_c *symbol) {
@@ -439,9 +506,18 @@
 }
 
 
+/*  subrange_type_name ':' subrange_spec_init */
+// SYM_REF2(subrange_type_declaration_c, subrange_type_name, subrange_spec_init)
+
+/* subrange_specification ASSIGN signed_integer */
+// SYM_REF2(subrange_spec_init_c, subrange_specification, signed_integer)
+
+/*  integer_type_name '(' subrange')' */
+// SYM_REF2(subrange_specification_c, integer_type_name, subrange)
 
 /*  signed_integer DOTDOT signed_integer */
-// SYM_REF2(subrange_c, lower_limit, upper_limit)
+/* dimension will be filled in during stage 3 (array_range_check_c) with the number of elements in this subrange */
+// SYM_REF2(subrange_c, lower_limit, upper_limit, unsigned long long int dimension;)
 void *narrow_candidate_datatypes_c::visit(subrange_c *symbol) {
 	symbol->lower_limit->datatype = symbol->datatype;
 	symbol->lower_limit->accept(*this);
@@ -451,6 +527,112 @@
 }
 
 
+/*  enumerated_type_name ':' enumerated_spec_init */
+// SYM_REF2(enumerated_type_declaration_c, enumerated_type_name, enumerated_spec_init)
+void *narrow_candidate_datatypes_c::visit(enumerated_type_declaration_c *symbol) {
+  if (symbol->candidate_datatypes.size() != 1) ERROR;
+  
+  symbol->datatype = symbol->candidate_datatypes[0];
+  set_datatype(symbol->datatype, symbol->enumerated_type_name);
+  set_datatype(symbol->datatype, symbol->enumerated_spec_init);
+  
+  symbol->enumerated_spec_init->accept(*this);
+  return NULL;
+}
+
+
+/* enumerated_specification ASSIGN enumerated_value */
+// SYM_REF2(enumerated_spec_init_c, enumerated_specification, enumerated_value)
+void *narrow_candidate_datatypes_c::visit(enumerated_spec_init_c *symbol) {
+  /* If we are handling an anonymous datatype (i.e. a datatype implicitly declared inside a VAR ... END_VAR declaration)
+   * then the symbol->datatype has not yet been set by the previous visit(enumerated_spec_init_c) method!
+   */
+  if (NULL == symbol->datatype) {
+    if (symbol->candidate_datatypes.size() != 1) ERROR;
+    symbol->datatype = symbol->candidate_datatypes[0];
+  }
+  set_datatype(symbol->datatype, symbol->enumerated_specification);
+  if (NULL != symbol->enumerated_value) 
+    set_datatype(symbol->datatype, symbol->enumerated_value);
+
+  symbol->enumerated_specification->accept(*this); /* calls enumerated_value_list_c (or identifier_c, which we ignore!) visit method */
+  return NULL;
+}
+
+/* helper symbol for enumerated_specification->enumerated_spec_init */
+/* enumerated_value_list ',' enumerated_value */
+// SYM_LIST(enumerated_value_list_c)
+void *narrow_candidate_datatypes_c::visit(enumerated_value_list_c *symbol) {
+  if (NULL == symbol->datatype) ERROR;
+  
+  for(int i = 0; i < symbol->n; i++) {
+    /* the enumerated_value_c objects to which this list points to has both the datatype and the candidate_datatype_list filled in, so we 
+     * call set_datatype() instead of setting the datatype directly!
+     */
+    set_datatype(symbol->datatype, symbol->elements[i]);
+    if (NULL == symbol->elements[i]->datatype) ERROR;
+  }
+  return NULL;  
+}
+
+
+/* enumerated_type_name '#' identifier */
+// SYM_REF2(enumerated_value_c, type, value)
+// void *narrow_candidate_datatypes_c::visit(enumerated_value_c *symbol) {/* do nothing! */ return NULL;}
+
+
+/*  identifier ':' array_spec_init */
+// SYM_REF2(array_type_declaration_c, identifier, array_spec_init)
+
+/* array_specification [ASSIGN array_initialization} */
+/* array_initialization may be NULL ! */
+// SYM_REF2(array_spec_init_c, array_specification, array_initialization)
+
+/* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
+// SYM_REF2(array_specification_c, array_subrange_list, non_generic_type_name)
+
+/* helper symbol for array_specification */
+/* array_subrange_list ',' subrange */
+// SYM_LIST(array_subrange_list_c)
+
+/* array_initialization:  '[' array_initial_elements_list ']' */
+/* helper symbol for array_initialization */
+/* array_initial_elements_list ',' array_initial_elements */
+// SYM_LIST(array_initial_elements_list_c)
+
+/* integer '(' [array_initial_element] ')' */
+/* array_initial_element may be NULL ! */
+// SYM_REF2(array_initial_elements_c, integer, array_initial_element)
+
+/*  structure_type_name ':' structure_specification */
+// SYM_REF2(structure_type_declaration_c, structure_type_name, structure_specification)
+
+/* structure_type_name ASSIGN structure_initialization */
+/* structure_initialization may be NULL ! */
+// SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
+
+/* helper symbol for structure_declaration */
+/* structure_declaration:  STRUCT structure_element_declaration_list END_STRUCT */
+/* structure_element_declaration_list structure_element_declaration ';' */
+// SYM_LIST(structure_element_declaration_list_c)
+
+/*  structure_element_name ':' *_spec_init */
+// SYM_REF2(structure_element_declaration_c, structure_element_name, spec_init)
+
+/* helper symbol for structure_initialization */
+/* structure_initialization: '(' structure_element_initialization_list ')' */
+/* structure_element_initialization_list ',' structure_element_initialization */
+// SYM_LIST(structure_element_initialization_list_c)
+
+/*  structure_element_name ASSIGN value */
+// SYM_REF2(structure_element_initialization_c, structure_element_name, value)
+
+/*  string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */
+// SYM_REF4(string_type_declaration_c, string_type_name, elementary_string_type_name, string_type_declaration_size, string_type_declaration_init/* may be == NULL! */) 
+
+
+
+
 /*********************/
 /* B 1.4 - Variables */
 /*********************/
@@ -476,7 +658,7 @@
 void *narrow_candidate_datatypes_c::visit(subscript_list_c *symbol) {
 	for (int i = 0; i < symbol->n; i++) {
 		for (unsigned int k = 0; k < symbol->elements[i]->candidate_datatypes.size(); k++) {
-			if (is_ANY_INT_type(symbol->elements[i]->candidate_datatypes[k]))
+			if (get_datatype_info_c::is_ANY_INT(symbol->elements[i]->candidate_datatypes[k]))
 				symbol->elements[i]->datatype = symbol->elements[i]->candidate_datatypes[k];
 		}
 		symbol->elements[i]->accept(*this);
@@ -534,6 +716,10 @@
 /* B 1.5.1 Functions */
 /*********************/
 void *narrow_candidate_datatypes_c::visit(function_declaration_c *symbol) {
+	/* set the function_declaration_c->datatype to the datatype returned by the function! */
+	symbol->type_name->datatype = search_base_type_c::get_basetype_decl(symbol->type_name);
+	symbol->datatype = symbol->type_name->datatype;
+	
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
 	symbol->var_declarations_list->accept(*this);
 	if (debug) printf("Narrowing candidate data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value);
@@ -632,9 +818,11 @@
 		intersect_prev_candidate_datatype_lists(&tmp_prev_il_instruction);
 		/* Tell the il_instruction the datatype that it must generate - this was chosen by the next il_instruction (remember: we are iterating backwards!) */
 		fake_prev_il_instruction = &tmp_prev_il_instruction;
+		current_il_instruction   = symbol;
 		symbol->il_instruction->datatype = symbol->datatype;
 		symbol->il_instruction->accept(*this);
 		fake_prev_il_instruction = NULL;
+		current_il_instruction   = NULL;
 	}
 	return NULL;
 }
@@ -713,6 +901,16 @@
   il_instruction_c *save_fake_prev_il_instruction = fake_prev_il_instruction; /*this is not really necessary, but lets play it safe */
   symbol->simple_instr_list->accept(*this);
   fake_prev_il_instruction = save_fake_prev_il_instruction;
+  
+  /* Since stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list when an 'il_operand' exists, we know
+   * that if (symbol->il_operand != NULL), then the first IL instruction in the simple_instr_list will be the equivalent and artificial
+   * 'LD <il_operand>' IL instruction.
+   * Just to be consistent, we will copy the datatype info back into the il_operand, even though this should not be necessary!
+   */
+  if ((NULL != symbol->il_operand) && ((NULL == symbol->simple_instr_list) || (0 == ((list_c *)symbol->simple_instr_list)->n))) ERROR; // stage2 is not behaving as we expect it to!
+  if  (NULL != symbol->il_operand)
+    symbol->il_operand->datatype = ((list_c *)symbol->simple_instr_list)->elements[0]->datatype;
+  
   return NULL;
 }
 
@@ -857,15 +1055,17 @@
 				set_datatype_in_prev_il_instructions(prev_instruction_type, fake_prev_il_instruction);
 				/* set the datatype for the operand */
 				il_operand->datatype = operand_type;
+				il_operand->accept(*this);
 				
-				count ++;
+				/* NOTE: DO NOT search any further! Return immediately!
+				 * Since we support SAFE*** datatypes, multiple entries in the widen_table may be compatible.
+				 * If we try to set more than one distinct datatype on the same symbol, then the datatype will be set to
+				 * an invalid_datatype, which is NOT what we want!
+				 */
+				return NULL;
 			}
 		}
 	}
-// 	if (count > 1) ERROR; /* Since we also support SAFE data types, this assertion is not necessarily always tru! */
-	if (is_type_valid(symbol->datatype) && (count <= 0)) ERROR;
-
-	il_operand->accept(*this);
 	return NULL;
 }
 
@@ -934,6 +1134,10 @@
 	il_operand->accept(*this);
 	/* set the desired datatype of the previous il instruction */
 	set_datatype_in_prev_il_instructions(symbol->datatype, fake_prev_il_instruction);
+	/* In the case of the ST operator, we must set the datatype of the il_instruction_c object that points to this ST_operator_c ourselves,
+	 * since the following il_instruction_c objects have not done it, as is normal/standard for other instructions!
+	 */
+	current_il_instruction->datatype = symbol->datatype;
 	return NULL;
 }
 
@@ -1005,7 +1209,7 @@
 	/* if the next IL instructions needs us to provide a datatype other than a bool, 
 	 * then we have an internal compiler error - most likely in fill_candidate_datatypes_c 
 	 */
-	if ((NULL != symbol->datatype) && (!is_ANY_BOOL_compatible(symbol->datatype))) ERROR;
+	if ((NULL != symbol->datatype) && (!get_datatype_info_c::is_BOOL_compatible(symbol->datatype))) ERROR;
 	if (symbol->candidate_datatypes.size() > 1) ERROR;
 
 	/* NOTE: If there is no IL instruction following this CALC, CALCN, JMPC, JMPC, ..., instruction,
@@ -1014,7 +1218,7 @@
 	 */
 	if (symbol->candidate_datatypes.size() == 0)    symbol->datatype = NULL;
 	else    symbol->datatype = symbol->candidate_datatypes[0]; /* i.e. a bool_type_name_c! */
-	if ((NULL != symbol->datatype) && (!is_ANY_BOOL_compatible(symbol->datatype))) ERROR;
+	if ((NULL != symbol->datatype) && (!get_datatype_info_c::is_BOOL_compatible(symbol->datatype))) ERROR;
 
 	/* set the required datatype of the previous IL instruction, i.e. a bool_type_name_c! */
 	set_datatype_in_prev_il_instructions(symbol->datatype, fake_prev_il_instruction);
@@ -1050,11 +1254,18 @@
 /***********************/
 /* B 3.1 - Expressions */
 /***********************/
-void *narrow_candidate_datatypes_c::narrow_binary_expression(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool *deprecated_operation) {
+/* allow_enums is FALSE by default!!
+ * deprecated_operation is NULL by default!!
+ * if (allow_enums) then consider that we are ectually processing an equ_expression or notequ_expression, where two enums of the same data type may also be legally compared 
+ *  e.g.      symbol := l_expr == r_expr              
+ *            symbol := l_expr != r_expr
+ *  In the above situation it is a legal operation when (l_expr.datatype == r_expr.datatype) && is_enumerated(r/l_expr.datatype) && is_bool(symbol.datatype)
+ */
+void *narrow_candidate_datatypes_c::narrow_binary_expression(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool *deprecated_operation, bool allow_enums) {
 	symbol_c *l_type, *r_type;
 	int count = 0;
 
-        if (NULL != deprecated_operation)
+	if (NULL != deprecated_operation)
 		*deprecated_operation = false;
 
 	for(unsigned int i = 0; i < l_expr->candidate_datatypes.size(); i++) {
@@ -1062,15 +1273,21 @@
 			/* test widening compatibility */
 			l_type = l_expr->candidate_datatypes[i];
 			r_type = r_expr->candidate_datatypes[j];
-			if (is_widening_compatible(widen_table, l_type, r_type, symbol->datatype, deprecated_operation)) {
+			if        (is_widening_compatible(widen_table, l_type, r_type, symbol->datatype, deprecated_operation)) {
+				l_expr->datatype = l_type;
+				r_expr->datatype = r_type;
+				count ++;
+			} else if ((l_type == r_type) && search_base_type_c::type_is_enumerated(l_type) && get_datatype_info_c::is_BOOL_compatible(symbol->datatype)) {
+				if (NULL != deprecated_operation)  *deprecated_operation = false;
 				l_expr->datatype = l_type;
 				r_expr->datatype = r_type;
 				count ++;
 			}
+			  
 		}
 	}
 // 	if (count > 1) ERROR; /* Since we also support SAFE data types, this assertion is not necessarily always tru! */
-	if (is_type_valid(symbol->datatype) && (count <= 0)) ERROR;
+	if (get_datatype_info_c::is_type_valid(symbol->datatype) && (count <= 0)) ERROR;
 	
 	l_expr->accept(*this);
 	r_expr->accept(*this);
@@ -1078,24 +1295,28 @@
 }
 
 
-
-void *narrow_candidate_datatypes_c::visit(    or_expression_c *symbol) {return narrow_binary_expression( widen_OR_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(   xor_expression_c *symbol) {return narrow_binary_expression(widen_XOR_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(   and_expression_c *symbol) {return narrow_binary_expression(widen_AND_table, symbol, symbol->l_exp, symbol->r_exp);}
-
-void *narrow_candidate_datatypes_c::visit(   equ_expression_c *symbol) {return narrow_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(notequ_expression_c *symbol) {return narrow_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(    lt_expression_c *symbol) {return narrow_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(    gt_expression_c *symbol) {return narrow_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(    le_expression_c *symbol) {return narrow_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit(    ge_expression_c *symbol) {return narrow_binary_expression(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
-
-void *narrow_candidate_datatypes_c::visit(   add_expression_c *symbol) {return narrow_binary_expression(widen_ADD_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
-void *narrow_candidate_datatypes_c::visit(   sub_expression_c *symbol) {return narrow_binary_expression(widen_SUB_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
-void *narrow_candidate_datatypes_c::visit(   mul_expression_c *symbol) {return narrow_binary_expression(widen_MUL_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
-void *narrow_candidate_datatypes_c::visit(   div_expression_c *symbol) {return narrow_binary_expression(widen_DIV_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
-void *narrow_candidate_datatypes_c::visit(   mod_expression_c *symbol) {return narrow_binary_expression(widen_MOD_table, symbol, symbol->l_exp, symbol->r_exp);}
-void *narrow_candidate_datatypes_c::visit( power_expression_c *symbol) {return narrow_binary_expression(widen_EXPT_table,symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::narrow_equality_comparison(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool *deprecated_operation) {
+	return narrow_binary_expression(widen_table, symbol, l_expr, r_expr, deprecated_operation, true);
+}
+
+
+void *narrow_candidate_datatypes_c::visit(    or_expression_c *symbol) {return narrow_binary_expression  ( widen_OR_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(   xor_expression_c *symbol) {return narrow_binary_expression  (widen_XOR_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(   and_expression_c *symbol) {return narrow_binary_expression  (widen_AND_table, symbol, symbol->l_exp, symbol->r_exp);}
+
+void *narrow_candidate_datatypes_c::visit(   equ_expression_c *symbol) {return narrow_equality_comparison(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(notequ_expression_c *symbol) {return narrow_equality_comparison(widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(    lt_expression_c *symbol) {return narrow_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(    gt_expression_c *symbol) {return narrow_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(    le_expression_c *symbol) {return narrow_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit(    ge_expression_c *symbol) {return narrow_binary_expression  (widen_CMP_table, symbol, symbol->l_exp, symbol->r_exp);}
+
+void *narrow_candidate_datatypes_c::visit(   add_expression_c *symbol) {return narrow_binary_expression  (widen_ADD_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
+void *narrow_candidate_datatypes_c::visit(   sub_expression_c *symbol) {return narrow_binary_expression  (widen_SUB_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
+void *narrow_candidate_datatypes_c::visit(   mul_expression_c *symbol) {return narrow_binary_expression  (widen_MUL_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
+void *narrow_candidate_datatypes_c::visit(   div_expression_c *symbol) {return narrow_binary_expression  (widen_DIV_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
+void *narrow_candidate_datatypes_c::visit(   mod_expression_c *symbol) {return narrow_binary_expression  (widen_MOD_table, symbol, symbol->l_exp, symbol->r_exp);}
+void *narrow_candidate_datatypes_c::visit( power_expression_c *symbol) {return narrow_binary_expression  (widen_EXPT_table,symbol, symbol->l_exp, symbol->r_exp);}
 
 
 void *narrow_candidate_datatypes_c::visit(neg_expression_c *symbol) {
@@ -1182,7 +1403,7 @@
 
 void *narrow_candidate_datatypes_c::visit(if_statement_c *symbol) {
 	for(unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if (is_ANY_BOOL_compatible(symbol->expression->candidate_datatypes[i]))
+		if (get_datatype_info_c::is_BOOL_compatible(symbol->expression->candidate_datatypes[i]))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);
@@ -1198,7 +1419,7 @@
 
 void *narrow_candidate_datatypes_c::visit(elseif_statement_c *symbol) {
 	for (unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if (is_ANY_BOOL_compatible(symbol->expression->candidate_datatypes[i]))
+		if (get_datatype_info_c::is_BOOL_compatible(symbol->expression->candidate_datatypes[i]))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);
@@ -1211,8 +1432,8 @@
 // SYM_REF3(case_statement_c, expression, case_element_list, statement_list)
 void *narrow_candidate_datatypes_c::visit(case_statement_c *symbol) {
 	for (unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if ((is_ANY_INT_type(symbol->expression->candidate_datatypes[i]))
-				 || (search_base_type.type_is_enumerated(symbol->expression->candidate_datatypes[i])))
+		if ((get_datatype_info_c::is_ANY_INT(symbol->expression->candidate_datatypes[i]))
+				 || (search_base_type_c::type_is_enumerated(symbol->expression->candidate_datatypes[i])))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);
@@ -1248,7 +1469,7 @@
 void *narrow_candidate_datatypes_c::visit(case_list_c *symbol) {
 	for (int i = 0; i < symbol->n; i++) {
 		for (unsigned int k = 0; k < symbol->elements[i]->candidate_datatypes.size(); k++) {
-			if (is_type_equal(symbol->datatype, symbol->elements[i]->candidate_datatypes[k]))
+			if (get_datatype_info_c::is_type_equal(symbol->datatype, symbol->elements[i]->candidate_datatypes[k]))
 				symbol->elements[i]->datatype = symbol->elements[i]->candidate_datatypes[k];
 		}
 		/* NOTE: this may be an integer, a subrange_c, or a enumerated value! */
@@ -1264,23 +1485,23 @@
 void *narrow_candidate_datatypes_c::visit(for_statement_c *symbol) {
 	/* Control variable */
 	for(unsigned int i = 0; i < symbol->control_variable->candidate_datatypes.size(); i++) {
-		if (is_ANY_INT_type(symbol->control_variable->candidate_datatypes[i])) {
+		if (get_datatype_info_c::is_ANY_INT(symbol->control_variable->candidate_datatypes[i])) {
 			symbol->control_variable->datatype = symbol->control_variable->candidate_datatypes[i];
 		}
 	}
 	symbol->control_variable->accept(*this);
 	/* BEG expression */
 	for(unsigned int i = 0; i < symbol->beg_expression->candidate_datatypes.size(); i++) {
-		if (is_type_equal(symbol->control_variable->datatype,symbol->beg_expression->candidate_datatypes[i]) &&
-				is_ANY_INT_type(symbol->beg_expression->candidate_datatypes[i])) {
+		if (get_datatype_info_c::is_type_equal(symbol->control_variable->datatype,symbol->beg_expression->candidate_datatypes[i]) &&
+				get_datatype_info_c::is_ANY_INT(symbol->beg_expression->candidate_datatypes[i])) {
 			symbol->beg_expression->datatype = symbol->beg_expression->candidate_datatypes[i];
 		}
 	}
 	symbol->beg_expression->accept(*this);
 	/* END expression */
 	for(unsigned int i = 0; i < symbol->end_expression->candidate_datatypes.size(); i++) {
-		if (is_type_equal(symbol->control_variable->datatype,symbol->end_expression->candidate_datatypes[i]) &&
-				is_ANY_INT_type(symbol->end_expression->candidate_datatypes[i])) {
+		if (get_datatype_info_c::is_type_equal(symbol->control_variable->datatype,symbol->end_expression->candidate_datatypes[i]) &&
+				get_datatype_info_c::is_ANY_INT(symbol->end_expression->candidate_datatypes[i])) {
 			symbol->end_expression->datatype = symbol->end_expression->candidate_datatypes[i];
 		}
 	}
@@ -1288,8 +1509,8 @@
 	/* BY expression */
 	if (NULL != symbol->by_expression) {
 		for(unsigned int i = 0; i < symbol->by_expression->candidate_datatypes.size(); i++) {
-			if (is_type_equal(symbol->control_variable->datatype,symbol->by_expression->candidate_datatypes[i]) &&
-					is_ANY_INT_type(symbol->by_expression->candidate_datatypes[i])) {
+			if (get_datatype_info_c::is_type_equal(symbol->control_variable->datatype,symbol->by_expression->candidate_datatypes[i]) &&
+					get_datatype_info_c::is_ANY_INT(symbol->by_expression->candidate_datatypes[i])) {
 				symbol->by_expression->datatype = symbol->by_expression->candidate_datatypes[i];
 			}
 		}
@@ -1302,7 +1523,7 @@
 
 void *narrow_candidate_datatypes_c::visit(while_statement_c *symbol) {
 	for (unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if(is_BOOL_type(symbol->expression->candidate_datatypes[i]))
+		if(get_datatype_info_c::is_BOOL(symbol->expression->candidate_datatypes[i]))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);
@@ -1313,7 +1534,7 @@
 
 void *narrow_candidate_datatypes_c::visit(repeat_statement_c *symbol) {
 	for (unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if(is_BOOL_type(symbol->expression->candidate_datatypes[i]))
+		if(get_datatype_info_c::is_BOOL(symbol->expression->candidate_datatypes[i]))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);
--- a/stage3/narrow_candidate_datatypes.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/narrow_candidate_datatypes.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -53,6 +53,10 @@
  *  then a datatype error has been found, and the datatype is either left at NULL, or set to a pointer of an invalid_type_name_c object!
  */
 
+#ifndef _NARROW_CANDIDATE_DATATYPES_HH
+#define _NARROW_CANDIDATE_DATATYPES_HH
+
+
 
 #include "../absyntax_utils/absyntax_utils.hh"
 #include "datatype_functions.hh"
@@ -61,11 +65,9 @@
 
   private:
     search_varfb_instance_type_c *search_varfb_instance_type;
-    search_base_type_c search_base_type;
     symbol_c *il_operand;
     il_instruction_c *fake_prev_il_instruction;
-    std::vector <symbol_c *> *prev_il_instructions;
-    std::vector <symbol_c *> *prev_il_instructions_intersected_datatypes;
+    il_instruction_c   *current_il_instruction;
 
     bool is_widening_compatible(const struct widen_entry widen_table[], symbol_c *left_type, symbol_c *right_type, symbol_c *result_type, bool *deprecated_status = NULL);
 
@@ -75,8 +77,9 @@
     void *narrow_implicit_il_fb_call(symbol_c *il_instruction, const char *param_name, symbol_c *&called_fb_declaration);
 
     void *handle_il_instruction(symbol_c *symbol);
-    void *narrow_binary_operator  (const struct widen_entry widen_table[], symbol_c *symbol,                                     bool *deprecated_operation = NULL);
-    void *narrow_binary_expression(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool *deprecated_operation = NULL);
+    void *narrow_binary_operator    (const struct widen_entry widen_table[], symbol_c *symbol,                                     bool *deprecated_operation = NULL);
+    void *narrow_binary_expression  (const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool *deprecated_operation = NULL, bool allow_enums = false);
+    void *narrow_equality_comparison(const struct widen_entry widen_table[], symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool *deprecated_operation = NULL);
 
     void *narrow_conditional_flow_control_IL_instruction(symbol_c *symbol);
 
@@ -90,11 +93,86 @@
     /**********************/
     /* B 1.3 - Data types */
     /**********************/
+    /***********************************/
+    /* B 1.3.1 - Elementary Data Types */
+    /***********************************/
+    void *visit(    time_type_name_c    *symbol); 
+    void *visit(    bool_type_name_c    *symbol); 
+    void *visit(    sint_type_name_c    *symbol); 
+    void *visit(    int_type_name_c     *symbol); 
+    void *visit(    dint_type_name_c    *symbol); 
+    void *visit(    lint_type_name_c    *symbol); 
+    void *visit(    usint_type_name_c   *symbol); 
+    void *visit(    uint_type_name_c    *symbol); 
+    void *visit(    udint_type_name_c   *symbol); 
+    void *visit(    ulint_type_name_c   *symbol); 
+    void *visit(    real_type_name_c    *symbol); 
+    void *visit(    lreal_type_name_c   *symbol); 
+    void *visit(    date_type_name_c    *symbol); 
+    void *visit(    tod_type_name_c     *symbol); 
+    void *visit(    dt_type_name_c      *symbol); 
+    void *visit(    byte_type_name_c    *symbol); 
+    void *visit(    word_type_name_c    *symbol); 
+    void *visit(    dword_type_name_c   *symbol); 
+    void *visit(    lword_type_name_c   *symbol); 
+    void *visit(    string_type_name_c  *symbol); 
+    void *visit(    wstring_type_name_c *symbol); 
+
+    void *visit(safetime_type_name_c    *symbol); 
+    void *visit(safebool_type_name_c    *symbol); 
+    void *visit(safesint_type_name_c    *symbol); 
+    void *visit(safeint_type_name_c     *symbol); 
+    void *visit(safedint_type_name_c    *symbol); 
+    void *visit(safelint_type_name_c    *symbol); 
+    void *visit(safeusint_type_name_c   *symbol); 
+    void *visit(safeuint_type_name_c    *symbol); 
+    void *visit(safeudint_type_name_c   *symbol); 
+    void *visit(safeulint_type_name_c   *symbol); 
+    void *visit(safereal_type_name_c    *symbol); 
+    void *visit(safelreal_type_name_c   *symbol); 
+    void *visit(safedate_type_name_c    *symbol); 
+    void *visit(safetod_type_name_c     *symbol); 
+    void *visit(safedt_type_name_c      *symbol); 
+    void *visit(safebyte_type_name_c    *symbol); 
+    void *visit(safeword_type_name_c    *symbol); 
+    void *visit(safedword_type_name_c   *symbol); 
+    void *visit(safelword_type_name_c   *symbol); 
+    void *visit(safestring_type_name_c  *symbol); 
+    void *visit(safewstring_type_name_c *symbol); 
+
+
+    /********************************/
+    /* B.1.3.2 - Generic data types */
+    /********************************/
+
     /********************************/
     /* B 1.3.3 - Derived data types */
     /********************************/
+//  void *visit(data_type_declaration_c *symbol);   /* Not required. already handled by iterator_visitor_c base class */
+//  void *visit(type_declaration_list_c *symbol);   /* Not required. already handled by iterator_visitor_c base class */
+//  void *visit(simple_type_declaration_c *symbol); /* Not required. already handled by iterator_visitor_c base class */
+    void *visit(simple_spec_init_c *symbol);
+//  void *visit(subrange_type_declaration_c *symbol);
+//  void *visit(subrange_spec_init_c *symbol);
+//  void *visit(subrange_specification_c *symbol);
     void *visit(subrange_c *symbol);
-    void *visit(simple_spec_init_c *symbol);
+    void *visit(enumerated_type_declaration_c *symbol);
+    void *visit(enumerated_spec_init_c *symbol);
+    void *visit(enumerated_value_list_c *symbol);
+//  void *visit(enumerated_value_c *symbol);        /* Not required */
+//  void *visit(array_type_declaration_c *symbol);
+//  void *visit(array_spec_init_c *symbol);
+//  void *visit(array_specification_c *symbol);
+//  void *visit(array_subrange_list_c *symbol);
+//  void *visit(array_initial_elements_list_c *symbol);
+//  void *visit(array_initial_elements_c *symbol);
+//  void *visit(structure_type_declaration_c *symbol);
+//  void *visit(initialized_structure_c *symbol);
+//  void *visit(structure_element_declaration_list_c *symbol);
+//  void *visit(structure_element_declaration_c *symbol);
+//  void *visit(structure_element_initialization_list_c *symbol);
+//  void *visit(structure_element_initialization_c *symbol);
+//  void *visit(string_type_declaration_c *symbol);
 
     /*********************/
     /* B 1.4 - Variables */
@@ -264,7 +342,7 @@
 
 
 
-
-
-
-
+#endif // #ifndef _NARROW_CANDIDATE_DATATYPES_HH
+
+
+
--- a/stage3/print_datatypes_error.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/print_datatypes_error.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -103,33 +103,19 @@
 
 
 
-/* Verify if the datatypes of all prev_il_instructions are valid and equal!  */
-static bool are_all_datatypes_of_prev_il_instructions_datatypes_equal(il_instruction_c *symbol) {
-	if (NULL == symbol) ERROR;
-	bool res;
-	
-	if (symbol->prev_il_instruction.size() > 0)
-		res = is_type_valid(symbol->prev_il_instruction[0]->datatype);
-
-	for (unsigned int i = 1; i < symbol->prev_il_instruction.size(); i++)
-		res &= is_type_equal(symbol->prev_il_instruction[i-1]->datatype, symbol->prev_il_instruction[i]->datatype);
-	
+/* Verify if the datatypes of all symbols in the vector are valid and equal!  */
+static bool are_all_datatypes_equal(std::vector <symbol_c *> &symbol_vect) {
+	if (symbol_vect.size() <= 0) return false;
+
+	bool res = get_datatype_info_c::is_type_valid(symbol_vect[0]->datatype);
+	for (unsigned int i = 1; i < symbol_vect.size(); i++)
+		res &= get_datatype_info_c::is_type_equal(symbol_vect[i-1]->datatype, symbol_vect[i]->datatype);	
 	return res;
 }
 
 
 
 
-/* a helper function... */
-symbol_c *print_datatypes_error_c::base_type(symbol_c *symbol) {
-	/* NOTE: symbol == NULL is valid. It will occur when, for e.g., an undefined/undeclared symbolic_variable is used
-	 *       in the code.
-	 */
-	if (symbol == NULL) return NULL;
-	return (symbol_c *)symbol->accept(search_base_type);
-}
-
-
 
 /*
 typedef struct {
@@ -250,14 +236,14 @@
 					 */
 					for (unsigned int p = 0; p < il_instruction_symbol->prev_il_instruction.size(); p++) {
 						symbol_c *value = il_instruction_symbol->prev_il_instruction[p];  
-						if (!is_type_valid(value->datatype)) {
+						if (!get_datatype_info_c::is_type_valid(value->datatype)) {
 							function_invocation_error = true;
 							STAGE3_ERROR(0, fcall, fcall, "Data type incompatibility for value passed to first parameter when invoking function '%s'", ((identifier_c *)fcall_data.function_name)->value);
 							STAGE3_ERROR(0, value, value, "This is the IL instruction producing the incompatible data type to first parameter of function '%s'", ((identifier_c *)fcall_data.function_name)->value);
 						}
 					}
 #else
-					if (!is_type_valid(il_instruction_symbol->datatype)) {
+					if (!get_datatype_info_c::is_type_valid(il_instruction_symbol->datatype)) {
 						function_invocation_error = true;
 						STAGE3_ERROR(0, fcall, fcall, "Data type incompatibility between value in IL 'accumulator' and first parameter of function '%s'", ((identifier_c *)fcall_data.function_name)->value);
 					}
@@ -266,7 +252,7 @@
 						/* when handling a IL function call, and an error is found in the first parameter, then we bug out and do not print out any more error messages. */
 						return;
 				}
-				else if (!is_type_valid(param_value->datatype)) {
+				else if (!get_datatype_info_c::is_type_valid(param_value->datatype)) {
 					function_invocation_error = true;
 					STAGE3_ERROR(0, param_value, param_value, "Data type incompatibility for value passed in position %d when invoking %s '%s'", i, POU_str, ((identifier_c *)fcall_data.function_name)->value);
 				}
@@ -318,7 +304,7 @@
 		STAGE3_ERROR(0, il_operator, il_operand, "FB called by '%s' operator does not have a parameter named '%s'", param_name, param_name);	
 		return NULL;
 	}
-	if (!are_all_datatypes_of_prev_il_instructions_datatypes_equal(fake_prev_il_instruction)) {
+	if (!are_all_datatypes_equal(fake_prev_il_instruction->prev_il_instruction)) {
 		STAGE3_ERROR(0, il_operator, il_operand, "Data type incompatibility between parameter '%s' and value being passed.", param_name);
 		return NULL;
 	}
@@ -412,7 +398,7 @@
 
 void *print_datatypes_error_c::visit(integer_literal_c *symbol) {
 	if (symbol->candidate_datatypes.size() == 0) {
-		STAGE3_ERROR(0, symbol, symbol, "Numerical value exceeds range for %s data type.", elementary_type_c::to_string(symbol->type));
+		STAGE3_ERROR(0, symbol, symbol, "Numerical value exceeds range for %s data type.", get_datatype_info_c::get_id_str(symbol->type));
 	} else if (NULL == symbol->datatype) {
 		STAGE3_ERROR(4, symbol, symbol, "ANY_INT data type not valid in this location.");
 	}
@@ -421,7 +407,7 @@
 
 void *print_datatypes_error_c::visit(real_literal_c *symbol) {
 	if (symbol->candidate_datatypes.size() == 0) {
-		STAGE3_ERROR(0, symbol, symbol, "Numerical value exceeds range for %s data type.", elementary_type_c::to_string(symbol->type));
+		STAGE3_ERROR(0, symbol, symbol, "Numerical value exceeds range for %s data type.", get_datatype_info_c::get_id_str(symbol->type));
 	} else if (NULL == symbol->datatype) {
 		STAGE3_ERROR(4, symbol, symbol, "ANY_REAL data type not valid in this location.");
 	}
@@ -430,7 +416,7 @@
 
 void *print_datatypes_error_c::visit(bit_string_literal_c *symbol) {
 	if (symbol->candidate_datatypes.size() == 0) {
-		STAGE3_ERROR(0, symbol, symbol, "Numerical value exceeds range for %s data type.", elementary_type_c::to_string(symbol->type));
+		STAGE3_ERROR(0, symbol, symbol, "Numerical value exceeds range for %s data type.", get_datatype_info_c::get_id_str(symbol->type));
 	} else if (NULL == symbol->datatype) {
 		STAGE3_ERROR(4, symbol, symbol, "ANY_BIT data type not valid in this location.");
 	}
@@ -439,7 +425,7 @@
 
 void *print_datatypes_error_c::visit(boolean_literal_c *symbol) {
 	if (symbol->candidate_datatypes.size() == 0) {
-		STAGE3_ERROR(0, symbol, symbol, "Value is not valid for %s data type.", elementary_type_c::to_string(symbol->type));
+		STAGE3_ERROR(0, symbol, symbol, "Value is not valid for %s data type.", get_datatype_info_c::get_id_str(symbol->type));
 	} else if (NULL == symbol->datatype) {
 		STAGE3_ERROR(4, symbol, symbol, "ANY_BOOL data type not valid in this location.");
 	}
@@ -537,12 +523,12 @@
 /* B 1.3.3 - Derived data types */
 /********************************/
 void *print_datatypes_error_c::visit(simple_spec_init_c *symbol) {
-	if (!is_type_valid(symbol->simple_specification->datatype)) {
+	if (!get_datatype_info_c::is_type_valid(symbol->simple_specification->datatype)) {
 		STAGE3_ERROR(0, symbol->simple_specification, symbol->simple_specification, "Invalid data type.");
 	} else if (NULL != symbol->constant) {
-		if (!is_type_valid(symbol->constant->datatype))
+		if (!get_datatype_info_c::is_type_valid(symbol->constant->datatype))
 			STAGE3_ERROR(0, symbol->constant, symbol->constant, "Initial value has incompatible data type.");
-	} else if (!is_type_valid(symbol->datatype)) {
+	} else if (!get_datatype_info_c::is_type_valid(symbol->datatype)) {
 		ERROR; /* If we have an error here, then we must also have an error in one of
 		        * the two previous tests. If we reach this point, some strange error is ocurring!
 			*/
@@ -550,11 +536,6 @@
 	return NULL;
 }
 
-void *print_datatypes_error_c::visit(data_type_declaration_c *symbol) {
-	// TODO !!!
-	/* for the moment we must return NULL so semantic analysis of remaining code is not interrupted! */
-	return NULL;
-}
 
 void *print_datatypes_error_c::visit(enumerated_value_c *symbol) {
 	if (symbol->candidate_datatypes.size() == 0)
@@ -577,7 +558,7 @@
 /********************************************/
 void *print_datatypes_error_c::visit(direct_variable_c *symbol) {
 	if (symbol->candidate_datatypes.size() == 0) ERROR;
-	if (!is_type_valid(symbol->datatype))
+	if (!get_datatype_info_c::is_type_valid(symbol->datatype))
 		STAGE3_ERROR(4, symbol, symbol, "Direct variable has incompatible data type with expression.");
 	return NULL;
 }
@@ -648,7 +629,7 @@
   symbol->located_var_spec_init->accept(*this);
   /* It does not make sense to call symbol->location->accept(*this). The check is done right here if the following if() */
   // symbol->location->accept(*this); 
-  if ((is_type_valid(symbol->located_var_spec_init->datatype)) && (!is_type_valid(symbol->location->datatype)))
+  if ((get_datatype_info_c::is_type_valid(symbol->located_var_spec_init->datatype)) && (!get_datatype_info_c::is_type_valid(symbol->location->datatype)))
     STAGE3_ERROR(0, symbol, symbol, "Bit size of data type is incompatible with bit size of location.");
   return NULL;
 }  
@@ -662,8 +643,7 @@
 /*********************/
 void *print_datatypes_error_c::visit(function_declaration_c *symbol) {
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
-	/* We do not check for data type errors in variable declarations, Skip this for now... */
-// 	symbol->var_declarations_list->accept(*this);
+ 	symbol->var_declarations_list->accept(*this);
 	if (debug) printf("Print error data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value);
 	il_parenthesis_level = 0;
 	il_error = false;
@@ -678,8 +658,7 @@
 /***************************/
 void *print_datatypes_error_c::visit(function_block_declaration_c *symbol) {
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
-	/* We do not check for data type errors in variable declarations, Skip this for now... */
-// 	symbol->var_declarations->accept(*this);
+ 	symbol->var_declarations->accept(*this);
 	if (debug) printf("Print error data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value);
 	il_parenthesis_level = 0;
 	il_error = false;
@@ -694,7 +673,6 @@
 /**********************/
 void *print_datatypes_error_c::visit(program_declaration_c *symbol) {
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
-	/* We do not check for data type errors in variable declarations, Skip this for now... */
 	symbol->var_declarations->accept(*this);
 	if (debug) printf("Print error data types list in body of program %s\n", ((token_c *)(symbol->program_type_name))->value);
 	il_parenthesis_level = 0;
@@ -762,7 +740,7 @@
 		 */
 		tmp_prev_il_instruction.prev_il_instruction = symbol->prev_il_instruction;
 		intersect_prev_candidate_datatype_lists(&tmp_prev_il_instruction);
-		if (are_all_datatypes_of_prev_il_instructions_datatypes_equal(symbol))
+		if (are_all_datatypes_equal(symbol->prev_il_instruction))
 			if (symbol->prev_il_instruction.size() > 0)
 				tmp_prev_il_instruction.datatype = (symbol->prev_il_instruction[0])->datatype;
 		
@@ -835,6 +813,8 @@
 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
 // SYM_REF3(il_expression_c, il_expr_operator, il_operand, simple_instr_list);
 void *print_datatypes_error_c::visit(il_expression_c *symbol) {
+  /* Stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list if necessary. We can therefore ignore the 'il_operand' entry! */
+  
   /* first give the parenthesised IL list a chance to print errors */
   il_instruction_c *save_fake_prev_il_instruction = fake_prev_il_instruction;
   symbol->simple_instr_list->accept(*this);
@@ -902,6 +882,7 @@
   if (symbol->prev_il_instruction.size() > 1) ERROR; /* There should be no labeled insructions inside an IL expression! */
     
   il_instruction_c tmp_prev_il_instruction(NULL, NULL);
+#if 0
   /* the print error algorithm will need access to the intersected candidate_datatype lists of all prev_il_instructions, as well as the 
    * list of the prev_il_instructions.
    * Instead of creating two 'global' (within the class) variables, we create a single il_instruction_c variable (fake_prev_il_instruction),
@@ -910,6 +891,19 @@
   if (symbol->prev_il_instruction.size() > 0)
     tmp_prev_il_instruction.candidate_datatypes = symbol->prev_il_instruction[0]->candidate_datatypes;
   tmp_prev_il_instruction.prev_il_instruction = symbol->prev_il_instruction;
+#endif
+  
+  /* the print error algorithm will need access to the intersected candidate_datatype lists of all prev_il_instructions, as well as the 
+   * list of the prev_il_instructions.
+   * Instead of creating two 'global' (within the class) variables, we create a single il_instruction_c variable (fake_prev_il_instruction),
+   * and shove that data into this single variable.
+   */
+  tmp_prev_il_instruction.prev_il_instruction = symbol->prev_il_instruction;
+  intersect_prev_candidate_datatype_lists(&tmp_prev_il_instruction);
+  if (are_all_datatypes_equal(symbol->prev_il_instruction))
+    if (symbol->prev_il_instruction.size() > 0)
+      tmp_prev_il_instruction.datatype = (symbol->prev_il_instruction[0])->datatype;
+  
   
    /* copy the candidate_datatypes list */
   fake_prev_il_instruction = &tmp_prev_il_instruction;
@@ -1264,7 +1258,7 @@
 
 void *print_datatypes_error_c::visit(while_statement_c *symbol) {
 	symbol->expression->accept(*this);
-	if (!is_type_valid(symbol->expression->datatype)) {
+	if (!get_datatype_info_c::is_type_valid(symbol->expression->datatype)) {
 		STAGE3_ERROR(0, symbol, symbol, "Invalid data type for 'WHILE' condition.");
 		return NULL;
 	}
@@ -1274,7 +1268,7 @@
 }
 
 void *print_datatypes_error_c::visit(repeat_statement_c *symbol) {
-	if (!is_type_valid(symbol->expression->datatype)) {
+	if (!get_datatype_info_c::is_type_valid(symbol->expression->datatype)) {
 		STAGE3_ERROR(0, symbol, symbol, "Invalid data type for 'REPEAT' condition.");
 		return NULL;
 	}
--- a/stage3/print_datatypes_error.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/print_datatypes_error.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -58,7 +58,6 @@
     unsigned int current_display_error_level;
     
     search_varfb_instance_type_c *search_varfb_instance_type;
-    search_base_type_c search_base_type;
     /* When calling a function block, we must first find it's type,
      * by searching through the declarations of the variables currently
      * in scope.
@@ -98,7 +97,6 @@
     symbol_c *il_operand;
 
     /* some helper functions... */
-    symbol_c *base_type(symbol_c *symbol);
     void handle_function_invocation(symbol_c *fcall, generic_function_call_t fcall_data);
     void *handle_implicit_il_fb_invocation(const char *param_name, symbol_c *il_operator, symbol_c *called_fb_declaration);  
     void *handle_conditional_flow_control_IL_instruction(symbol_c *symbol, const char *oper);
@@ -161,7 +159,7 @@
     /* B 1.3.3 - Derived data types */
     /********************************/
     void *visit(simple_spec_init_c *symbol);
-    void *visit(data_type_declaration_c *symbol);
+//  void *visit(data_type_declaration_c *symbol); /* use base iterator_c method! */
     void *visit(enumerated_value_c *symbol);
 
     /*********************/
--- a/stage3/stage3.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/stage3.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -37,12 +37,27 @@
 #include "flow_control_analysis.hh"
 #include "fill_candidate_datatypes.hh"
 #include "narrow_candidate_datatypes.hh"
+#include "forced_narrow_candidate_datatypes.hh"
 #include "print_datatypes_error.hh"
 #include "lvalue_check.hh"
 #include "array_range_check.hh"
 #include "constant_folding.hh"
+#include "declaration_check.hh"
+#include "enum_declaration_check.hh"
 
 
+static int enum_declaration_check(symbol_c *tree_root){
+    enum_declaration_check_c enum_declaration_check(NULL);
+    tree_root->accept(enum_declaration_check);
+    return enum_declaration_check.get_error_count();
+}
+
+
+static int declaration_safety(symbol_c *tree_root){
+    declaration_check_c declaration_check(tree_root);
+    tree_root->accept(declaration_check);
+    return declaration_check.get_error_count();
+}
 
 static int flow_control_analysis(symbol_c *tree_root){
     flow_control_analysis_c flow_control_analysis(tree_root);
@@ -74,6 +89,8 @@
 	tree_root->accept(narrow_candidate_datatypes);
 	print_datatypes_error_c print_datatypes_error(tree_root);
 	tree_root->accept(print_datatypes_error);
+	forced_narrow_candidate_datatypes_c forced_narrow_candidate_datatypes(tree_root);
+	tree_root->accept(forced_narrow_candidate_datatypes);
 	return print_datatypes_error.get_error_count();
 }
 
@@ -99,6 +116,8 @@
 
 int stage3(symbol_c *tree_root){
 	int error_count = 0;
+	error_count += enum_declaration_check(tree_root);
+	error_count += declaration_safety(tree_root);
 	error_count += flow_control_analysis(tree_root);
 	error_count += constant_folding(tree_root);
 	error_count += type_safety(tree_root);
--- a/stage3/stage3.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage3/stage3.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -30,9 +30,12 @@
  *
  */
 
+#ifndef _STAGE3_HH
+#define _STAGE3_HH
 
 #include "../util/symtable.hh"
 
 
 int stage3(symbol_c *tree_root);
 
+#endif /* _STAGE3_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage4/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,537 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = stage4
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+SUBDIRS = generate_c generate_iec
+CLEANFILES = stage4.o
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign stage4/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign stage4/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+	install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic ctags \
+	ctags-recursive distclean distclean-generic distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+	tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- a/stage4/generate_c/Makefile.am	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/Makefile.am	Fri Mar 08 01:01:15 2013 +0100
@@ -6,5 +6,5 @@
 
 libstage4_c_a_LIBADD = ../stage4.o
 
-libstage4_c_a_cppflags = -I../../../absyntax
+libstage4_c_a_CPPFLAGS = -I../../../absyntax
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage4/generate_c/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,495 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = stage4/generate_c
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libstage4_c_a_AR = $(AR) $(ARFLAGS)
+libstage4_c_a_DEPENDENCIES = ../stage4.o
+am_libstage4_c_a_OBJECTS = generate_c.$(OBJEXT)
+libstage4_c_a_OBJECTS = $(am_libstage4_c_a_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(libstage4_c_a_SOURCES)
+DIST_SOURCES = $(libstage4_c_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+lib_LIBRARIES = libstage4_c.a
+libstage4_c_a_SOURCES = generate_c.cc 
+libstage4_c_a_LIBADD = ../stage4.o
+libstage4_c_a_cppflags = -I../../../absyntax
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign stage4/generate_c/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign stage4/generate_c/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  if test -f $$p; then \
+	    $(am__strip_dir) \
+	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libstage4_c.a: $(libstage4_c_a_OBJECTS) $(libstage4_c_a_DEPENDENCIES) $(EXTRA_libstage4_c_a_DEPENDENCIES) 
+	-rm -f libstage4_c.a
+	$(libstage4_c_a_AR) libstage4_c.a $(libstage4_c_a_OBJECTS) $(libstage4_c_a_LIBADD)
+	$(RANLIB) libstage4_c.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_c.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- a/stage4/generate_c/generate_c.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -423,7 +423,7 @@
   };
   ERROR; // should never reach this point!
   return 0; // humour the compiler!
-};
+}
 
 /***********************************************************************/
 /***********************************************************************/
@@ -582,7 +582,7 @@
     typedef enum {
       none_im,
       arrayname_im,
-      arraydeclaration_im,
+      arraydeclaration_im
     } inlinearray_mode_t;
 
   private:
@@ -1190,7 +1190,7 @@
   s4o.print(" = ");
   {
     /* get the default value of this variable's type */
-    symbol_c *default_value = (symbol_c *)symbol->type_name->accept(*type_initial_value_c::instance());
+    symbol_c *default_value = type_initial_value_c::get(symbol->type_name);
     if (default_value == NULL) ERROR;
     initialization_analyzer_c initialization_analyzer(default_value);
     switch (initialization_analyzer.get_initialization_type()) {
@@ -2353,7 +2353,7 @@
     typedef enum {
       none_gm,
       datatypes_gm,
-      pous_gm,
+      pous_gm
     } generate_mode_t;
 
   protected:
--- a/stage4/generate_c/generate_c_base.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_base.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -227,8 +227,7 @@
           symbol_c *value,
           symbol_c *fb_name = NULL,
           bool temp = false) {
-      search_base_type_c search_base_type;
-      bool is_subrange = search_base_type.type_is_subrange(type);
+      bool is_subrange = search_base_type_c::type_is_subrange(type);
       if (is_subrange) {
 		s4o.print("__CHECK_");
 		type->accept(*this);
--- a/stage4/generate_c/generate_c_il.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_il.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -48,7 +48,7 @@
 /***********************************************************************/
 
 
-/* A new class to ouput the il default variable to c++ code
+/* A new class to ouput the IL implicit variable to c++ code
  * We use this class, inheriting from symbol_c, so it may be used
  * as any other symbol_c object in the intermediate parse tree,
  * more specifically, so it can be used as any other il operand.
@@ -77,7 +77,7 @@
 
 
 /* A class to print out to the resulting C++ code
- * the IL default variable name.
+ * the IL implicit variable name.
  *
  * It includes a reference to its name,
  * and the data type of the data currently stored
@@ -86,7 +86,7 @@
  * of the union top reference!!
  *
  * Note that we also need to keep track of the data type of
- * the value currently being stored in the default variable.
+ * the value currently being stored in the IL implicit variable.
  * This is required so we can process parenthesis,
  *
  * e.g. :
@@ -102,7 +102,7 @@
  * When we do execute the 'AND (' operation, we need to know the data type
  * of the operand, which in this case is the result of the evaluation of the
  * instruction list inside the parenthesis. We can only know this if we
- * keep track of the data type currently stored in the default variable!
+ * keep track of the data type currently stored in the IL implicit variable!
  *
  * We use the current_type inside the generate_c_il::default_variable_name variable
  * to track this!
@@ -110,7 +110,6 @@
 class il_default_variable_c: public symbol_c {
   public:
     symbol_c *var_name;  /* in principle, this should point to an indentifier_c */
-    symbol_c *current_type;
 
   public:
     il_default_variable_c(const char *var_name_str, symbol_c *current_type);
@@ -125,6 +124,8 @@
 
 
 
+
+
 class generate_c_il_c: public generate_c_typedecl_c, il_default_variable_visitor_c {
 
   public:
@@ -138,39 +139,28 @@
     } variablegeneration_t;
 
   private:
-    /* When compiling il code, it becomes necessary to determine the
-     * data type of il operands. To do this, we must first find the
-     * il operand's declaration, within the scope of the function block
-     * or function currently being processed.
-     * The following object does just that...
-     * This object instance will then later be called while the
-     * remaining il code is being handled.
+    /* Label to which the current IL jump operation should jump to... */
+    /* This variable is used to pass data from the
+     * il_jump_operation_c visitor
+     * to the il jump operator visitors (i.e. JMP_operator_c,
+     * JMPC_operator_c, JMPCN_operator_c, ...)
      */
-    search_expression_type_c *search_expression_type;
-
-    /* The initial value that should be given to the IL default variable
-     * imediately after a parenthesis is opened.
-     * This variable is only used to pass data from the
-     * il_expression_c visitor to the simple_instr_list_c visitor.
-     *
-     * e.g.:
-     *         LD var1
-     *         AND ( var2
-     *         OR var3
-     *         )
-     *
-     * In the above code sample, the line 'AND ( var2' constitutes
-     * an il_expression_c, where var2 should be loaded into the
-     * il default variable before continuing with the expression
-     * inside the parenthesis.
-     * Unfortunately, only the simple_instr_list_c may do the
-     * initial laoding of the var2 bariable following the parenthesis,
-     * so the il_expression_c visitor will have to pass 'var2' as a
-     * parameter to the simple_instr_list_c visitor.
-     * Ergo, the existance of the following parameter...!
+    symbol_c *jump_label;
+
+    /* the data type of the IL implicit variable... */
+    #define IL_DEFVAR_T VAR_LEADER "IL_DEFVAR_T"
+    /* The name of the IL implicit variable... */
+    #define IL_DEFVAR   VAR_LEADER "IL_DEFVAR"
+    /* The name of the variable used to pass the result of a
+     * parenthesised instruction list to the immediately preceding
+     * scope ...
      */
-    symbol_c *il_default_variable_init_value;
-
+    #define IL_DEFVAR_BACK   VAR_LEADER "IL_DEFVAR_BACK"
+    
+    il_default_variable_c implicit_variable_current;      /* the current   implicit variable, with the datatype resulting from the previous IL operation */
+    il_default_variable_c implicit_variable_result;       /* the resulting implicit variable, with the datatype resulting from the current  IL operation */
+    il_default_variable_c implicit_variable_result_back;
+    
     /* Operand to the IL operation currently being processed... */
     /* These variables are used to pass data from the
      * il_simple_operation_c and il_expression_c visitors
@@ -178,43 +168,6 @@
      * LDN_operator_c, ST_operator_c, STN_operator_c, ...)
      */
     symbol_c *current_operand;
-    symbol_c *current_operand_type;
-
-    /* Label to which the current IL jump operation should jump to... */
-    /* This variable is used to pass data from the
-     * il_jump_operation_c visitor
-     * to the il jump operator visitors (i.e. JMP_operator_c,
-     * JMPC_operator_c, JMPCN_operator_c, ...)
-     */
-    symbol_c *jump_label;
-
-    /* The result of the comparison IL operations (GT, EQ, LT, ...)
-     * is a boolean variable.
-     * This class keeps track of the current data type stored in the
-     * il default variable. This is usually done by keeping a reference
-     * to the data type of the last operand. Nevertheless, in the case of
-     * the comparison IL operators, the data type of the result (a boolean)
-     * is not the data type of the operand. We therefore need an object
-     * of the boolean data type to keep as a reference of the current
-     * data type.
-     * The following object is it...
-     */
-    bool_type_name_c bool_type;
-    lint_type_name_c lint_type;
-    lword_type_name_c lword_type;
-    lreal_type_name_c lreal_type;
-
-    /* the data type of the IL default variable... */
-    #define IL_DEFVAR_T VAR_LEADER "IL_DEFVAR_T"
-    /* The name of the IL default variable... */
-    #define IL_DEFVAR   VAR_LEADER "IL_DEFVAR"
-    /* The name of the variable used to pass the result of a
-     * parenthesised instruction list to the immediately preceding
-     * scope ...
-     */
-    #define IL_DEFVAR_BACK   VAR_LEADER "IL_DEFVAR_BACK"
-    il_default_variable_c default_variable_name;
-    il_default_variable_c default_variable_back_name;
 
     /* When calling a function block, we must first find it's type,
      * by searching through the declarations of the variables currently
@@ -234,8 +187,6 @@
     search_varfb_instance_type_c *search_varfb_instance_type;
     search_var_instance_decl_c   *search_var_instance_decl;
 
-    search_base_type_c search_base_type;
-
     symbol_c* current_array_type;
     symbol_c* current_param_type;
 
@@ -247,17 +198,15 @@
   public:
     generate_c_il_c(stage4out_c *s4o_ptr, symbol_c *name, symbol_c *scope, const char *variable_prefix = NULL)
     : generate_c_typedecl_c(s4o_ptr),
-      default_variable_name(IL_DEFVAR, NULL),
-      default_variable_back_name(IL_DEFVAR_BACK, NULL)
+      implicit_variable_current    (IL_DEFVAR,      NULL),
+      implicit_variable_result     (IL_DEFVAR,      NULL),
+      implicit_variable_result_back(IL_DEFVAR_BACK, NULL)
     {
-      search_expression_type = new search_expression_type_c(scope);
-      search_fb_instance_decl = new search_fb_instance_decl_c(scope);
+      search_fb_instance_decl    = new search_fb_instance_decl_c   (scope);
       search_varfb_instance_type = new search_varfb_instance_type_c(scope);
-      search_var_instance_decl   = new search_var_instance_decl_c(scope);
+      search_var_instance_decl   = new search_var_instance_decl_c  (scope);
       
       current_operand = NULL;
-      current_operand_type = NULL;
-      il_default_variable_init_value = NULL;
       current_array_type = NULL;
       current_param_type = NULL;
       fcall_number = 0;
@@ -268,7 +217,6 @@
 
     virtual ~generate_c_il_c(void) {
       delete search_fb_instance_decl;
-      delete search_expression_type;
       delete search_varfb_instance_type;
       delete search_var_instance_decl;
     }
@@ -277,38 +225,48 @@
       il->accept(*this);
     }
 
-    /* Declare the backup to the default variable, that will store the result
-     * of the IL operations executed inside a parenthesis...
-     */
-    void declare_backup_variable(void) {
+  private:
+    /* Declare an implicit IL variable... */
+    void declare_implicit_variable(il_default_variable_c *implicit_var) {
       s4o.print(s4o.indent_spaces);
       s4o.print(IL_DEFVAR_T);
       s4o.print(" ");
-      print_backup_variable();
+      implicit_var->datatype = NULL;
+      implicit_var->accept(*this);
       s4o.print(";\n");
     }
     
-    void print_backup_variable(void) {
-      this->default_variable_back_name.accept(*this);
-    }
-
-    void reset_default_variable_name(void) {
-      this->default_variable_name.current_type = NULL;
-      this->default_variable_back_name.current_type = NULL;
-    }
+  public:  
+    /* Declare the default variable, that will store the result of the IL operations */
+    void declare_implicit_variable(void) {
+      declare_implicit_variable(&this->implicit_variable_result);
+    }
+    
+    /* Declare the backup to the default variable, that will store the result of the IL operations executed inside a parenthesis... */
+    void declare_implicit_variable_back(void) {
+      declare_implicit_variable(&this->implicit_variable_result_back);
+    }
+    
+    void print_implicit_variable_back(void) {
+      this->implicit_variable_result_back.accept(*this);
+    }    
+
 
   private:
-    /* A helper function... */
-    /*
-    bool is_bool_type(symbol_c *type_symbol) {
-      return (NULL != dynamic_cast<bool_type_name_c *>(type_symbol));
-    }
-    */
+    /* a small helper function */
+    symbol_c *default_literal_type(symbol_c *symbol) {
+      if (get_datatype_info_c::is_ANY_INT_literal(symbol)) {
+        return &get_datatype_info_c::lint_type_name;
+      }
+      else if (get_datatype_info_c::is_ANY_REAL_literal(symbol)) {
+        return &get_datatype_info_c::lreal_type_name;
+      }
+      return symbol;
+    }
 
     /* A helper function... */
     void *XXX_operator(symbol_c *lo, const char *op, symbol_c *ro) {
-      if ((NULL == lo) || (NULL == ro)) ERROR;
-      if (NULL == op) ERROR;
+      if ((NULL == lo) || (NULL == ro) || (NULL == op)) ERROR;
 
       lo->accept(*this);
       s4o.print(op);
@@ -317,11 +275,11 @@
     }
 
     /* A helper function... */
-    void *XXX_function(const char *func, symbol_c *lo, symbol_c *ro) {
-      if ((NULL == lo) || (NULL == ro)) ERROR;
-      if (NULL == func) ERROR;
-
-      lo->accept(*this);
+    void *XXX_function(symbol_c *res, const char *func, symbol_c *lo, symbol_c *ro) {
+      if ((NULL == res) || (NULL == lo) || (NULL == ro)) ERROR;
+      if  (NULL == func) ERROR;
+
+      res->accept(*this);
       s4o.print(" = ");
       s4o.print(func);
       s4o.print("(");
@@ -332,7 +290,7 @@
       return NULL;
     }
 
-    /* A helper function... */
+    /* A helper function... used for implicit FB calls: S1, R1, CLK, CU, CD, PV, IN, and PT */
     void *XXX_CAL_operator(const char *param_name, symbol_c *fb_name) {
       if (wanted_variablegeneration != expression_vg) {
         s4o.print(param_name);
@@ -349,7 +307,7 @@
 
       //SYM_REF3(il_param_assignment_c, il_assign_operator, il_operand, simple_instr_list)
       il_assign_operator_c il_assign_operator(&param);
-      il_param_assignment_c il_param_assignment(&il_assign_operator, &this->default_variable_name, NULL);
+      il_param_assignment_c il_param_assignment(&il_assign_operator, &this->implicit_variable_current, NULL);
       // SYM_LIST(il_param_list_c)
       il_param_list_c il_param_list;   
       il_param_list.add_element(&il_param_assignment);
@@ -362,81 +320,48 @@
     }
 
     /* A helper function... */
-    void *CMP_operator(symbol_c *o, const char *operation) {
-      if (NULL == o) ERROR;
-      if (NULL == this->default_variable_name.current_type) ERROR;
-
-      symbol_c *backup = this->default_variable_name.current_type;
-      this->default_variable_name.current_type = &(this->bool_type);
-      this->default_variable_name.accept(*this);
-      this->default_variable_name.current_type = backup;
-
+    void *CMP_operator(symbol_c *operand, const char *operation) {
+      if (NULL == operand) ERROR;
+      if (NULL == operand->datatype) ERROR;
+      if (NULL == this->implicit_variable_current.datatype) ERROR;
+
+      this->implicit_variable_result.accept(*this);
       s4o.print(" = ");
       s4o.print(operation);
-      this->default_variable_name.current_type->accept(*this);
+      operand->datatype->accept(*this);
+      /* NOTE: we are calling a standard Function: 
+       *         1st parameter: EN  (enable)
+       *         2nd parameter: ENO (enable output)
+       *         3rd parameter: number of operands we will be passing (required because we are calling an extensible standard function!)
+       *         4th parameter: the left  hand side of the comparison expression (in out case, the IL implicit variable)
+       *         4th parameter: the right hand side of the comparison expression (in out case, current operand)
+       */
       s4o.print("(__BOOL_LITERAL(TRUE), NULL, 2, ");
-      this->default_variable_name.accept(*this);
+      this->implicit_variable_current.accept(*this);
       s4o.print(", ");
-      o->accept(*this);
+      operand->accept(*this);
       s4o.print(")");
 
-      /* the data type resulting from this operation... */
-      this->default_variable_name.current_type = &(this->bool_type);
       return NULL;
     }
 
 
     /* A helper function... */
     void C_modifier(void) {
-      if (search_expression_type->is_bool_type(default_variable_name.current_type)) {
-        s4o.print("if (");
-        this->default_variable_name.accept(*this);
-        s4o.print(") ");
-      }
-      else {ERROR;}
+      if (!get_datatype_info_c::is_BOOL_compatible(implicit_variable_current.datatype)) ERROR;
+      s4o.print("if (");
+      this->implicit_variable_current.accept(*this);
+      s4o.print(") ");
     }
 
     /* A helper function... */
     void CN_modifier(void) {
-      if (search_expression_type->is_bool_type(default_variable_name.current_type)) {
-        s4o.print("if (!");
-        this->default_variable_name.accept(*this);
-        s4o.print(") ");
-      }
-      else {ERROR;}
-    }
-
-    void BYTE_operator_result_type(void) {
-      if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type)) {
-        if (search_expression_type->is_literal_integer_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lword_type);
-        else
-          this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_literal_integer_type(this->current_operand_type))
-    	  this->current_operand_type = this->default_variable_name.current_type;
-    }
-
-    void NUM_operator_result_type(void) {
-      if (search_expression_type->is_literal_real_type(this->default_variable_name.current_type)) {
-        if (search_expression_type->is_literal_integer_type(this->current_operand_type) ||
-            search_expression_type->is_literal_real_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lreal_type);
-        else
-          this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type)) {
-        if (search_expression_type->is_literal_integer_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lint_type);
-        else if (search_expression_type->is_literal_real_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lreal_type);
-        else
-          this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_literal_integer_type(this->current_operand_type) ||
-               search_expression_type->is_literal_real_type(this->current_operand_type))
-        this->current_operand_type = this->default_variable_name.current_type;
-    }
+      if (!get_datatype_info_c::is_BOOL_compatible(implicit_variable_current.datatype)) ERROR;
+      s4o.print("if (!");
+      this->implicit_variable_current.accept(*this);
+      s4o.print(") ");
+    }
+
 
     void *print_getter(symbol_c *symbol) {
       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
@@ -521,7 +446,7 @@
       symbol->accept(*this);
       s4o.print(",");
       if (negative) {
-        if (search_expression_type->is_bool_type(this->current_operand_type))
+	    if (get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype))
           s4o.print("!");
         else
           s4o.print("~");
@@ -541,12 +466,9 @@
 public:
 void *visit(il_default_variable_c *symbol) {
   symbol->var_name->accept(*this);
-  if (NULL != symbol->current_type) {
+  if (NULL != symbol->datatype) {
     s4o.print(".");
-    if      ( search_expression_type->is_literal_integer_type(symbol->current_type))                  this->lint_type.accept(*this);
-    else if ( search_expression_type->is_literal_real_type(this->default_variable_name.current_type)) this->lreal_type.accept(*this);
-    else if ( search_expression_type->is_bool_type(this->default_variable_name.current_type))         this->bool_type.accept(*this); 
-    else symbol->current_type->accept(*this);
+    symbol->datatype->accept(*this);
     s4o.print("var");
   } return NULL;
 }
@@ -554,21 +476,6 @@
 
 private:
 
-#if 0
-I NEED TO FIX THIS!!!
-TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
-void *visit(eno_param_c *symbol) {
-  if (this->is_variable_prefix_null()) {
-    s4o.print("*");
-  }
-  else {
-    this->print_variable_prefix();
-  }
-  s4o.print("ENO");
-  return NULL;
-}
-TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
-#endif
 
 
 /********************************/
@@ -789,23 +696,17 @@
 /*| instruction_list il_instruction */
 void *visit(instruction_list_c *symbol) {
   
-  /* Declare the backup to the default variable, that will store the result
-   * of the IL operations executed inside a parenthesis...
-   */
-  declare_backup_variable();
-  
-  /* Declare the default variable, that will store the result of the IL operations... */
+  /* Declare the IL implicit variable, that will store the result of the IL operations... */
+  declare_implicit_variable();
+
+  /* Declare the backup to the IL implicit variable, that will store the result of the IL operations executed inside a parenthesis... */
+  declare_implicit_variable_back();
+  /*
   s4o.print(s4o.indent_spaces);
-  s4o.print(IL_DEFVAR_T);
-  s4o.print(" ");
-  this->default_variable_name.accept(*this);
-  s4o.print(";\n");
-  s4o.print(s4o.indent_spaces);
-  print_backup_variable();
+  this->implicit_variable_result_back.accept(*this);
   s4o.print(".INTvar = 0;\n\n");
-
+  */
   print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
-
   return NULL;
 }
 
@@ -813,32 +714,32 @@
 /* | label ':' [il_incomplete_instruction] eol_list */
 // SYM_REF2(il_instruction_c, label, il_instruction)
 void *visit(il_instruction_c *symbol) {
+  /* all previous IL instructions should have the same datatype (checked in stage3), so we get the datatype from the first previous IL instruction we find */
+  implicit_variable_current.datatype = (symbol->prev_il_instruction.empty())? NULL : symbol->prev_il_instruction[0]->datatype;
+  implicit_variable_result .datatype = symbol->datatype;
+  
   if (NULL != symbol->label) {
     symbol->label->accept(*this);
     s4o.print(":\n");
     s4o.print(s4o.indent_spaces);
   }
+
   if (NULL != symbol->il_instruction) {
     symbol->il_instruction->accept(*this);
   }  
-  return NULL;
-}
+  
+  implicit_variable_result .datatype = NULL;
+  implicit_variable_current.datatype = NULL;
+  return NULL;
+}
+
 
 /* | il_simple_operator [il_operand] */
 //SYM_REF2(il_simple_operation_c, il_simple_operator, il_operand)
 void *visit(il_simple_operation_c *symbol) {
   this->current_operand = symbol->il_operand;
-  if (NULL == this->current_operand) {
-    this->current_operand_type = NULL;
-  } else {
-    this->current_operand_type = search_expression_type->get_type(this->current_operand);
-    if (NULL == this->current_operand_type) ERROR;
-  }
-
   symbol->il_simple_operator->accept(*this);
-
   this->current_operand = NULL;
-  this->current_operand_type = NULL;
   return NULL;
 }
 
@@ -851,19 +752,11 @@
   symbol_c* function_type_suffix = NULL;
   DECLARE_PARAM_LIST()
   
-  symbol_c *param_data_type = default_variable_name.current_type;
-  symbol_c *return_data_type = NULL;
-  
   function_call_param_iterator_c function_call_param_iterator(symbol);
 
   function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
   if (f_decl == NULL) ERROR;
 
-  /* determine the base data type returned by the function being called... */
-  search_base_type_c search_base_type;
-  return_data_type = (symbol_c *)f_decl->type_name->accept(search_base_type);
-  if (NULL == return_data_type) ERROR;
-
   function_name = symbol->function_name;
   
   /* loop through each function parameter, find the value we should pass
@@ -871,7 +764,7 @@
    */
   function_param_iterator_c fp_iterator(f_decl);
   identifier_c *param_name;
-    /* flag to remember whether we have already used the value stored in the default variable to pass to the first parameter */
+    /* flag to remember whether we have already used the value stored in the implicit variable to pass to the first parameter */
   bool used_defvar = false; 
     /* flag to cirreclty handle calls to extensible standard functions (i.e. functions with variable number of input parameters) */
   bool found_first_extensible_parameter = false;  
@@ -922,13 +815,14 @@
 
     /* if it is the first parameter in a non-formal function call (which is the
      * case being handled!), semantics specifies that we should
-     * get the value off the IL default variable!
+     * get the value off the IL implicit variable!
      *
      * However, if the parameter is an implicitly defined EN or ENO parameter, we should not
-     * use the default variable as a source of data to pass to those parameters!
+     * use the IL implicit variable as a source of data to pass to those parameters!
      */
     if ((param_value == NULL) &&  (!used_defvar) && !fp_iterator.is_en_eno_param_implicit()) {
-      param_value = &this->default_variable_name;
+      if (NULL == implicit_variable_current.datatype) ERROR;
+      param_value = &this->implicit_variable_current;
       used_defvar = true;
     }
 
@@ -969,22 +863,20 @@
   }
 
   /* Check whether we are calling an overloaded function! */
-  /* (fdecl_mutiplicity==2)  => calling overloaded function */
-  int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
+  /* (fdecl_mutiplicity > 1)  => calling overloaded function */
+  int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
   if (fdecl_mutiplicity == 0) ERROR;
 
-  default_variable_name.current_type = return_data_type;
-  this->default_variable_name.accept(*this);
-  default_variable_name.current_type = param_data_type;
+  this->implicit_variable_result.accept(*this);
   s4o.print(" = ");
     
   if (function_type_prefix != NULL) {
     s4o.print("(");
-    search_expression_type->default_literal_type(function_type_prefix)->accept(*this);
+    default_literal_type(function_type_prefix)->accept(*this);
     s4o.print(")");
   }
   if (function_type_suffix != NULL) {
-    function_type_suffix = search_expression_type->default_literal_type(function_type_suffix);
+    function_type_suffix = default_literal_type(function_type_suffix);
   }
   if (has_output_params) {
     fcall_number++;
@@ -992,7 +884,7 @@
     fbname->accept(*this);
     s4o.print("_");
     function_name->accept(*this);
-    if (fdecl_mutiplicity == 2) {
+    if (fdecl_mutiplicity > 1) {
       /* function being called is overloaded! */
       s4o.print("__");
       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
@@ -1003,7 +895,7 @@
   else {
     if (function_name != NULL) {
           function_name->accept(*this);
-          if (fdecl_mutiplicity == 2) {
+          if (fdecl_mutiplicity > 1) {
             /* function being called is overloaded! */
             s4o.print("__");
             print_function_parameter_data_types_c overloaded_func_suf(&s4o);
@@ -1027,14 +919,14 @@
           s4o.print(",\n"+s4o.indent_spaces);
         if (param_value == NULL) {
           /* If not, get the default value of this variable's type */
-          param_value = (symbol_c *)current_param_type->accept(*type_initial_value_c::instance());
+          param_value = type_initial_value_c::get(current_param_type);
         }
         if (param_value == NULL) ERROR;
         s4o.print("(");
-        if (search_expression_type->is_literal_integer_type(current_param_type))
-          search_expression_type->lint_type_name.accept(*this);
-        else if (search_expression_type->is_literal_real_type(current_param_type))
-          search_expression_type->lreal_type_name.accept(*this);
+        if (get_datatype_info_c::is_ANY_INT_literal(current_param_type))
+          get_datatype_info_c::lint_type_name.accept(*this);
+        else if (get_datatype_info_c::is_ANY_REAL_literal(current_param_type))
+          get_datatype_info_c::lreal_type_name.accept(*this);
         else
           current_param_type->accept(*this);
         s4o.print(")");
@@ -1069,8 +961,6 @@
   }
   
   s4o.print(")");
-  /* the data type returned by the function, and stored in the il default variable... */
-  default_variable_name.current_type = return_data_type;
 
   CLEAR_PARAM_LIST()
 
@@ -1081,60 +971,52 @@
 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
 //SYM_REF4(il_expression_c, il_expr_operator, il_operand, simple_instr_list, unused)
 void *visit(il_expression_c *symbol) {
-  /* We will be recursevely interpreting an instruction list,
-   * so we store a backup of the data type of the value currently stored
-   * in the default variable, and set the current data type to NULL
+  LD_operator_c           *tmp_LD_operator           = NULL;
+  il_simple_operation_c   *tmp_il_simple_operation   = NULL;
+  il_simple_instruction_c *tmp_il_simple_instruction = NULL;
+  
+  /* We will be recursevely interpreting an instruction list, so we store a backup of the implicit_variable_result/current.
+   * Notice that they will be overwriten while processing the parenthsized instruction list.
    */
-  symbol_c *old_current_default_variable_data_type = this->default_variable_name.current_type;
-  this->default_variable_name.current_type = NULL;
-
- /* Pass the symbol->il_operand to the simple_instr_list visitor
-  * using the il_default_variable_init_value parameter...
-  * Note that the simple_instr_list_c visitor will set this parameter
-  * to NULL as soon as it does not require it any longer,
-  * so we don't do it here again after the
-  *   symbol->simple_instr_list->accept(*this);
-  * returns...
-  */
-  this->il_default_variable_init_value = symbol->il_operand;
+  il_default_variable_c old_implicit_variable_current = this->implicit_variable_current;
+  il_default_variable_c old_implicit_variable_result  = this->implicit_variable_result;
+
+  /* Stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list if necessary. We can therefore ignore the 'il_operand' entry! */
+  //if (NULL != symbol->il_operand) { do nothing!! }
 
   /* Now do the parenthesised instructions... */
-  /* NOTE: the following code line will get the variable
-   * this->default_variable_name.current_type updated!
-   */
+  /* NOTE: the following code line will overwrite the variables implicit_variable_current and implicit_variable_result */
   symbol->simple_instr_list->accept(*this);
-
+  
   /* Now do the operation, using the previous result! */
-  /* NOTE: The result of the previous instruction list will be stored
+  /* NOTE: The result of the previous instruction list in the parenthesis will be stored
    * in a variable named IL_DEFVAR_BACK. This is done in the visitor
    * to instruction_list_c objects...
    */
-  this->current_operand = &(this->default_variable_back_name);
-  this->current_operand_type = this->default_variable_back_name.current_type;
-
-  this->default_variable_name.current_type = old_current_default_variable_data_type;
-  if (NULL == this->current_operand_type) ERROR;
+  this->implicit_variable_result_back.datatype = symbol->simple_instr_list->datatype;
+  this->current_operand = &(this->implicit_variable_result_back);
+
+  this->implicit_variable_current = old_implicit_variable_current;
+  this->implicit_variable_result  = old_implicit_variable_result;
 
   symbol->il_expr_operator->accept(*this);
 
   this->current_operand = NULL;
-  this->current_operand_type = NULL;
-  this->default_variable_back_name.current_type = NULL;
-  return NULL;
-}
+  this->implicit_variable_result_back.datatype = NULL;
+  return NULL;
+}
+
 
 /*  il_jump_operator label */
 // SYM_REF2(il_jump_operation_c, il_jump_operator, label)
 void *visit(il_jump_operation_c *symbol) {
- /* Pass the symbol->label to the il_jump_operation visitor
-  * using the jump_label parameter...
-  */
+ /* Pass the symbol->label to the il_jump_operation visitor using the jump_label parameter... */
   this->jump_label = symbol->label;
   symbol->il_jump_operator->accept(*this);
   this->jump_label = NULL;
-
-  return NULL;
-}
+  return NULL;
+}
+
 
 /*   il_call_operator prev_declared_fb_name
  * | il_call_operator prev_declared_fb_name '(' ')'
@@ -1262,18 +1144,11 @@
   symbol_c* function_type_suffix = NULL;
   DECLARE_PARAM_LIST()
 
-  symbol_c *return_data_type = NULL;
-
   function_call_param_iterator_c function_call_param_iterator(symbol);
 
   function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
   if (f_decl == NULL) ERROR;
         
-  /* determine the base data type returned by the function being called... */
-  search_base_type_c search_base_type;
-  return_data_type = (symbol_c *)f_decl->type_name->accept(search_base_type);
-  if (NULL == return_data_type) ERROR;
-  
   function_name = symbol->function_name;
 
   /* loop through each function parameter, find the value we should pass
@@ -1377,24 +1252,23 @@
   }
 
   /* Check whether we are calling an overloaded function! */
-  /* (fdecl_mutiplicity==2)  => calling overloaded function */
-  int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
+  /* (fdecl_mutiplicity > 1)  => calling overloaded function */
+  int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
   if (fdecl_mutiplicity == 0) ERROR;
   if (fdecl_mutiplicity == 1) 
     /* function being called is NOT overloaded! */
     f_decl = NULL; 
 
-  default_variable_name.current_type = return_data_type;
-  this->default_variable_name.accept(*this);
+  this->implicit_variable_result.accept(*this);
   s4o.print(" = ");
   
   if (function_type_prefix != NULL) {
     s4o.print("(");
-    search_expression_type->default_literal_type(function_type_prefix)->accept(*this);
+    default_literal_type(function_type_prefix)->accept(*this);
     s4o.print(")");
   }
   if (function_type_suffix != NULL) {
-    function_type_suffix = search_expression_type->default_literal_type(function_type_suffix);
+    function_type_suffix = default_literal_type(function_type_suffix);
   }
   if (has_output_params) {
     fcall_number++;
@@ -1402,7 +1276,7 @@
     fbname->accept(*this);
     s4o.print("_");
     function_name->accept(*this);
-    if (fdecl_mutiplicity == 2) {
+    if (fdecl_mutiplicity > 1) {
       /* function being called is overloaded! */
       s4o.print("__");
       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
@@ -1413,7 +1287,7 @@
   else {
     if (function_name != NULL) {
       function_name->accept(*this);
-      if (fdecl_mutiplicity == 2) {
+      if (fdecl_mutiplicity > 1) {
         /* function being called is overloaded! */
         s4o.print("__");
         print_function_parameter_data_types_c overloaded_func_suf(&s4o);
@@ -1436,14 +1310,14 @@
           s4o.print(",\n"+s4o.indent_spaces);
         if (param_value == NULL) {
           /* If not, get the default value of this variable's type */
-          param_value = (symbol_c *)current_param_type->accept(*type_initial_value_c::instance());
+          param_value = type_initial_value_c::get(current_param_type);
         }
         if (param_value == NULL) ERROR;
         s4o.print("(");
-        if (search_expression_type->is_literal_integer_type(current_param_type))
-          search_expression_type->lint_type_name.accept(*this);
-        else if (search_expression_type->is_literal_real_type(current_param_type))
-          search_expression_type->lreal_type_name.accept(*this);
+        if      (get_datatype_info_c::is_ANY_INT_literal(current_param_type))
+                 get_datatype_info_c::lint_type_name.accept(*this);
+        else if (get_datatype_info_c::is_ANY_REAL_literal(current_param_type))
+                 get_datatype_info_c::lreal_type_name.accept(*this);
         else
           current_param_type->accept(*this);
         s4o.print(")");
@@ -1478,7 +1352,6 @@
 
   // symbol->parameter_assignment->accept(*this);
   s4o.print(")");
-  /* the data type returned by the function, and stored in the il default variable... */
 
   CLEAR_PARAM_LIST()
 
@@ -1494,8 +1367,7 @@
 /* | simple_instr_list il_simple_instruction */
 // SYM_LIST(simple_instr_list_c)
 void *visit(simple_instr_list_c *symbol) {
-  /* A simple_instr_list_c is used to store a list of il operations
-   * being done within parenthesis...
+  /* A simple_instr_list_c is used to store a list of il operations being done within parenthesis...
    *
    * e.g.:
    *         LD var1
@@ -1504,11 +1376,12 @@
    *         OR var4
    *         )
    *
+   * NOTE 1:
    * This will be converted to C++ by defining a new scope
-   * with a new il default variable, and executing the il operands
+   * with a new il implicit variable, and executing the il operands
    * within this new scope.
    * At the end of the scope the result, i.e. the value currently stored
-   * in the il default variable is copied to the variable used to take this
+   * in the il implicit variable is copied to the variable used to take this
    * value to the outside scope...
    *
    * The above example will result in the following C++ code:
@@ -1529,59 +1402,31 @@
    *
    * }
    *
-   *  The intial value of the il default variable (in the above
-   * example 'var2') is passed to this simple_instr_list_c visitor
-   * using the il_default_variable_init_value parameter.
-   * Since it is possible to have parenthesis inside other parenthesis
-   * recursively, we reset the il_default_variable_init_value to NULL
-   * as soon as we no longer require it, as it may be used once again
-   * in the line
-   *  print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
-   *
+   * NOTE 2:
+   *  If the intial value of the il implicit variable (in the above
+   * example 'var2') exists, then stage2 will insert an equivalent
+   * LD operation into the parenthesized instruction list. This means we do not
+   * need to do anything here to handle this special situation!
    */
 
-  /* Declare the default variable, that will store the result of the IL operations... */
+  /* Declare the IL implicit variable, that will store the result of the IL operations... */
   s4o.print("{\n");
   s4o.indent_right();
-
-  s4o.print(s4o.indent_spaces);
-  s4o.print(IL_DEFVAR_T);
-  s4o.print(" ");
-  this->default_variable_name.accept(*this);
-  s4o.print(";\n\n");
-
-  /* Check whether we should initiliase the il default variable... */
-  if (NULL != this->il_default_variable_init_value) {
-    /* Yes, we must... */
-    /* We will do it by instatiating a LD operator, and having this
-     * same generate_c_il_c class visiting it!
-     */
-    LD_operator_c ld_oper;
-    il_simple_operation_c il_simple_oper(&ld_oper, this->il_default_variable_init_value);
-
-    s4o.print(s4o.indent_spaces);
-    il_simple_oper.accept(*this);
-    s4o.print(";\n");
-  }
-
-  /* this parameter no longer required... */
-  this->il_default_variable_init_value = NULL;
-
+  declare_implicit_variable();
+    
   print_list(symbol, s4o.indent_spaces, ";\n" + s4o.indent_spaces, ";\n");
 
-  /* copy the result in the default variable to the variable
-   * used to pass the data out to the scope enclosing
-   * the current scope!
-   *
-   * We also need to update the data type currently stored within
-   * the variable used to pass the data to the outside scope...
+  /* copy the result in the IL implicit variable to the variable
+   * used to pass the data out to the scope enclosing the current scope!
    */
-  this->default_variable_back_name.current_type = this->default_variable_name.current_type;
+  this->implicit_variable_result_back.datatype = symbol->datatype;
+  this->implicit_variable_result     .datatype = symbol->datatype;
+
   s4o.print("\n");
   s4o.print(s4o.indent_spaces);
-  this->default_variable_back_name.accept(*this);
+  this->implicit_variable_result_back.accept(*this);
   s4o.print(" = ");
-  this->default_variable_name.accept(*this);
+  this->implicit_variable_result.accept(*this);
   s4o.print(";\n");
 
   s4o.indent_left();
@@ -1591,25 +1436,35 @@
   return NULL;
 }
 
+
 // SYM_REF1(il_simple_instruction_c, il_simple_instruction, symbol_c *prev_il_instruction;)
 void *visit(il_simple_instruction_c *symbol) {
-  return symbol->il_simple_instruction->accept(*this);
+  /* all previous IL instructions should have the same datatype (checked in stage3), so we get the datatype from the first previous IL instruction we find */
+  implicit_variable_current.datatype = (symbol->prev_il_instruction.empty())? NULL : symbol->prev_il_instruction[0]->datatype;
+  implicit_variable_result .datatype = symbol->datatype;
+  
+  symbol->il_simple_instruction->accept(*this);
+  
+  implicit_variable_result .datatype = NULL;
+  implicit_variable_current.datatype = NULL;
+  return NULL;
 }
 
 
 /* | il_initial_param_list il_param_instruction */
 // SYM_LIST(il_param_list_c)
-void *visit(il_param_list_c *symbol) {ERROR; return NULL;} // should never get called!
+void *visit(il_param_list_c *symbol)            {ERROR; return NULL;} // should never get called!
 
 /*  il_assign_operator il_operand
  * | il_assign_operator '(' eol_list simple_instr_list ')'
  */
 // SYM_REF4(il_param_assignment_c, il_assign_operator, il_operand, simple_instr_list, unused)
-void *visit(il_param_assignment_c *symbol) {ERROR; return NULL;} // should never get called!
+void *visit(il_param_assignment_c *symbol)      {ERROR; return NULL;} // should never get called!
 
 /*  il_assign_out_operator variable */
 // SYM_REF2(il_param_out_assignment_c, il_assign_out_operator, variable);
-void *visit(il_param_out_assignment_c *symbol) {ERROR; return NULL;} // should never get called!
+void *visit(il_param_out_assignment_c *symbol)  {ERROR; return NULL;} // should never get called!
+
 
 /*******************/
 /* B 2.2 Operators */
@@ -1620,59 +1475,46 @@
     s4o.print("LD");
     return NULL;
   }
-
-  /* the data type resulting from this operation... */
-  this->default_variable_name.current_type = this->current_operand_type;
-  XXX_operator(&(this->default_variable_name), " = ", this->current_operand);
-  return NULL;
-}
+  XXX_operator(&(this->implicit_variable_result), " = ", this->current_operand);
+  return NULL;
+}
+
 
 void *visit(LDN_operator_c *symbol) {
-  /* the data type resulting from this operation... */
-  this->default_variable_name.current_type = this->current_operand_type;
-  XXX_operator(&(this->default_variable_name),
-               search_expression_type->is_bool_type(this->current_operand_type)?" = !":" = ~",
-               this->current_operand);
-  return NULL;
-}
+  XXX_operator(&(this->implicit_variable_result), get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype)?" = !":" = ~", this->current_operand);
+  return NULL;
+}
+
 
 void *visit(ST_operator_c *symbol) {
-  symbol_c *operand_type = search_varfb_instance_type->get_type_id(this->current_operand);
-  if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type) ||
-      search_expression_type->is_literal_real_type(this->default_variable_name.current_type))
-      this->default_variable_name.current_type = this->current_operand_type;
   if (this->is_variable_prefix_null()) {
     this->current_operand->accept(*this);
     s4o.print(" = ");
-    print_check_function(operand_type, (symbol_c*)&(this->default_variable_name));
+    print_check_function(this->current_operand->datatype, (symbol_c*)&(this->implicit_variable_current));
   }
   else {
-    print_setter(this->current_operand, operand_type, (symbol_c*)&(this->default_variable_name));
-  }
-  /* the data type resulting from this operation is unchanged. */
-  return NULL;
-}
+    print_setter(this->current_operand, this->current_operand->datatype, (symbol_c*)&(this->implicit_variable_current));
+  }
+  return NULL;
+}
+
 
 void *visit(STN_operator_c *symbol) {
-  symbol_c *operand_type = search_varfb_instance_type->get_type_id(this->current_operand);
-  if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type))
-    this->default_variable_name.current_type = this->current_operand_type;
-  
   if (this->is_variable_prefix_null()) {
     this->current_operand->accept(*this);
     s4o.print(" = ");
-    if (search_expression_type->is_bool_type(this->current_operand_type))
+    if (get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype))
       s4o.print("!");
     else
       s4o.print("~");
-    this->default_variable_name.accept(*this);
+    this->implicit_variable_current.accept(*this);
   }
   else {
-    print_setter(this->current_operand, operand_type, (symbol_c*)&(this->default_variable_name), NULL, NULL, true);
-  }
-  /* the data type resulting from this operation is unchanged. */
-  return NULL;
-}
+    print_setter(this->current_operand, this->current_operand->datatype, (symbol_c*)&(this->implicit_variable_current), NULL, NULL, true);
+  }
+  return NULL;
+}
+
 
 void *visit(NOT_operator_c *symbol) {
   /* NOTE: the standard allows syntax in which the NOT operator is followed by an optional <il_operand>
@@ -1681,13 +1523,11 @@
    *       We therefore consider it an error if an il_operand is specified!
    *       The error is caught in stage 3!
    */  
-  if ((NULL != this->current_operand) || (NULL != this->current_operand_type)) ERROR;
-  XXX_operator(&(this->default_variable_name),
-               search_expression_type->is_bool_type(this->default_variable_name.current_type)?" = !":" = ~",
-               &(this->default_variable_name));
-  /* the data type resulting from this operation is unchanged. */
-  return NULL;
-}
+  if (NULL != this->current_operand) ERROR;
+  XXX_operator(&(this->implicit_variable_result), get_datatype_info_c::is_BOOL_compatible(symbol->datatype)?" = !":" = ~", &(this->implicit_variable_current));
+  return NULL;
+}
+
 
 void *visit(S_operator_c *symbol) {
   if (wanted_variablegeneration != expression_vg) {
@@ -1695,22 +1535,21 @@
     return NULL;
   }
 
-  if ((NULL == this->current_operand) || (NULL == this->current_operand_type)) ERROR;
+  if ((NULL == this->current_operand) || (NULL == this->current_operand->datatype)) ERROR;
 
   C_modifier();
   this->current_operand->accept(*this);
   s4o.print(" = __");
-  if (search_expression_type->is_bool_type(this->current_operand_type))
+  if        (get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype)) {
     s4o.print("BOOL_LITERAL(TRUE)");
-  else if (search_expression_type->is_integer_type(this->current_operand_type)) {
-    this->current_operand_type->accept(*this);
+  } else if (get_datatype_info_c::is_ANY_INT_compatible(this->current_operand->datatype)) {
+    this->current_operand->datatype->accept(*this);
     s4o.print("_LITERAL(1)");
-  }
-  else
+  } else
     ERROR;
-  /* the data type resulting from this operation is unchanged! */
-  return NULL;
-}
+  return NULL;
+}
+
 
 void *visit(R_operator_c *symbol) {
   if (wanted_variablegeneration != expression_vg) {
@@ -1718,252 +1557,106 @@
     return NULL;
   }
 
-  if ((NULL == this->current_operand) || (NULL == this->current_operand_type)) ERROR;
+  if ((NULL == this->current_operand) || (NULL == this->current_operand->datatype)) ERROR;
 
   C_modifier();
   this->current_operand->accept(*this);
   s4o.print(" = __");
-  if (search_expression_type->is_bool_type(this->current_operand_type))
+  if        (get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype)) {
     s4o.print("BOOL_LITERAL(FALSE)");
-  else if (search_expression_type->is_integer_type(this->current_operand_type)) {
-    this->current_operand_type->accept(*this);
+  } else if (get_datatype_info_c::is_ANY_INT_compatible(this->current_operand->datatype)) {
+    this->current_operand->datatype->accept(*this);
     s4o.print("_LITERAL(0)");
-  }
-  else
+  } else
     ERROR;
   /* the data type resulting from this operation is unchanged! */
   return NULL;
 }
 
-void *visit(S1_operator_c *symbol)	{return XXX_CAL_operator("S1", this->current_operand);}
-void *visit(R1_operator_c *symbol)	{return XXX_CAL_operator("R1", this->current_operand);}
+
+void *visit( S1_operator_c *symbol)	{return XXX_CAL_operator( "S1", this->current_operand);}
+void *visit( R1_operator_c *symbol)	{return XXX_CAL_operator( "R1", this->current_operand);}
 void *visit(CLK_operator_c *symbol)	{return XXX_CAL_operator("CLK", this->current_operand);}
-void *visit(CU_operator_c *symbol)	{return XXX_CAL_operator("CU", this->current_operand);}
-void *visit(CD_operator_c *symbol)	{return XXX_CAL_operator("CD", this->current_operand);}
-void *visit(PV_operator_c *symbol)	{return XXX_CAL_operator("PV", this->current_operand);}
-void *visit(IN_operator_c *symbol)	{return XXX_CAL_operator("IN", this->current_operand);}
-void *visit(PT_operator_c *symbol)	{return XXX_CAL_operator("PT", this->current_operand);}
+void *visit( CU_operator_c *symbol)	{return XXX_CAL_operator( "CU", this->current_operand);}
+void *visit( CD_operator_c *symbol)	{return XXX_CAL_operator( "CD", this->current_operand);}
+void *visit( PV_operator_c *symbol)	{return XXX_CAL_operator( "PV", this->current_operand);}
+void *visit( IN_operator_c *symbol)	{return XXX_CAL_operator( "IN", this->current_operand);}
+void *visit( PT_operator_c *symbol)	{return XXX_CAL_operator( "PT", this->current_operand);}
 
 void *visit(AND_operator_c *symbol) {
-  if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    BYTE_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " &= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (!get_datatype_info_c::is_ANY_BIT_compatible(symbol->datatype)) ERROR;
+  XXX_operator(&(this->implicit_variable_result), " &= ", this->current_operand);
   return NULL;
 }
 
 void *visit(OR_operator_c *symbol) {
-  if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    BYTE_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " |= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (!get_datatype_info_c::is_ANY_BIT_compatible(symbol->datatype)) ERROR;
+  XXX_operator(&(this->implicit_variable_result), " |= ", this->current_operand);
   return NULL;
 }
 
 void *visit(XOR_operator_c *symbol) {
-  if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    BYTE_operator_result_type();
-    // '^' is a bit by bit exclusive OR !! Also seems to work with boolean types!
-    XXX_operator(&(this->default_variable_name), " ^= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (!get_datatype_info_c::is_ANY_BIT_compatible(symbol->datatype)) ERROR;
+  // '^' is a bit by bit exclusive OR !! Also seems to work with boolean types!
+  XXX_operator(&(this->implicit_variable_result), " ^= ", this->current_operand);
   return NULL;
 }
 
 void *visit(ANDN_operator_c *symbol) {
-  if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    BYTE_operator_result_type();
-    XXX_operator(&(this->default_variable_name),
-                 search_expression_type->is_bool_type(this->current_operand_type)?" &= !":" &= ~",
-                 this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (!get_datatype_info_c::is_ANY_BIT_compatible(symbol->datatype)) ERROR;
+  XXX_operator(&(this->implicit_variable_result), get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype)?" &= !":" &= ~", this->current_operand);
   return NULL;
 }
 
 void *visit(ORN_operator_c *symbol) {
-  if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    BYTE_operator_result_type();
-    XXX_operator(&(this->default_variable_name),
-                 search_expression_type->is_bool_type(this->current_operand_type)?" |= !":" |= ~",
-                 this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (!get_datatype_info_c::is_ANY_BIT_compatible(symbol->datatype)) ERROR;
+  XXX_operator(&(this->implicit_variable_result), get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype)?" |= !":" |= ~", this->current_operand);
   return NULL;
 }
 
 void *visit(XORN_operator_c *symbol) {
-  if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    BYTE_operator_result_type();
-    XXX_operator(&(this->default_variable_name),
-                 // bit by bit exclusive OR !! Also seems to work with boolean types!
-                 search_expression_type->is_bool_type(this->current_operand_type)?" ^= !":" ^= ~",
-                 this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (!get_datatype_info_c::is_ANY_BIT_compatible(symbol->datatype)) ERROR;
+  // bit by bit exclusive OR !! Also seems to work with boolean types!
+  XXX_operator(&(this->implicit_variable_result), get_datatype_info_c::is_BOOL_compatible(this->current_operand->datatype)?" ^= !":" ^= ~", this->current_operand);
   return NULL;
 }
 
 void *visit(ADD_operator_c *symbol) {
-  if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_time_type(this->current_operand_type)) {
-    XXX_function("__time_add", &(this->default_variable_name), this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    NUM_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " += ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (get_datatype_info_c::is_TIME_compatible(symbol->datatype) || get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype)) 
+        XXX_function(&(this->implicit_variable_result), "__time_add", &(this->implicit_variable_current), this->current_operand);
+  else  XXX_operator(&(this->implicit_variable_result), " += ", this->current_operand);
   return NULL;
 }
 
 void *visit(SUB_operator_c *symbol) {
-  if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_time_type(this->current_operand_type)) {
-    XXX_function("__time_sub", &(this->default_variable_name), this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    NUM_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " -= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (get_datatype_info_c::is_TIME_compatible(symbol->datatype) || get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype))
+        XXX_function(&(this->implicit_variable_result), "__time_sub", &(this->implicit_variable_current), this->current_operand);
+  else  XXX_operator(&(this->implicit_variable_result), " -= ", this->current_operand);
   return NULL;
 }
 
 void *visit(MUL_operator_c *symbol) {
-  if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_integer_type(this->current_operand_type)) {
-    XXX_function("__time_mul", &(this->default_variable_name), this->current_operand);
-    /* the data type resulting from this operation is unchanged! */
-  }
-  else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    NUM_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " *= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
+  if (get_datatype_info_c::is_TIME_compatible(symbol->datatype))
+        XXX_function(&(this->implicit_variable_result), "__time_mul", &(this->implicit_variable_current), this->current_operand);
+  else  XXX_operator(&(this->implicit_variable_result), " *= ", this->current_operand);
   return NULL;
 }
 
 void *visit(DIV_operator_c *symbol) {
-  if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_integer_type(this->current_operand_type)) {
-    XXX_function("__time_div", &(this->default_variable_name), this->current_operand);
-    /* the data type resulting from this operation is unchanged! */
-  }
-  else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    NUM_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " /= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-    return NULL;
-  }
-  else {ERROR;}
-  return NULL;
-}
-
-void *visit(MOD_operator_c *symbol) {
-  if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    NUM_operator_result_type();
-    XXX_operator(&(this->default_variable_name), " %= ", this->current_operand);
-    /* the data type resulting from this operation... */
-    this->default_variable_name.current_type = this->current_operand_type;
-  }
-  else {ERROR;}
-  return NULL;
-}
-
-void *visit(GT_operator_c *symbol) {
-  if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    CMP_operator(this->current_operand, "GT_");
-  } else {
-    ERROR;
-  }
-  return NULL;
-}
-
-void *visit(GE_operator_c *symbol) {
-  if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    CMP_operator(this->current_operand, "GE_");
-  } else {
-    ERROR;
-  }
-  return NULL;
-}
-
-void *visit(EQ_operator_c *symbol) {
-  if (search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    CMP_operator(this->current_operand, "EQ_");
-  } else {
-    ERROR;
-  }
-  return NULL;
-}
-
-void *visit(LT_operator_c *symbol) {
-  if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    CMP_operator(this->current_operand, "LT_");
-  } else {
-    ERROR;
-  }
-  return NULL;
-}
-
-void *visit(LE_operator_c *symbol) {
-  if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-      search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    CMP_operator(this->current_operand, "LE_");
-  } else {
-    ERROR;
-  }
-  return NULL;
-}
-
-void *visit(NE_operator_c *symbol) {
-  if (search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-    CMP_operator(this->current_operand, "NE_");
-  } else {
-    ERROR;
-  }
-  return NULL;
-}
+  if (get_datatype_info_c::is_TIME_compatible(symbol->datatype))
+        XXX_function(&(this->implicit_variable_result), "__time_div", &(this->implicit_variable_current), this->current_operand);
+  else  XXX_operator(&(this->implicit_variable_result), " /= ", this->current_operand);
+  return NULL;
+}
+
+void *visit(MOD_operator_c *symbol)	{XXX_operator(&(this->implicit_variable_result), " %= ", this->current_operand); return NULL;}
+
+void *visit(GT_operator_c *symbol)	{CMP_operator(this->current_operand, "GT_"); return NULL;}
+void *visit(GE_operator_c *symbol)	{CMP_operator(this->current_operand, "GE_"); return NULL;}
+void *visit(EQ_operator_c *symbol)	{CMP_operator(this->current_operand, "EQ_"); return NULL;}
+void *visit(LT_operator_c *symbol)	{CMP_operator(this->current_operand, "LT_"); return NULL;}
+void *visit(LE_operator_c *symbol)	{CMP_operator(this->current_operand, "LE_"); return NULL;}
+void *visit(NE_operator_c *symbol)	{CMP_operator(this->current_operand, "NE_"); return NULL;}
 
 
 //SYM_REF0(CAL_operator_c)
@@ -2012,32 +1705,26 @@
 //SYM_REF0(JMP_operator_c)
 void *visit(JMP_operator_c *symbol) {
   if (NULL == this->jump_label) ERROR;
-
   s4o.print("goto ");
   this->jump_label->accept(*this);
-  /* the data type resulting from this operation is unchanged! */
   return NULL;
 }
 
 // SYM_REF0(JMPC_operator_c)
 void *visit(JMPC_operator_c *symbol) {
   if (NULL == this->jump_label) ERROR;
-
   C_modifier();
   s4o.print("goto ");
   this->jump_label->accept(*this);
-  /* the data type resulting from this operation is unchanged! */
   return NULL;
 }
 
 // SYM_REF0(JMPCN_operator_c)
 void *visit(JMPCN_operator_c *symbol) {
   if (NULL == this->jump_label) ERROR;
-
   CN_modifier();
   s4o.print("goto ");
   this->jump_label->accept(*this);
-  /* the data type resulting from this operation is unchanged! */
   return NULL;
 }
 
@@ -2103,5 +1790,5 @@
   this->var_name = new identifier_c(var_name_str);
   if (NULL == this->var_name) ERROR;
 
-  this->current_type = current_type;
-}
+  this->datatype = current_type;
+}
--- a/stage4/generate_c/generate_c_inlinefcall.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_inlinefcall.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -1,7 +1,7 @@
 /*
  *  matiec - a compiler for the programming languages defined in IEC 61131-3
  *
- *  Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
+ *  Copyright (C) 2003-2012  Mario de Sousa (msousa@fe.up.pt)
  *  Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
  *
  *  This program is free software: you can redistribute it and/or modify
@@ -37,39 +37,6 @@
     } variablegeneration_t;
 
   private:
-
-    /* The initial value that should be given to the IL default variable
-     * imediately after a parenthesis is opened.
-     * This variable is only used to pass data from the
-     * il_expression_c visitor to the simple_instr_list_c visitor.
-     *
-     * e.g.:
-     *         LD var1
-     *         AND ( var2
-     *         OR var3
-     *         )
-     *
-     * In the above code sample, the line 'AND ( var2' constitutes
-     * an il_expression_c, where var2 should be loaded into the
-     * il default variable before continuing with the expression
-     * inside the parenthesis.
-     * Unfortunately, only the simple_instr_list_c may do the
-     * initial laoding of the var2 bariable following the parenthesis,
-     * so the il_expression_c visitor will have to pass 'var2' as a
-     * parameter to the simple_instr_list_c visitor.
-     * Ergo, the existance of the following parameter...!
-     */
-    symbol_c *il_default_variable_init_value;
-
-    /* Operand to the IL operation currently being processed... */
-    /* These variables are used to pass data from the
-     * il_simple_operation_c and il_expression_c visitors
-     * to the il operator visitors (i.e. LD_operator_c,
-     * LDN_operator_c, ST_operator_c, STN_operator_c, ...)
-     */
-    symbol_c *current_operand;
-    symbol_c *current_operand_type;
-
      /* The result of the comparison IL operations (GT, EQ, LT, ...)
      * is a boolean variable.
      * This class keeps track of the current data type stored in the
@@ -94,8 +61,7 @@
      * scope ...
      */
     #define IL_DEFVAR_BACK   VAR_LEADER "IL_DEFVAR_BACK"
-    il_default_variable_c default_variable_name;
-    il_default_variable_c default_variable_back_name;
+    il_default_variable_c implicit_variable_current;
 
     symbol_c* current_array_type;
 
@@ -103,29 +69,20 @@
     bool generating_inlinefunction;
     symbol_c *fbname;
 
-    search_expression_type_c *search_expression_type;
-
     search_varfb_instance_type_c *search_varfb_instance_type;
     search_var_instance_decl_c   *search_var_instance_decl;
 
-    search_base_type_c search_base_type;
-
     variablegeneration_t wanted_variablegeneration;
 
   public:
     generate_c_inlinefcall_c(stage4out_c *s4o_ptr, symbol_c *name, symbol_c *scope, const char *variable_prefix = NULL)
     : generate_c_typedecl_c(s4o_ptr),
-      default_variable_name(IL_DEFVAR, NULL),
-      default_variable_back_name(IL_DEFVAR_BACK, NULL)
+      implicit_variable_current(IL_DEFVAR, NULL)
     {
-      search_expression_type = new search_expression_type_c(scope);
       search_varfb_instance_type = new search_varfb_instance_type_c(scope);
-      search_var_instance_decl   = new search_var_instance_decl_c(scope);
+      search_var_instance_decl   = new search_var_instance_decl_c  (scope);
       
       this->set_variable_prefix(variable_prefix);
-      current_operand = NULL;
-      current_operand_type = NULL;
-      il_default_variable_init_value = NULL;
       fcall_number = 0;
       fbname = name;
       wanted_variablegeneration = expression_vg;
@@ -133,7 +90,6 @@
     }
 
     virtual ~generate_c_inlinefcall_c(void) {
-      delete search_expression_type;
       delete search_varfb_instance_type;
       delete search_var_instance_decl;
     }
@@ -158,9 +114,9 @@
       generating_inlinefunction = true;
 
       fcall_number++;
-      function_type_prefix = search_expression_type->default_literal_type(function_type_prefix);
+      function_type_prefix = default_literal_type(function_type_prefix);
       if (function_type_suffix) {
-        function_type_suffix = search_expression_type->default_literal_type(function_type_suffix);
+        function_type_suffix = default_literal_type(function_type_suffix);
       }
 
       s4o.print(s4o.indent_spaces);
@@ -185,7 +141,7 @@
 
       PARAM_LIST_ITERATOR() {
         if (PARAM_DIRECTION == function_param_iterator_c::direction_in) {
-          search_expression_type->default_literal_type(PARAM_TYPE)->accept(*this);
+          default_literal_type(PARAM_TYPE)->accept(*this);
           s4o.print(" ");
           PARAM_NAME->accept(*this);
           s4o.print(",\n" + s4o.indent_spaces);
@@ -271,46 +227,18 @@
     }
 
   private:
-
-    /* A helper function... */
-    void CMP_operator_result_type() {
-      /* the data type resulting from this operation... */
-      this->default_variable_name.current_type = &(this->bool_type);
-    }
-
-    /* A helper function... */
-    void BYTE_operator_result_type(void) {
-      if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type)) {
-        if (search_expression_type->is_literal_integer_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lword_type);
-        else
-          this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_literal_integer_type(this->current_operand_type))
-          this->current_operand_type = this->default_variable_name.current_type;
-    }
-
-    /* A helper function... */
-    void NUM_operator_result_type(void) {
-      if (search_expression_type->is_literal_real_type(this->default_variable_name.current_type)) {
-        if (search_expression_type->is_literal_integer_type(this->current_operand_type) ||
-            search_expression_type->is_literal_real_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lreal_type);
-        else
-          this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_literal_integer_type(this->default_variable_name.current_type)) {
-        if (search_expression_type->is_literal_integer_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lint_type);
-        else if (search_expression_type->is_literal_real_type(this->current_operand_type))
-          this->default_variable_name.current_type = &(this->lreal_type);
-        else
-          this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_literal_integer_type(this->current_operand_type) ||
-               search_expression_type->is_literal_real_type(this->current_operand_type))
-        this->current_operand_type = this->default_variable_name.current_type;
-    }
+    /* a small helper function */
+    symbol_c *default_literal_type(symbol_c *symbol) {
+      if (get_datatype_info_c::is_ANY_INT_literal(symbol)) {
+        return &get_datatype_info_c::lint_type_name;
+      }
+      else if (get_datatype_info_c::is_ANY_REAL_literal(symbol)) {
+        return &get_datatype_info_c::lreal_type_name;
+      }
+      return symbol;
+    }
+
+
 
     void *print_getter(symbol_c *symbol) {
       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
@@ -338,8 +266,8 @@
     }
 
     void *print_setter(symbol_c* symbol,
-            symbol_c* type,
-            symbol_c* value) {
+                       symbol_c* type,
+                       symbol_c* value) {
       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
       if (vartype == search_var_instance_decl_c::external_vt) {
         if (search_var_instance_decl->type_is_fb(symbol))
@@ -472,29 +400,21 @@
     /* | label ':' [il_incomplete_instruction] eol_list */
     // SYM_REF2(il_instruction_c, label, il_instruction)
     void *visit(il_instruction_c *symbol) {
-      if (NULL != symbol->il_instruction) {
-        symbol->il_instruction->accept(*this);
-      }
-      return NULL;
-    }
+      /* all previous IL instructions should have the same datatype (checked in stage3), so we get the datatype from the first previous IL instruction we find */
+      implicit_variable_current.datatype = (symbol->prev_il_instruction.empty())? NULL : symbol->prev_il_instruction[0]->datatype;
+      if (NULL != symbol->il_instruction)  symbol->il_instruction->accept(*this); 
+      implicit_variable_current.datatype = NULL;
+      return NULL;
+    }
+
 
     /* | il_simple_operator [il_operand] */
     //SYM_REF2(il_simple_operation_c, il_simple_operator, il_operand)
     void *visit(il_simple_operation_c *symbol) {
-      this->current_operand = symbol->il_operand;
-      if (NULL == this->current_operand) {
-        this->current_operand_type = NULL;
-      } else {
-        this->current_operand_type = search_expression_type->get_type(this->current_operand);
-        if (NULL == this->current_operand_type) ERROR;
-      }
-
       symbol->il_simple_operator->accept(*this);
-
-      this->current_operand = NULL;
-      this->current_operand_type = NULL;
-      return NULL;
-    }
+      return NULL;
+    }
+
 
     void *visit(il_function_call_c *symbol) {
       symbol_c* function_type_prefix = NULL;
@@ -502,16 +422,13 @@
       symbol_c* function_type_suffix = NULL;
       DECLARE_PARAM_LIST()
 
-      symbol_c *param_data_type = default_variable_name.current_type;
-
       function_call_param_iterator_c function_call_param_iterator(symbol);
 
       function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration;
       if (f_decl == NULL) ERROR;
       
       /* determine the base data type returned by the function being called... */
-      search_base_type_c search_base_type;
-      function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
+      function_type_prefix = search_base_type_c::get_basetype_decl(f_decl->type_name);
       
       function_name = symbol->function_name;      
       
@@ -577,7 +494,8 @@
          * use the default variable as a source of data to pass to those parameters!
          */
         if ((param_value == NULL) && (!used_defvar) && !fp_iterator.is_en_eno_param_implicit()) {
-          param_value = &this->default_variable_name;
+	  if (NULL == implicit_variable_current.datatype) ERROR;
+          param_value = &this->implicit_variable_current;
           used_defvar = true;
         }
 
@@ -617,8 +535,8 @@
       }
 
       /* Check whether we are calling an overloaded function! */
-      /* (fdecl_mutiplicity==2)  => calling overloaded function */
-      int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
+      /* (fdecl_mutiplicity > 1)  => calling overloaded function */
+      int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
       if (fdecl_mutiplicity == 0) ERROR;
       if (fdecl_mutiplicity == 1) 
         /* function being called is NOT overloaded! */
@@ -628,56 +546,33 @@
         generate_inline(function_name, function_type_prefix, function_type_suffix, param_list, f_decl);
 
       CLEAR_PARAM_LIST()
-
-      /* the data type resulting from this operation... */
-      default_variable_name.current_type = function_type_prefix;
-      return NULL;
-    }
+      return NULL;
+    }
+
+
 
     /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
     //SYM_REF4(il_expression_c, il_expr_operator, il_operand, simple_instr_list, unused)
     void *visit(il_expression_c *symbol) {
-      /* We will be recursevely interpreting an instruction list,
-       * so we store a backup of the data type of the value currently stored
-       * in the default variable, and set the current data type to NULL
+      /* We will be recursevely interpreting an instruction list, so we store a backup of the implicit_variable_result/current.
+       * Notice that they will be overwriten while processing the parenthsized instruction list.
        */
-      symbol_c *old_current_default_variable_data_type = this->default_variable_name.current_type;
-      this->default_variable_name.current_type = NULL;
-
-     /* Pass the symbol->il_operand to the simple_instr_list visitor
-      * using the il_default_variable_init_value parameter...
-      * Note that the simple_instr_list_c visitor will set this parameter
-      * to NULL as soon as it does not require it any longer,
-      * so we don't do it here again after the
-      *   symbol->simple_instr_list->accept(*this);
-      * returns...
-      */
-      this->il_default_variable_init_value = symbol->il_operand;
+      // il_default_variable_c old_implicit_variable_current = this->implicit_variable_current;      // no longer needed as we do not call symbol->il_expr_operator->accept(*this);
+      
+      /* Stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list if necessary. We can therefore ignore the 'il_operand' entry! */
+      //if (NULL != symbol->il_operand) { do nothing!! }
 
       /* Now do the parenthesised instructions... */
-      /* NOTE: the following code line will get the variable
-       * this->default_variable_name.current_type updated!
-       */
+      /* NOTE: the following code line will get the variable this->implicit_variable_current.datatype updated!  */
       symbol->simple_instr_list->accept(*this);
 
       /* Now do the operation, using the previous result! */
-      /* NOTE: The result of the previous instruction list will be stored
-       * in a variable named IL_DEFVAR_BACK. This is done in the visitor
-       * to instruction_list_c objects...
-       */
-      this->current_operand = &(this->default_variable_back_name);
-      this->current_operand_type = this->default_variable_back_name.current_type;
-
-      this->default_variable_name.current_type = old_current_default_variable_data_type;
-      if (NULL == this->current_operand_type) ERROR;
-
-      symbol->il_expr_operator->accept(*this);
-
-      this->current_operand = NULL;
-      this->current_operand_type = NULL;
-      this->default_variable_back_name.current_type = NULL;
-      return NULL;
-    }
+      /* NOTE: Actually, we do not need to call this, as it can never be a function call, which is what we are handling here... */
+      // this->implicit_variable_current.datatype = old_current_default_variable_data_type;
+      // symbol->il_expr_operator->accept(*this);
+      return NULL;
+    }
+
 
     /* | function_name '(' eol_list [il_param_list] ')' */
     // SYM_REF2(il_formal_funct_call_c, function_name, il_param_list)
@@ -693,8 +588,7 @@
       if (f_decl == NULL) ERROR;
 
       /* determine the base data type returned by the function being called... */
-      search_base_type_c search_base_type;
-      function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
+      function_type_prefix = search_base_type_c::get_basetype_decl(f_decl->type_name);
       if (NULL == function_type_prefix) ERROR;
       
       function_name = symbol->function_name;
@@ -798,8 +692,8 @@
       }
 
       /* Check whether we are calling an overloaded function! */
-      /* (fdecl_mutiplicity==2)  => calling overloaded function */
-      int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
+      /* (fdecl_mutiplicity > 1)  => calling overloaded function */
+      int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
       if (fdecl_mutiplicity == 0) ERROR;
       if (fdecl_mutiplicity == 1) 
         /* function being called is NOT overloaded! */
@@ -809,228 +703,26 @@
         generate_inline(function_name, function_type_prefix, function_type_suffix, param_list, f_decl);
 
       CLEAR_PARAM_LIST()
-
-      /* the data type resulting from this operation... */
-      default_variable_name.current_type = function_type_prefix;
-      return NULL;
-    }
+      return NULL;
+    }
+
+
 
     /* | simple_instr_list il_simple_instruction */
     // SYM_LIST(simple_instr_list_c)
-    void *visit(simple_instr_list_c *symbol) {
-      /* Check whether we should initiliase the il default variable... */
-      if (NULL != this->il_default_variable_init_value) {
-        /* Yes, we must... */
-        /* We will do it by instatiating a LD operator, and having this
-         * same generate_c_il_c class visiting it!
-         */
-        LD_operator_c ld_oper;
-        il_simple_operation_c il_simple_oper(&ld_oper, this->il_default_variable_init_value);
-
-        il_simple_oper.accept(*this);
-      }
-
-      /* this parameter no longer required... */
-      this->il_default_variable_init_value = NULL;
-
-      iterator_visitor_c::visit(symbol);
-
-      /* copy the result in the default variable to the variable
-       * used to pass the data out to the scope enclosing
-       * the current scope!
-       *
-       * We also need to update the data type currently stored within
-       * the variable used to pass the data to the outside scope...
-       */
-      this->default_variable_back_name.current_type = this->default_variable_name.current_type;
-      return NULL;
-    }
-    
+    void *visit(simple_instr_list_c *symbol) {return iterator_visitor_c::visit(symbol);}
+
+
     // SYM_REF1(il_simple_instruction_c, il_simple_instruction, symbol_c *prev_il_instruction;)
     void *visit(il_simple_instruction_c *symbol) {
-      return symbol->il_simple_instruction->accept(*this);
-    }
-
-    void *visit(LD_operator_c *symbol) {
-      /* the data type resulting from this operation... */
-      this->default_variable_name.current_type = this->current_operand_type;
-      return NULL;
-    }
-
-    void *visit(LDN_operator_c *symbol) {
-      /* the data type resulting from this operation... */
-      this->default_variable_name.current_type = this->current_operand_type;
-      return NULL;
-    }
-
-    void *visit(AND_operator_c *symbol) {
-      if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        BYTE_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(OR_operator_c *symbol) {
-      if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        BYTE_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(XOR_operator_c *symbol) {
-      if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        BYTE_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(ANDN_operator_c *symbol) {
-      if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        BYTE_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(ORN_operator_c *symbol) {
-      if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        BYTE_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(XORN_operator_c *symbol) {
-      if (search_expression_type->is_binary_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        BYTE_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(ADD_operator_c *symbol) {
-      if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_time_type(this->current_operand_type)) {
-        /* the data type resulting from this operation... */
-        this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        NUM_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(SUB_operator_c *symbol) {
-      if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_time_type(this->current_operand_type)) {
-        /* the data type resulting from this operation... */
-        this->default_variable_name.current_type = this->current_operand_type;
-      }
-      else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        NUM_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(MUL_operator_c *symbol) {
-      if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_integer_type(this->current_operand_type)) {
-        /* the data type resulting from this operation is unchanged! */
-      }
-      else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        NUM_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(DIV_operator_c *symbol) {
-      if (search_expression_type->is_time_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_integer_type(this->current_operand_type)) {
-        /* the data type resulting from this operation is unchanged! */
-      }
-      else if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        NUM_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(MOD_operator_c *symbol) {
-      if (search_expression_type->is_num_type(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        NUM_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(GT_operator_c *symbol) {
-      if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        CMP_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(GE_operator_c *symbol) {
-      if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        CMP_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(EQ_operator_c *symbol) {
-      if (search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        CMP_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(LT_operator_c *symbol) {
-      if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        CMP_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(LE_operator_c *symbol) {
-      if (!search_base_type.type_is_enumerated(this->default_variable_name.current_type) &&
-          search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        CMP_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
-
-    void *visit(NE_operator_c *symbol) {
-      if (search_expression_type->is_same_type(this->default_variable_name.current_type, this->current_operand_type)) {
-        CMP_operator_result_type();
-      }
-      else {ERROR;}
-      return NULL;
-    }
+      /* all previous IL instructions should have the same datatype (checked in stage3), so we get the datatype from the first previous IL instruction we find */
+      implicit_variable_current.datatype = (symbol->prev_il_instruction.empty())? NULL : symbol->prev_il_instruction[0]->datatype;
+      symbol->il_simple_instruction->accept(*this);
+      implicit_variable_current.datatype = NULL;
+      return NULL;      
+    }
+
+
 
     /***************************************/
     /* B.3 - Language ST (Structured Text) */
@@ -1067,8 +759,7 @@
       function_name = symbol->function_name;
 
       /* determine the base data type returned by the function being called... */
-      search_base_type_c search_base_type;
-      function_type_prefix = (symbol_c *)f_decl->type_name->accept(search_base_type);
+      function_type_prefix = search_base_type_c::get_basetype_decl(f_decl->type_name);
       if (NULL == function_type_prefix) ERROR;
 
       /* loop through each function parameter, find the value we should pass
@@ -1163,8 +854,8 @@
       }
 
       /* Check whether we are calling an overloaded function! */
-      /* (fdecl_mutiplicity==2)  => calling overloaded function */
-      int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
+      /* (fdecl_mutiplicity > 1)  => calling overloaded function */
+      int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
       if (fdecl_mutiplicity == 0) ERROR;
       if (fdecl_mutiplicity == 1) 
         /* function being called is NOT overloaded! */
--- a/stage4/generate_c/generate_c_sfc.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_sfc.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -345,7 +345,7 @@
         case transitiontestdebug_sg:
           // Transition condition is in IL
           if (symbol->transition_condition_il != NULL) {
-            generate_c_il->declare_backup_variable();
+            generate_c_il->declare_implicit_variable_back();
             s4o.print(s4o.indent_spaces);
             symbol->transition_condition_il->accept(*generate_c_il);
             s4o.print(SET_VAR);
@@ -359,8 +359,8 @@
             s4o.print("transition_list[");
             print_transition_number();
             s4o.print("],");
-            generate_c_il->print_backup_variable();
-            generate_c_il->reset_default_variable_name();
+            generate_c_il->print_implicit_variable_back();
+            // generate_c_il->reset_default_variable_name(); // generate_c_il does not require his anymore
             s4o.print(");\n");
           }
           // Transition condition is in ST
--- a/stage4/generate_c/generate_c_st.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_st.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -78,21 +78,9 @@
      */
     search_fb_instance_decl_c *search_fb_instance_decl;
 
-    /* When compiling st code, it becomes necessary to determine the
-     * data type of st expressions. To do this, we must first find the
-     * st operand's declaration, within the scope of the function block
-     * or function currently being processed.
-     * The following object does just that...
-     * This object instance will then later be called while the
-     * remaining st code is being handled.
-     */
-    search_expression_type_c *search_expression_type;
-
     search_varfb_instance_type_c *search_varfb_instance_type;
     search_var_instance_decl_c   *search_var_instance_decl;
 
-    search_base_type_c search_base_type;
-
     symbol_c* current_array_type;
     symbol_c* current_param_type;
 
@@ -107,10 +95,9 @@
   public:
     generate_c_st_c(stage4out_c *s4o_ptr, symbol_c *name, symbol_c *scope, const char *variable_prefix = NULL)
     : generate_c_typedecl_c(s4o_ptr) {
-      search_fb_instance_decl = new search_fb_instance_decl_c(scope);
-      search_expression_type = new search_expression_type_c(scope);
+      search_fb_instance_decl    = new search_fb_instance_decl_c   (scope);
       search_varfb_instance_type = new search_varfb_instance_type_c(scope);
-      search_var_instance_decl   = new search_var_instance_decl_c(scope);
+      search_var_instance_decl   = new search_var_instance_decl_c  (scope);
       
       this->set_variable_prefix(variable_prefix);
       current_array_type = NULL;
@@ -123,7 +110,6 @@
 
     virtual ~generate_c_st_c(void) {
       delete search_fb_instance_decl;
-      delete search_expression_type;
       delete search_varfb_instance_type;
       delete search_var_instance_decl;
     }
@@ -459,24 +445,16 @@
 /* B 3.1 - Expressions */
 /***********************/
 void *visit(or_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_bool_type(left_type))
+  if (get_datatype_info_c::is_BOOL_compatible(symbol->datatype))
     return print_binary_expression(symbol->l_exp, symbol->r_exp, " || ");
-  if (search_expression_type->is_binary_type(left_type))
+  if (get_datatype_info_c::is_ANY_nBIT_compatible(symbol->datatype))
     return print_binary_expression(symbol->l_exp, symbol->r_exp, " | ");
   ERROR;
   return NULL;
 }
 
 void *visit(xor_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_bool_type(left_type)) {
+  if (get_datatype_info_c::is_BOOL_compatible(symbol->datatype)) {
     s4o.print("(");
     symbol->l_exp->accept(*this);
     s4o.print(" && !");
@@ -488,197 +466,147 @@
     s4o.print(")");
     return NULL;
   }
-  if (search_expression_type->is_binary_type(left_type))
+  if (get_datatype_info_c::is_ANY_nBIT_compatible(symbol->datatype))
     return print_binary_expression(symbol->l_exp, symbol->r_exp, " ^ ");
   ERROR;
   return NULL;
 }
 
 void *visit(and_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_bool_type(left_type))
+  if (get_datatype_info_c::is_BOOL_compatible(symbol->datatype))
     return print_binary_expression(symbol->l_exp, symbol->r_exp, " && ");
-  if (search_expression_type->is_binary_type(left_type))
+  if (get_datatype_info_c::is_ANY_nBIT_compatible(symbol->datatype))
     return print_binary_expression(symbol->l_exp, symbol->r_exp, " & ");
   ERROR;
-  return NULL;
+return NULL;
 }
 
 void *visit(equ_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_time_type(left_type) ||
-      search_expression_type->is_string_type(left_type))
-    return print_compare_function("EQ_", left_type, symbol->l_exp, symbol->r_exp);
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
+    return print_compare_function("EQ_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   return print_binary_expression(symbol->l_exp, symbol->r_exp, " == ");
 }
 
 void *visit(notequ_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_time_type(left_type) ||
-      search_expression_type->is_string_type(left_type))
-    return print_compare_function("NE_", left_type, symbol->l_exp, symbol->r_exp);
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
+    return print_compare_function("NE_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   return print_binary_expression(symbol->l_exp, symbol->r_exp, " != ");
 }
 
 void *visit(lt_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_time_type(left_type) ||
-      search_expression_type->is_string_type(left_type))
-    return print_compare_function("LT_", left_type, symbol->l_exp, symbol->r_exp);
-  if (!search_base_type.type_is_enumerated(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " < ");
-  ERROR;
-  return NULL;
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
+    return print_compare_function("LT_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " < ");
 }
 
 void *visit(gt_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_time_type(left_type) ||
-      search_expression_type->is_string_type(left_type))
-    return print_compare_function("GT_", left_type, symbol->l_exp, symbol->r_exp);
-  if (!search_base_type.type_is_enumerated(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " > ");
-  ERROR;
-  return NULL;
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
+    return print_compare_function("GT_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " > ");
 }
 
 void *visit(le_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_time_type(left_type) ||
-      search_expression_type->is_string_type(left_type))
-    return print_compare_function("LE_", left_type, symbol->l_exp, symbol->r_exp);
-  if (!search_base_type.type_is_enumerated(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " <= ");
-  ERROR;
-  return NULL;
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
+    return print_compare_function("LE_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " <= ");
 }
 
 void *visit(ge_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_time_type(left_type) ||
-      search_expression_type->is_string_type(left_type))
-    return print_compare_function("GE_", left_type, symbol->l_exp, symbol->r_exp);
-  if (!search_base_type.type_is_enumerated(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " >= ");
-  ERROR;
-  return NULL;
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
+      get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
+    return print_compare_function("GE_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " >= ");
 }
 
 void *visit(add_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
+/*
+  symbol_c *left_type  = symbol->l_exp->datatype;
+  symbol_c *right_type = symbol->r_exp->datatype;
   if ((typeid(*left_type) == typeid(time_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) ||
-      (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) ||
-      (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)))
+      (typeid(*left_type) == typeid(tod_type_name_c)  && typeid(*right_type) == typeid(time_type_name_c)) ||
+      (typeid(*left_type) == typeid(dt_type_name_c)   && typeid(*right_type) == typeid(time_type_name_c)))
     return print_binary_function("__time_add", symbol->l_exp, symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_integer_type(left_type) || search_expression_type->is_real_type(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " + ");
-  ERROR;
-  return NULL;
+*/
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype))
+    return print_binary_function("__time_add", symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " + ");
 }
 
 void *visit(sub_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
+/*
+  symbol_c *left_type  = symbol->l_exp->datatype;
+  symbol_c *right_type = symbol->r_exp->datatype;
   if ((typeid(*left_type) == typeid(time_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) ||
       (typeid(*left_type) == typeid(date_type_name_c) && typeid(*right_type) == typeid(date_type_name_c)) ||
-      (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) ||
-      (typeid(*left_type) == typeid(tod_type_name_c) && typeid(*right_type) == typeid(tod_type_name_c)) ||
-      (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(time_type_name_c)) ||
-      (typeid(*left_type) == typeid(dt_type_name_c) && typeid(*right_type) == typeid(dt_type_name_c)))
+      (typeid(*left_type) == typeid(tod_type_name_c)  && typeid(*right_type) == typeid(time_type_name_c)) ||
+      (typeid(*left_type) == typeid(tod_type_name_c)  && typeid(*right_type) == typeid(tod_type_name_c))  ||
+      (typeid(*left_type) == typeid(dt_type_name_c)   && typeid(*right_type) == typeid(time_type_name_c)) ||
+      (typeid(*left_type) == typeid(dt_type_name_c)   && typeid(*right_type) == typeid(dt_type_name_c)))
     return print_binary_function("__time_sub", symbol->l_exp, symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_integer_type(left_type) || search_expression_type->is_real_type(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " - ");
-  ERROR;
-  return NULL;
+*/  
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
+      get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype))
+    return print_binary_function("__time_sub", symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " - ");
 }
 
 void *visit(mul_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if ((typeid(*left_type) == typeid(time_type_name_c) && search_expression_type->is_integer_type(right_type)) ||
-      (typeid(*left_type) == typeid(time_type_name_c) && search_expression_type->is_real_type(right_type)))
+/*
+  symbol_c *left_type  = symbol->l_exp->datatype;
+  symbol_c *right_type = symbol->r_exp->datatype;
+  if ((typeid(*left_type) == typeid(time_type_name_c) && get_datatype_info_c::is_ANY_INT_compatible (right_type)) ||
+      (typeid(*left_type) == typeid(time_type_name_c) && get_datatype_info_c::is_ANY_REAL_compatible(right_type)))
     return print_binary_function("__time_mul", symbol->l_exp, symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_integer_type(left_type) || search_expression_type->is_real_type(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " * ");
-  ERROR;
-  return NULL;
+*/  
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype))
+    return print_binary_function("__time_mul", symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " * ");
 }
 
 void *visit(div_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if ((typeid(*left_type) == typeid(time_type_name_c) && search_expression_type->is_integer_type(right_type)) ||
-      (typeid(*left_type) == typeid(time_type_name_c) && search_expression_type->is_real_type(right_type)))
+/*
+  symbol_c *left_type  = symbol->l_exp->datatype;
+  symbol_c *right_type = symbol->r_exp->datatype;
+  if ((typeid(*left_type) == typeid(time_type_name_c) && get_datatype_info_c::is_ANY_INT_compatible (right_type)) ||
+      (typeid(*left_type) == typeid(time_type_name_c) && get_datatype_info_c::is_ANY_REAL_compatible(right_type)))
     return print_binary_function("__time_div", symbol->l_exp, symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_integer_type(left_type) || search_expression_type->is_real_type(left_type))
-    return print_binary_expression(symbol->l_exp, symbol->r_exp, " / ");
-  ERROR;
-  return NULL;
+*/
+  if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype))
+    return print_binary_function("__time_div", symbol->l_exp, symbol->r_exp);
+  return print_binary_expression(symbol->l_exp, symbol->r_exp, " / ");
 }
 
 void *visit(mod_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (!search_expression_type->is_same_type(left_type, right_type))
-      ERROR;
-  if (search_expression_type->is_integer_type(left_type) || search_expression_type->is_real_type(left_type)) {
-    s4o.print("((");
-    symbol->r_exp->accept(*this);
-    s4o.print(" == 0)?0:");
-    print_binary_expression(symbol->l_exp, symbol->r_exp, " % ");
-    s4o.print(")");
-    return NULL;
-  }
-  ERROR;
+  s4o.print("((");
+  symbol->r_exp->accept(*this);
+  s4o.print(" == 0)?0:");
+  print_binary_expression(symbol->l_exp, symbol->r_exp, " % ");
+  s4o.print(")");
   return NULL;
 }
 
 void *visit(power_expression_c *symbol) {
-  symbol_c *left_type = search_expression_type->get_type(symbol->l_exp);
-  symbol_c *right_type = search_expression_type->get_type(symbol->r_exp);
-  if (search_expression_type->is_real_type(left_type) && search_expression_type->is_num_type(right_type)) {
-    s4o.print("EXPT__LREAL__LREAL__LREAL((BOOL)__BOOL_LITERAL(TRUE),\n");
-    s4o.indent_right();
-    s4o.print(s4o.indent_spaces + "NULL,\n");
-    s4o.print(s4o.indent_spaces + "(LREAL)(");
-    symbol->l_exp->accept(*this);
-    s4o.print("),\n");
-    s4o.print(s4o.indent_spaces + "(LREAL)(");
-    symbol->r_exp->accept(*this);
-    s4o.print("))");
-    return NULL;
-  }
-  ERROR;
+  s4o.print("EXPT__LREAL__LREAL__LREAL((BOOL)__BOOL_LITERAL(TRUE),\n");
+  s4o.indent_right();
+  s4o.print(s4o.indent_spaces + "NULL,\n");
+  s4o.print(s4o.indent_spaces + "(LREAL)(");
+  symbol->l_exp->accept(*this);
+  s4o.print("),\n");
+  s4o.print(s4o.indent_spaces + "(LREAL)(");
+  symbol->r_exp->accept(*this);
+  s4o.print("))");
   return NULL;
 }
 
@@ -687,11 +615,7 @@
 }
 
 void *visit(not_expression_c *symbol) {
-  symbol_c *exp_type = search_expression_type->get_type(symbol->exp);
-  if (search_expression_type->is_binary_type(exp_type))
-    return print_unary_expression(symbol->exp, search_expression_type->is_bool_type(exp_type)?"!":"~");
-  ERROR;
-  return NULL;
+  return print_unary_expression(symbol->exp, get_datatype_info_c::is_BOOL_compatible(symbol->datatype)?"!":"~");
 }
 
 void *visit(function_invocation_c *symbol) {
@@ -804,8 +728,8 @@
   }
 
   /* Check whether we are calling an overloaded function! */
-  /* (fdecl_mutiplicity==2)  => calling overloaded function */
-  int fdecl_mutiplicity =  function_symtable.multiplicity(symbol->function_name);
+  /* (fdecl_mutiplicity > 1)  => calling overloaded function */
+  int fdecl_mutiplicity =  function_symtable.count(symbol->function_name);
   if (fdecl_mutiplicity == 0) ERROR;
 
   if (has_output_params) {
@@ -814,7 +738,7 @@
     fbname->accept(*this);
     s4o.print("_");
     function_name->accept(*this);
-    if (fdecl_mutiplicity == 2) {
+    if (fdecl_mutiplicity > 1) {
       /* function being called is overloaded! */
       s4o.print("__");
       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
@@ -824,7 +748,7 @@
   }
   else {
     function_name->accept(*this);
-    if (fdecl_mutiplicity == 2) {
+    if (fdecl_mutiplicity > 1) {
       /* function being called is overloaded! */
       s4o.print("__");
       print_function_parameter_data_types_c overloaded_func_suf(&s4o);
@@ -845,14 +769,14 @@
           s4o.print(",\n"+s4o.indent_spaces);
         if (param_value == NULL) {
           /* If not, get the default value of this variable's type */
-          param_value = (symbol_c *)current_param_type->accept(*type_initial_value_c::instance());
+          param_value = type_initial_value_c::get(current_param_type);
         }
         if (param_value == NULL) ERROR;
         s4o.print("(");
-        if (search_expression_type->is_literal_integer_type(current_param_type))
-          search_expression_type->lint_type_name.accept(*this);
-        else if (search_expression_type->is_literal_real_type(current_param_type))
-          search_expression_type->lreal_type_name.accept(*this);
+        if      (get_datatype_info_c::is_ANY_INT_literal(current_param_type))
+          get_datatype_info_c::lint_type_name.accept(*this);
+        else if (get_datatype_info_c::is_ANY_REAL_literal(current_param_type))
+          get_datatype_info_c::lreal_type_name.accept(*this);
         else
           current_param_type->accept(*this);
         s4o.print(")");
@@ -1125,14 +1049,14 @@
 }
 
 void *visit(case_statement_c *symbol) {
-  symbol_c *expression_type = search_expression_type->get_type(symbol->expression);
+  symbol_c *expression_type = symbol->expression->datatype;
   s4o.print("{\n");
   s4o.indent_right();
   s4o.print(s4o.indent_spaces);
-  if (search_expression_type->is_literal_integer_type(expression_type))
-    search_expression_type->lint_type_name.accept(*this);
-  else if (search_expression_type->is_literal_real_type(expression_type))
-    search_expression_type->lreal_type_name.accept(*this);
+  if      (get_datatype_info_c::is_ANY_INT_literal(expression_type))
+           get_datatype_info_c::lint_type_name.accept(*this);
+  else if (get_datatype_info_c::is_ANY_REAL_literal(expression_type))
+           get_datatype_info_c::lreal_type_name.accept(*this);
   else
     expression_type->accept(*this);
   s4o.print(" __case_expression = ");
--- a/stage4/generate_c/generate_c_typedecl.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_typedecl.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -31,8 +31,6 @@
   private:
     symbol_c* current_type_name;
     bool array_is_derived;
-    search_base_type_c search_base_type;
-    search_constant_type_c search_constant_type;
 
     generate_c_base_c *basedecl;
 
@@ -58,7 +56,7 @@
       enumerated_td,
       subrange_td,
       array_td,
-      struct_td,
+      struct_td
     } typedefinition_t;
 
     typedefinition_t current_typedefinition;
@@ -101,7 +99,7 @@
     }
 
     bool type_is_fb(symbol_c* type_decl) {
-      return search_base_type.type_is_fb(type_decl);
+      return search_base_type_c::type_is_fb(type_decl);
     }
 
 /***************************/
@@ -210,7 +208,7 @@
           s4o.print(" value) {\n");
           s4o.indent_right();
 
-          if (search_base_type.type_is_subrange(symbol->integer_type_name)) {
+          if (search_base_type_c::type_is_subrange(symbol->integer_type_name)) {
             s4o.print(s4o.indent_spaces + "value = __CHECK_");
             symbol->integer_type_name->accept(*this);
             s4o.print("(value);\n");
@@ -319,14 +317,18 @@
 
 /* enumerated_type_name '#' identifier */
 void *visit(enumerated_value_c *symbol) {
-  symbol_c *value_type;
   if (current_typedefinition == enumerated_td)
     current_type_name->accept(*basedecl);
   else {
-    value_type = (symbol_c *)symbol->accept(search_constant_type);
-    if (value_type == NULL) ERROR;
-
-    value_type->accept(*basedecl);
+    if (NULL == symbol->datatype) {
+      debug_c::print(symbol);
+      ERROR;
+    }
+    symbol_c *type_name = get_datatype_info_c::get_id(symbol->datatype);
+    if (NULL == type_name) {
+//       ERROR_MSG("generate_c does not support anonymous enumerated data types.");
+    } else
+    type_name->accept(*basedecl);
   }
   s4o_incl.print("__");
   symbol->value->accept(*basedecl);
@@ -441,7 +443,7 @@
   symbol->simple_spec_init->accept(*this);
   s4o_incl.print(")\n");
 
-  if (search_base_type.type_is_subrange(symbol->simple_type_name)) {
+  if (search_base_type_c::type_is_subrange(symbol->simple_type_name)) {
     s4o.print("#define __CHECK_");
     current_type_name->accept(*this);
     s4o.print(" __CHECK_");
--- a/stage4/generate_c/generate_c_vardecl.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_c_vardecl.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -199,7 +199,7 @@
         case arraysize_am:
           symbol->array_subrange_list->accept(*this);
           array_base_type = symbol->non_generic_type_name;
-          array_default_value = (symbol_c *)symbol->non_generic_type_name->accept(*type_initial_value_c::instance());;
+          array_default_value = type_initial_value_c::get(symbol->non_generic_type_name);
           if (array_default_value == NULL) ERROR;
           break;
         case typedecl_am:
@@ -627,7 +627,7 @@
         
         if (element_value == NULL) {
           /* If not, get the default value of this variable's type */
-          element_value = (symbol_c *)current_element_type->accept(*type_initial_value_c::instance());
+          element_value = type_initial_value_c::get(current_element_type);
         }
         
         if (element_value == NULL) ERROR;
@@ -837,7 +837,7 @@
                   init_vf,
                   constructorinit_vf,
                   globalinit_vf,
-                  globalprototype_vf,
+                  globalprototype_vf
                  } varformat_t;
 
 
@@ -889,7 +889,7 @@
         ERROR;
       if (NULL == this->current_var_init_symbol) {
         /* We try to find the data type's default value... */
-        this->current_var_init_symbol = (symbol_c *)this->current_var_type_symbol->accept(*type_initial_value_c::instance());
+        this->current_var_init_symbol = type_initial_value_c::get(this->current_var_type_symbol);
       /* Note that Function Block 'data types' do not have a default value, so we cannot abort if no default value is found! */
       /*
       if (NULL == this->current_var_init_symbol)
--- a/stage4/generate_c/generate_location_list.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_location_list.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -30,7 +30,6 @@
   private:
     symbol_c *current_var_type_symbol;
     generate_c_base_c *generate_c_base;
-    search_base_type_c search_base_type;
     
   public:
     generate_location_list_c(stage4out_c *s4o_ptr): s4o(*s4o_ptr) {
@@ -114,7 +113,7 @@
         if (current_var_type_symbol == NULL)
           ERROR;
         
-        current_var_type_symbol = (symbol_c *)(current_var_type_symbol->accept(search_base_type));
+        current_var_type_symbol = search_base_type_c::get_basetype_decl(current_var_type_symbol);
         if (current_var_type_symbol == NULL)
           ERROR;
         
@@ -132,7 +131,7 @@
         if (current_var_type_symbol == NULL)
           ERROR;
         
-        current_var_type_symbol = (symbol_c *)(current_var_type_symbol->accept(search_base_type));
+        current_var_type_symbol = search_base_type_c::get_basetype_decl(current_var_type_symbol);
         if (current_var_type_symbol == NULL)
           ERROR;
         
--- a/stage4/generate_c/generate_var_list.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_c/generate_var_list.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -107,7 +107,6 @@
   private:
     symbol_c *current_var_type_symbol;
     symbol_c *current_var_type_name;
-    search_base_type_c search_base_type;
     search_fb_typedecl_c *search_fb_typedecl;
 
   public:
@@ -153,7 +152,7 @@
           this->current_var_type_category = function_block_vtc;
 
         else {
-          this->current_var_type_symbol = (symbol_c *)(this->current_var_type_name->accept(search_base_type));
+          this->current_var_type_symbol = search_base_type_c::get_basetype_decl(this->current_var_type_name);
           this->current_var_type_symbol->accept(*this);
         }
       }
@@ -205,7 +204,7 @@
       external_vcc,
       located_input_vcc,
       located_memory_vcc,
-      located_output_vcc,
+      located_output_vcc
     } varclasscategory_t;
 
     varclasscategory_t current_var_class_category;
@@ -330,11 +329,14 @@
           s4o.print(";\n");
           if (this->current_var_class_category != external_vcc) {
               SYMBOL *current_name;
+              symbol_c *tmp_var_type;
               current_name = new SYMBOL;
               current_name->symbol = symbol;
+              tmp_var_type = this->current_var_type_symbol;
               current_symbol_list.push_back(*current_name);
               this->current_var_type_symbol->accept(*this);
               current_symbol_list.pop_back();
+              this->current_var_type_symbol = tmp_var_type;
           }
           break;
         case search_type_symbol_c::array_vtc:
@@ -381,6 +383,40 @@
       }
     }
 
+
+/********************************/
+/* B 1.3.3 - Derived data types */
+/********************************/
+    /*  enumerated_type_name ':' enumerated_spec_init */
+    void *visit(enumerated_type_declaration_c *symbol) {
+      this->current_var_type_name->accept(*this);
+      return NULL;
+    }
+
+    /* enumerated_specification ASSIGN enumerated_value */
+    void *visit(enumerated_spec_init_c *symbol) {
+      /* search_base_type_c now returns an enumerated_type_declaration_c as the base type of a non-anonymous enumerated type
+       * (non-anonymous means it is declared inside a TYPE ... END_TYPE declaration, with a given name/identifier
+       *  unlike implicitly defined anonymous datatypes declared inside VAR ... END_VAR declarations!).
+       * This means that this method should not get called.
+       */
+      ERROR;  
+      this->current_var_type_name->accept(*this);
+      return NULL;
+    }
+
+    /* enumerated_value_list ',' enumerated_value */
+    void *visit(enumerated_value_list_c *symbol) {
+      /* search_base_type_c now returns an enumerated_type_declaration_c as the base type of a non-anonymous enumerated type
+       * (non-anonymous means it is declared inside a TYPE ... END_TYPE declaration, with a given name/identifier
+       *  unlike implicitly defined anonymous datatypes declared inside VAR ... END_VAR declarations!).
+       * This means that this method should not get called.
+       */
+      ERROR;
+      this->current_var_type_name->accept(*this);
+      return NULL;
+    }
+
 /********************************************/
 /* B.1.4.3 - Declaration and initialization */
 /********************************************/
@@ -555,12 +591,7 @@
       return NULL;
     }
 
-    /* enumerated_value_list ',' enumerated_value */
-    void *visit(enumerated_value_list_c *symbol) {
-      this->current_var_type_name->accept(*this);
-      return NULL;
-    }
-    
+
     /* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
     /* structure_initialization -> may be NULL ! */
     void *visit(fb_name_decl_c *symbol) {
--- a/stage4/generate_iec/Makefile.am	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_iec/Makefile.am	Fri Mar 08 01:01:15 2013 +0100
@@ -6,5 +6,5 @@
 
 libstage4_iec_a_LIBADD = ../stage4.o
 
-libstage4_iec_a_cppflags = -I../../../absyntax
+libstage4_iec_a_CPPFLAGS = -I../../../absyntax
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stage4/generate_iec/Makefile.in	Fri Mar 08 01:01:15 2013 +0100
@@ -0,0 +1,495 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/../../common.mk $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = stage4/generate_iec
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LIBRARIES = $(lib_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libstage4_iec_a_AR = $(AR) $(ARFLAGS)
+libstage4_iec_a_DEPENDENCIES = ../stage4.o
+am_libstage4_iec_a_OBJECTS = generate_iec.$(OBJEXT)
+libstage4_iec_a_OBJECTS = $(am_libstage4_iec_a_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(libstage4_iec_a_SOURCES)
+DIST_SOURCES = $(libstage4_iec_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused 
+lib_LIBRARIES = libstage4_iec.a
+libstage4_iec_a_SOURCES = generate_iec.cc 
+libstage4_iec_a_LIBADD = ../stage4.o
+libstage4_iec_a_cppflags = -I../../../absyntax
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../../common.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign stage4/generate_iec/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign stage4/generate_iec/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../../common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  if test -f $$p; then \
+	    $(am__strip_dir) \
+	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+libstage4_iec.a: $(libstage4_iec_a_OBJECTS) $(libstage4_iec_a_DEPENDENCIES) $(EXTRA_libstage4_iec_a_DEPENDENCIES) 
+	-rm -f libstage4_iec.a
+	$(libstage4_iec_a_AR) libstage4_iec.a $(libstage4_iec_a_OBJECTS) $(libstage4_iec_a_LIBADD)
+	$(RANLIB) libstage4_iec.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_iec.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- a/stage4/generate_iec/generate_iec.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/generate_iec/generate_iec.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -1661,6 +1661,14 @@
 
 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
 void *visit(il_expression_c *symbol) {
+  /* Since stage2 will insert an artificial (and equivalent) LD <il_operand> to the simple_instr_list when an 'il_operand' exists, we know
+   * that if (symbol->il_operand != NULL), then the first IL instruction in the simple_instr_list will be the equivalent and artificial
+   * 'LD <il_operand>' IL instruction.
+   * Since we do not want the extra LD instruction, we simply remove it!
+   */
+  if (symbol->il_operand != NULL)
+    ((list_c *)symbol->simple_instr_list)->remove_element(0);
+
   symbol->il_expr_operator->accept(*this);
   s4o.print("(");
   if (symbol->il_operand != NULL)
--- a/stage4/stage4.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/stage4/stage4.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -36,6 +36,8 @@
  * by each specific version of the 4th stage.
  */
 
+#ifndef _STAGE4_HH
+#define _STAGE4_HH
 
 #include "../absyntax/absyntax.hh"
 
@@ -100,6 +102,6 @@
 
 
 
+int stage4(symbol_c *tree_root, const char *builddir);
 
-
-int stage4(symbol_c *tree_root);
+#endif /* _STAGE4_HH */
--- a/util/dsymtable.cc	Sat Feb 23 23:14:59 2013 +0100
+++ b/util/dsymtable.cc	Fri Mar 08 01:01:15 2013 +0100
@@ -37,9 +37,6 @@
 
 
 
-
-
-
  /* clear all entries... */
 template<typename value_type, value_type null_value>
 void dsymtable_c<value_type, null_value>::reset(void) {
@@ -88,26 +85,6 @@
 
 
 
-/* Determine how many entries are associated to key identifier_str */ 
-/* returns:
- *         0: if no entry is found
- *         1: if 1 entry is found
- *         2: if more than 1 entry is found 
- */
-template<typename value_type, value_type null_value>
-int dsymtable_c<value_type, null_value>::multiplicity(const char *identifier_str) {
-  iterator lower = _base.lower_bound(identifier_str);
-  if (lower == _base.end()) return 0;
-
-  iterator upper = _base.upper_bound(identifier_str);
-  iterator second = lower;
-  second++;
-  
-  if (second == upper) return 1;
-  
-  return 2;
-}
-
 
 /* returns null_value if not found! */
 template<typename value_type, value_type null_value>
--- a/util/dsymtable.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/util/dsymtable.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -77,26 +77,23 @@
   typedef typename base_t::const_reverse_iterator const_reverse_iterator;
 
   private:
-    void reset(void); /* clear all entries... */
     const char *symbol_to_string(const symbol_c *symbol);
 
   public:
     dsymtable_c(void) {};
 
+    void reset(void); /* clear all entries... */
+    
     void insert(const char *identifier_str, value_t value);
     void insert(const symbol_c *symbol, value_t value);
 
     /* Determine how many entries are associated to key identifier_str */ 
-    /* returns:
-     *         0: if no entry is found
-     *         1: if 1 entry is found
-     *         2: if more than 1 entry is found 
-     */
-    int multiplicity(const char *identifier_str);
-    int multiplicity(const symbol_c *symbol)        {return multiplicity(symbol_to_string(symbol));}
+    /* returns: 0 if no entry is found, 1 if 1 entry is found, ..., n if n entries are found */
+    int count(const char *identifier_str)    {return _base.count(identifier_str);}
+    int count(const symbol_c *symbol)        {return count(symbol_to_string(symbol));}
     
     /* Search for an entry. Will return end_value() if not found */
-    value_t end_value(void) {return null_value;}
+    value_t end_value(void)                          {return null_value;}
     value_t find_value(const char *identifier_str);
     value_t find_value(const symbol_c *symbol)       {return find_value(symbol_to_string(symbol));}
 
@@ -104,13 +101,12 @@
     iterator find(const char *identifier_str)        {return _base.find(identifier_str);}
     iterator find(const symbol_c *symbol)            {return find(symbol_to_string(symbol));}
     
-    /* Search for the first entry associated with (i.e. with key ==) identifier_str. Will return end() if not found */
-    /* Basically, the same as find() */
-    iterator lower_bound(const char *identifier_str) {return _base.lower_bound(identifier_str);}
+    /* Search for the first entry associated with (i.e. with key ==) identifier_str. Will return end() if not found (NOTE: end() != end_value()) */
+    iterator lower_bound(const char *identifier_str) {return ((count(identifier_str) == 0)? _base.end() : _base.lower_bound(identifier_str));}
     iterator lower_bound(const symbol_c *symbol)     {return lower_bound(symbol_to_string(symbol));}
     
     /* Search for the first entry with key greater than identifier_str. Will return end() if not found */
-    iterator upper_bound(const char *identifier_str) {return _base.upper_bound(identifier_str);}
+    iterator upper_bound(const char *identifier_str) {return ((count(identifier_str) == 0)? _base.end() : _base.upper_bound(identifier_str));}
     iterator upper_bound(const symbol_c *symbol)     {return upper_bound(symbol_to_string(symbol));}
 
     /* get the value to which an iterator is pointing to... */
--- a/util/symtable.hh	Sat Feb 23 23:14:59 2013 +0100
+++ b/util/symtable.hh	Fri Mar 08 01:01:15 2013 +0100
@@ -77,11 +77,12 @@
   private:
       /* pointer to symbol table of the next inner scope */
     symtable_c *inner_scope;
-    void reset(void); /* clear all entries... */
 
   public:
     symtable_c(void);
 
+    void reset(void); /* clear all entries... */
+
     void push(void); /* create new inner scope */
     int  pop(void);  /* clear most inner scope */