# HG changeset patch # User laurent # Date 1315506300 -7200 # Node ID 7a11f9e9e7030cb94fef95d457e340cc577f12a0 # Parent b826f13c260e989869d98878342e7c774d7da218# Parent 01068ccb73b202b2872d4117ad01984bac956cbb Merge with 01068ccb73b202b2872d4117ad01984bac956cbb diff -r b826f13c260e -r 7a11f9e9e703 .hgignore --- a/.hgignore Wed Sep 07 19:28:10 2011 +0200 +++ b/.hgignore Thu Sep 08 20:25:00 2011 +0200 @@ -1,12 +1,25 @@ +syntax: glob + .project +*~ +*.a +.dep +*.Po +autom4te.cache +Makefile +config.log +stamp-h1 +config.status + + syntax: regexp + \.o$ -syntax: regexp ^iec2c$ -syntax: regexp ^iec2iec$ -syntax: regexp \.depend$ -syntax: regexp -^stage1_2/iec\.(y|flex)\..*$ +^stage1_2/iec_bison.cc +^stage1_2/iec_bison.h +^stage1_2/iec_flex.cc +^config/config.h \ No newline at end of file diff -r b826f13c260e -r 7a11f9e9e703 Makefile --- a/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +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 . - -# include the system specific Makefile -include Makefile.$(shell uname) - -default: all - -all: iec2c iec2iec - -install: all - install -d $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/ - install -d $(INSTALL_PREDIR)/$(IECLIBDIR)/ - install iec2c $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/ - install lib/*.txt $(INSTALL_PREDIR)/$(IECLIBDIR)/ -# install iec2iec $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/ - - -uninstall: - rm -f $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/iec2c - rm -f $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/iec2iec - for ff in `cd lib; ls *.txt; cd ..` do echo $$ff done -# for ff in `cd lib; ls *.txt; cd ..` do rm -f $(INSTALL_PREDIR)/$(IECLIBDIR)/$$ff done - - -clean: - -rm -f iec2iec iec2c *.o absyntax/*.o - echo > Makefile.depend -# make something everywhere (ie, in all Makefiles that have that target) - find . -depth -mindepth 2 -maxdepth 2 -name Makefile | sed 's/Makefile//g' | xargs -I {} $(MAKE) -C{} clean - -CXXFLAGS += -I. - -LIBS = absyntax/absyntax.o absyntax/visitor.o -LIBS += stage1_2/stage1_2.o stage1_2/iec.y.o stage1_2/iec.flex.o -LIBS += stage3/stage3.o -LIBS += stage3/visit_expression_type.o -LIBS += absyntax_utils/absyntax_utils.o -LIBS += absyntax_utils/search_expression_type.o -LIBS += absyntax_utils/decompose_var_instance_name.o -LIBS += absyntax_utils/case_element_iterator.o -LIBS += absyntax_utils/function_call_iterator.o -LIBS += absyntax_utils/function_call_param_iterator.o -LIBS += absyntax_utils/function_param_iterator.o -LIBS += absyntax_utils/search_base_type.o -LIBS += absyntax_utils/search_constant_type.o -LIBS += absyntax_utils/search_fb_instance_decl.o -LIBS += absyntax_utils/search_fb_typedecl.o -LIBS += absyntax_utils/search_varfb_instance_type.o -LIBS += absyntax_utils/search_var_instance_decl.o -LIBS += absyntax_utils/spec_init_separator.o -LIBS += absyntax_utils/type_initial_value.o -LIBS += absyntax_utils/add_en_eno_param_decl.o -LIBS += absyntax_utils/get_sizeof_datatype.o -LIBS += absyntax_utils/get_function_type.o - - - -iec2c: main.o stage4/generate_c/generate_c.o stage4/stage4.o $(LIBS) - $(CXX) -o iec2c main.o stage4/stage4.o stage4/generate_c/generate_c.o $(LIBS) - - -iec2iec: main.o stage4/generate_iec/generate_iec.o stage4/stage4.o $(LIBS) - $(CXX) -o iec2iec main.o stage4/stage4.o stage4/generate_iec/generate_iec.o $(LIBS) - - -#how to make things in subdirectories etc -../% /% absyntax/% stage1_2/% stage3/% stage4/% util/%: - $(MAKE) -C $(@D) $(@F) - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend - - - diff -r b826f13c260e -r 7a11f9e9e703 Makefile.CYGWIN_NT-5.1 --- a/Makefile.CYGWIN_NT-5.1 Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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 . - -CXX = g++ -mno-cygwin - -#get warnings, debugging information and optimization -CFLAGS = -Wall -Wpointer-arith -Wwrite-strings -# CFLAGS += -Werror -# CFLAGS += -ggdb -#CFLAGS += -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -#CXXFLAGS += -ggdb -#CXXFLAGS += -O3 -funroll-loops -CXXFLAGS = $(CFLAGS) - -IECLIBDIR=lib diff -r b826f13c260e -r 7a11f9e9e703 Makefile.CYGWIN_NT-6.0 --- a/Makefile.CYGWIN_NT-6.0 Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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 . - -#CXX = i686-mingw32-c++ -CXX = g++ -mno-cygwin - -#get warnings, debugging information and optimization -CFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -# CFLAGS += -Werror -CFLAGS += -ggdb -#CFLAGS += -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -#CXXFLAGS += -ggdb -#CXXFLAGS += -O3 -funroll-loops -CXXFLAGS = $(CFLAGS) - -IECLIBDIR=lib diff -r b826f13c260e -r 7a11f9e9e703 Makefile.Darwin --- a/Makefile.Darwin Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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 . - -CXX = g++ - -#get warnings, debugging information and optimization -CFLAGS = -Wall -Wpointer-arith -Wwrite-strings -# CFLAGS += -Werror -CFLAGS += -ggdb -#CFLAGS += -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -#CXXFLAGS += -ggdb -#CXXFLAGS += -O3 -funroll-loops -CXXFLAGS = $(CFLAGS) - -IECLIBDIR=lib diff -r b826f13c260e -r 7a11f9e9e703 Makefile.Linux --- a/Makefile.Linux Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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 . - -#CXX = i686-mingw32-c++ -CXX = g++ - -#get warnings, debugging information and optimization -CFLAGS = -Wall -Wpointer-arith -Wwrite-strings -# CFLAGS += -Werror -CFLAGS += -ggdb -#CFLAGS += -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -#CXXFLAGS += -ggdb -#CXXFLAGS += -O3 -funroll-loops -CXXFLAGS = $(CFLAGS) - -IECLIBDIR=lib diff -r b826f13c260e -r 7a11f9e9e703 Makefile.MINGW32_NT-5.1 --- a/Makefile.MINGW32_NT-5.1 Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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 . - -#CXX = i686-mingw32-c++ -CXX = g++ - -#get warnings, debugging information and optimization -CFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -# CFLAGS += -Werror -CFLAGS += -ggdb -#CFLAGS += -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -#CXXFLAGS += -ggdb -#CXXFLAGS += -O3 -funroll-loops -CXXFLAGS = $(CFLAGS) - -IECLIBDIR=lib diff -r b826f13c260e -r 7a11f9e9e703 Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,27 @@ +include common.mk + +bin_PROGRAMS = iec2c iec2iec + +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 ) +AM_CXXFLAGS += -DHGVERSION="\"${HGVERSION}\"" + +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 + diff -r b826f13c260e -r 7a11f9e9e703 Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,801 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +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 +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: + @: +$(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; + +$(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; \ + $(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) + @rm -f iec2c$(EXEEXT) + $(CXXLINK) $(iec2c_OBJECTS) $(iec2c_LDADD) $(LIBS) +iec2iec$(EXEEXT): $(iec2iec_OBJECTS) $(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 -9 -c >$(distdir).tar.bz2 + $(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 -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.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" \ + $(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: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { 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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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-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: diff -r b826f13c260e -r 7a11f9e9e703 README.build --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.build Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,40 @@ + +Compile/Build +============= + +1) Compiling under Linux +------------------------ +$ ./configure +$ make + + +2) Cross-Compiling under Linux, for Windows +------------------------------------------- +$ ./configure --host=i586-pc-mingw32 +$ make + + + + + +Maintaining the Build Environment +================================= +-> Add new files to Makefile.am or add a new makefile +$ autoreconf + + +-> Prepare clean project +$ make distclean + + + +-> Remember to add these files to your .hgignore + Makefile + config.* + *.a + .deps + + +-> Send me TODO list to complete build system. + matteo.facchinetti@sirius-es.it + diff -r b826f13c260e -r 7a11f9e9e703 absyntax/Makefile --- a/absyntax/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +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 . - -# include the system specific Makefile -include ../Makefile.$(shell uname) - - - - -default: all - -all: absyntax.o visitor.o - -clean: - rm -f *.o - - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -# CXXFLAGS += -Werror - -#CXXFLAGS += -ggdb -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -CXXFLAGS += -I. -I../* -I../../absyntax - - - -#how to make things in subdirectories etc -../% /% absyntax/% stage1_2/% stage3/% stage4/% util/%: - $(MAKE) -C $(@D) $(@F) - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend diff -r b826f13c260e -r 7a11f9e9e703 absyntax/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/absyntax/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,8 @@ +include ../common.mk + +lib_LIBRARIES = libabsyntax.a + +libabsyntax_a_SOURCES = \ + absyntax.cc \ + visitor.cc + diff -r b826f13c260e -r 7a11f9e9e703 absyntax/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/absyntax/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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__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; + +$(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|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ + cd "$(DESTDIR)$(libdir)" && rm -f $$files + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libabsyntax.a: $(libabsyntax_a_OBJECTS) $(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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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: diff -r b826f13c260e -r 7a11f9e9e703 absyntax/absyntax.cc --- a/absyntax/absyntax.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax/absyntax.cc Thu Sep 08 20:25:00 2011 +0200 @@ -41,10 +41,11 @@ //#include "../stage1_2/iec.hh" /* required for BOGUS_TOKEN_ID, etc... */ #include "visitor.hh" -#define ABORT(str) {printf("ERROR: %s\n", str); exit(0);} - - - +#define ERROR error_exit(__FILE__,__LINE__) +/* function defined in main.cc */ +extern void error_exit(const char *file_name, int line_no); + +#define ABORT(str) {printf("ERROR: %s\n", str); ERROR;} @@ -94,7 +95,7 @@ add_element(elem); } -/* insert a new element */ +/* 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++; @@ -125,10 +126,24 @@ } } - - - -#define SYM_LIST(class_name_c) \ +/* insert a new element before position pos. */ +/* 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) { + int i; + if (pos > n) 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 (i = n-2; i >= pos; i--) elements[i+1] = elements[i]; + elements[pos] = elem; +} + + + +#define SYM_LIST(class_name_c, ...) \ class_name_c::class_name_c( \ int fl, int fc, const char *ffile, long int forder, \ int ll, int lc, const char *lfile, long int lorder) \ @@ -139,14 +154,14 @@ :list_c(elem, fl, fc, ffile, forder, ll, lc, lfile, lorder) {} \ void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} -#define SYM_TOKEN(class_name_c) \ +#define SYM_TOKEN(class_name_c, ...) \ class_name_c::class_name_c(const char *value, \ int fl, int fc, const char *ffile, long int forder, \ int ll, int lc, const char *lfile, long int lorder) \ :token_c(value, fl, fc, ffile, forder, ll, lc, lfile, lorder) {} \ void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} -#define SYM_REF0(class_name_c) \ +#define SYM_REF0(class_name_c, ...) \ class_name_c::class_name_c( \ int fl, int fc, const char *ffile, long int forder, \ int ll, int lc, const char *lfile, long int lorder) \ @@ -154,43 +169,43 @@ void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} -#define SYM_REF1(class_name_c, ref1) \ -class_name_c::class_name_c(symbol_c *ref1, \ - 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) { \ - this->ref1 = ref1; \ -} \ -void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} - - -#define SYM_REF2(class_name_c, ref1, ref2) \ -class_name_c::class_name_c(symbol_c *ref1, \ - symbol_c *ref2, \ - 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) { \ - this->ref1 = ref1; \ - this->ref2 = ref2; \ -} \ -void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} - - -#define SYM_REF3(class_name_c, ref1, ref2, ref3) \ -class_name_c::class_name_c(symbol_c *ref1, \ - symbol_c *ref2, \ - symbol_c *ref3, \ - 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) { \ - this->ref1 = ref1; \ - this->ref2 = ref2; \ - this->ref3 = ref3; \ -} \ -void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} - - -#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4) \ +#define SYM_REF1(class_name_c, ref1, ...) \ +class_name_c::class_name_c(symbol_c *ref1, \ + 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) { \ + this->ref1 = ref1; \ +} \ +void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} + + +#define SYM_REF2(class_name_c, ref1, ref2, ...) \ +class_name_c::class_name_c(symbol_c *ref1, \ + symbol_c *ref2, \ + 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) { \ + this->ref1 = ref1; \ + this->ref2 = ref2; \ +} \ +void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} + + +#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...) \ +class_name_c::class_name_c(symbol_c *ref1, \ + symbol_c *ref2, \ + symbol_c *ref3, \ + 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) { \ + this->ref1 = ref1; \ + this->ref2 = ref2; \ + this->ref3 = ref3; \ +} \ +void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} + + +#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...) \ class_name_c::class_name_c(symbol_c *ref1, \ symbol_c *ref2, \ symbol_c *ref3, \ @@ -206,7 +221,7 @@ void *class_name_c::accept(visitor_c &visitor) {return visitor.visit(this);} -#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5) \ +#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...) \ class_name_c::class_name_c(symbol_c *ref1, \ symbol_c *ref2, \ symbol_c *ref3, \ @@ -225,7 +240,7 @@ -#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6) \ +#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...) \ class_name_c::class_name_c(symbol_c *ref1, \ symbol_c *ref2, \ symbol_c *ref3, \ diff -r b826f13c260e -r 7a11f9e9e703 absyntax/absyntax.def --- a/absyntax/absyntax.def Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax/absyntax.def Thu Sep 08 20:25:00 2011 +0200 @@ -538,6 +538,33 @@ /* | var1_list ',' variable_name */ SYM_LIST(var1_list_c) +/* | [var1_list ','] variable_name integer '..' */ +/* NOTE: This is an extension to the standard!!! */ +/* In order to be able to handle extensible standard functions + * (i.e. standard functions that may have a variable number of + * input parameters, such as AND(word#33, word#44, word#55, word#66), + * we have extended the acceptable syntax to allow var_name '..' + * in an input variable declaration. + * + * This allows us to parse the declaration of standard + * extensible functions and load their interface definition + * into the abstract syntax tree just like we do to other + * user defined functions. + * This has the advantage that we can later do semantic + * checking of calls to functions (be it a standard or user defined + * function) in (almost) exactly the same way. + * + * The integer tells the compiler the number of the first parameter. + * for example, for ADD(IN1 := 11, IN2:=22), the index for IN starts off at 1. + * Some other standard library functions, such as MUX, has the extensible + * variable starting off from 0 (IN0, IN1, IN2, ...). + * + * Of course, we have a flag that disables this syntax when parsing user + * written code, so we only allow this extra syntax while parsing the + * 'header' file that declares all the standard IEC 61131-3 functions. + */ +SYM_REF2(extensible_input_parameter_c, var_name, first_index) + /* var1_list ':' array_spec_init */ SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init) @@ -632,7 +659,15 @@ /* STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */ /* integer ->may be NULL ! */ /* single_byte_character_string ->may be NULL ! */ -SYM_REF2(single_byte_string_spec_c, integer, single_byte_character_string) +SYM_REF2(single_byte_string_spec_c, string_spec, single_byte_character_string) + +/* STRING ['[' integer ']'] */ +/* integer ->may be NULL ! */ +SYM_REF2(single_byte_limited_len_string_spec_c, string_type_name, character_string_len) + +/* WSTRING ['[' integer ']'] */ +/* integer ->may be NULL ! */ +SYM_REF2(double_byte_limited_len_string_spec_c, string_type_name, character_string_len) /* var1_list ':' double_byte_string_spec */ SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec) @@ -640,7 +675,7 @@ /* WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */ /* integer ->may be NULL ! */ /* double_byte_character_string ->may be NULL ! */ -SYM_REF2(double_byte_string_spec_c, integer, double_byte_character_string) +SYM_REF2(double_byte_string_spec_c, string_spec, double_byte_character_string) /*| VAR [RETAIN|NON_RETAIN] incompl_located_var_decl_list END_VAR */ /* option ->may be NULL ! */ @@ -885,7 +920,10 @@ SYM_REF2(il_simple_operation_c, il_simple_operator, il_operand) /* | function_name [il_operand_list] */ -SYM_REF2(il_function_call_c, function_name, il_operand_list) +/* NOTE: The parameter 'called_function_declaration' is used to pass data between the stage 3 and stage 4. + * See the comment above function_invocation_c for more details + */ +SYM_REF2(il_function_call_c, function_name, il_operand_list, symbol_c *called_function_declaration; int extensible_param_count;) /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */ @@ -904,7 +942,10 @@ /* | function_name '(' eol_list [il_param_list] ')' */ -SYM_REF2(il_formal_funct_call_c, function_name, il_param_list) +/* NOTE: The parameter 'called_function_declaration' is used to pass data between the stage 3 and stage 4. + * See the comment above function_invocation_c for more details + */ +SYM_REF2(il_formal_funct_call_c, function_name, il_param_list, symbol_c *called_function_declaration; int extensible_param_count;) /* | il_operand_list ',' il_operand */ SYM_LIST(il_operand_list_c) @@ -1004,7 +1045,17 @@ /* formal_param_list -> may be NULL ! */ /* nonformal_param_list -> may be NULL ! */ -SYM_REF3(function_invocation_c, function_name, formal_param_list, nonformal_param_list) +/* NOTE: The parameter 'called_function_declaration' is used to pass data between the stage 3 and stage 4. + * The IEC 61131-3 standard allows for overloaded standard functions. This means that some + * function calls are not compeletely defined by the name of the function being called, + * and need to be disambiguated with using the data types of the parameters being passed. + * Stage 3 does this to verify semantic correctnes. + * Stage 4 also needs to do this in order to determine which function to call. + * It does not make sense to determine the exact function being called twice (once in stage 3, + * and again in stage 4), so stage 3 will store this infor in the parameter called_function_declaration + * for stage 4 to use it later on. + */ +SYM_REF3(function_invocation_c, function_name, formal_param_list, nonformal_param_list, symbol_c *called_function_declaration; int extensible_param_count;) /********************/ diff -r b826f13c260e -r 7a11f9e9e703 absyntax/absyntax.hh --- a/absyntax/absyntax.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax/absyntax.hh Thu Sep 08 20:25:00 2011 +0200 @@ -119,16 +119,22 @@ int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0 /* order in which it is read by lexcial analyser */ ); - /* insert a new element */ + /* append a new element to the end of the list */ virtual void add_element(symbol_c *elem); -}; - - - - -#define SYM_LIST(class_name_c) \ + /* insert a new element before position pos. */ + /* To insert into the begining of list, call with pos=0 */ + /* To insert into the end of list, call with pos=list->n */ + virtual void insert_element(symbol_c *elem, int pos = 0); +}; + + + + +#define SYM_LIST(class_name_c, ...) \ class class_name_c: public list_c { \ public: \ + __VA_ARGS__ \ + public: \ class_name_c( \ 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); \ @@ -139,9 +145,11 @@ }; -#define SYM_TOKEN(class_name_c) \ +#define SYM_TOKEN(class_name_c, ...) \ class class_name_c: public token_c { \ public: \ + __VA_ARGS__ \ + public: \ class_name_c(const char *value, \ 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); \ @@ -149,8 +157,10 @@ }; -#define SYM_REF0(class_name_c) \ -class class_name_c: public symbol_c { \ +#define SYM_REF0(class_name_c, ...) \ +class class_name_c: public symbol_c { \ + public: \ + __VA_ARGS__ \ public: \ class_name_c( \ int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ @@ -159,23 +169,25 @@ }; -#define SYM_REF1(class_name_c, ref1) \ -class class_name_c: public symbol_c { \ - public: \ - symbol_c *ref1; \ - public: \ - class_name_c(symbol_c *ref1, \ - 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); \ -}; - - -#define SYM_REF2(class_name_c, ref1, ref2) \ -class class_name_c: public symbol_c { \ - public: \ - symbol_c *ref1; \ - symbol_c *ref2; \ +#define SYM_REF1(class_name_c, ref1, ...) \ +class class_name_c: public symbol_c { \ + public: \ + symbol_c *ref1; \ + __VA_ARGS__ \ + public: \ + class_name_c(symbol_c *ref1, \ + 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); \ +}; + + +#define SYM_REF2(class_name_c, ref1, ref2, ...) \ +class class_name_c: public symbol_c { \ + public: \ + symbol_c *ref1; \ + symbol_c *ref2; \ + __VA_ARGS__ \ public: \ class_name_c(symbol_c *ref1, \ symbol_c *ref2 = NULL, \ @@ -185,29 +197,31 @@ }; -#define SYM_REF3(class_name_c, ref1, ref2, ref3) \ -class class_name_c: public symbol_c { \ - public: \ - symbol_c *ref1; \ - symbol_c *ref2; \ - symbol_c *ref3; \ - public: \ - class_name_c(symbol_c *ref1, \ - symbol_c *ref2, \ - symbol_c *ref3, \ - 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); \ -}; - - -#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4) \ +#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...) \ +class class_name_c: public symbol_c { \ + public: \ + symbol_c *ref1; \ + symbol_c *ref2; \ + symbol_c *ref3; \ + __VA_ARGS__ \ + public: \ + class_name_c(symbol_c *ref1, \ + symbol_c *ref2, \ + symbol_c *ref3, \ + 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); \ +}; + + +#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...) \ class class_name_c: public symbol_c { \ public: \ symbol_c *ref1; \ symbol_c *ref2; \ symbol_c *ref3; \ symbol_c *ref4; \ + __VA_ARGS__ \ public: \ class_name_c(symbol_c *ref1, \ symbol_c *ref2, \ @@ -219,7 +233,7 @@ }; -#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5) \ +#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...) \ class class_name_c: public symbol_c { \ public: \ symbol_c *ref1; \ @@ -227,6 +241,7 @@ symbol_c *ref3; \ symbol_c *ref4; \ symbol_c *ref5; \ + __VA_ARGS__ \ public: \ class_name_c(symbol_c *ref1, \ symbol_c *ref2, \ @@ -239,7 +254,7 @@ }; -#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6) \ +#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...) \ class class_name_c: public symbol_c { \ public: \ symbol_c *ref1; \ @@ -248,6 +263,7 @@ symbol_c *ref4; \ symbol_c *ref5; \ symbol_c *ref6; \ + __VA_ARGS__ \ public: \ class_name_c(symbol_c *ref1, \ symbol_c *ref2, \ diff -r b826f13c260e -r 7a11f9e9e703 absyntax/visitor.cc --- a/absyntax/visitor.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax/visitor.cc Thu Sep 08 20:25:00 2011 +0200 @@ -82,19 +82,19 @@ #define SYM_REF1(class_name_c, ref1) \ void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} -#define SYM_REF2(class_name_c, ref1, ref2) \ - void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} - -#define SYM_REF3(class_name_c, ref1, ref2, ref3) \ - void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} - -#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4) \ - void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} - -#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5) \ - void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} - -#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6) \ +#define SYM_REF2(class_name_c, ref1, ref2, ...) \ + void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} + +#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...) \ + void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} + +#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...) \ + void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} + +#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...) \ + void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} + +#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...) \ void *null_visitor_c::visit(class_name_c *symbol) {return NULL;} @@ -148,31 +148,31 @@ return NULL; \ } -#define SYM_REF2(class_name_c, ref1, ref2) \ +#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) \ +#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); \ @@ -182,7 +182,7 @@ return NULL; \ } -#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6) \ +#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); \ @@ -250,7 +250,7 @@ return NULL; \ } -#define SYM_REF2(class_name_c, ref1, ref2) \ +#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); \ @@ -259,7 +259,7 @@ return NULL; \ } -#define SYM_REF3(class_name_c, ref1, ref2, ref3) \ +#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); \ @@ -270,7 +270,7 @@ return NULL; \ } -#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4) \ +#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); \ @@ -283,7 +283,7 @@ return NULL; \ } -#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5) \ +#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); \ @@ -298,7 +298,7 @@ return NULL; \ } -#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6) \ +#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); \ diff -r b826f13c260e -r 7a11f9e9e703 absyntax/visitor.hh --- a/absyntax/visitor.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax/visitor.hh Thu Sep 08 20:25:00 2011 +0200 @@ -78,31 +78,31 @@ -#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) \ +#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 { @@ -127,31 +127,31 @@ -#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) \ +#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); diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/Makefile --- a/absyntax_utils/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +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 . - -# include the system specific Makefile -include ../Makefile.$(shell uname) - -SEARCH_UTIL_FILES = absyntax_utils.o -SEARCH_UTIL_FILES += search_expression_type.o -SEARCH_UTIL_FILES += decompose_var_instance_name.o -SEARCH_UTIL_FILES += case_element_iterator.o -SEARCH_UTIL_FILES += function_call_iterator.o -SEARCH_UTIL_FILES += function_call_param_iterator.o -SEARCH_UTIL_FILES += function_param_iterator.o -SEARCH_UTIL_FILES += search_base_type.o -SEARCH_UTIL_FILES += search_constant_type.o -SEARCH_UTIL_FILES += search_fb_instance_decl.o -SEARCH_UTIL_FILES += search_fb_typedecl.o -SEARCH_UTIL_FILES += search_il_operand_type.o -SEARCH_UTIL_FILES += search_varfb_instance_type.o -SEARCH_UTIL_FILES += search_var_instance_decl.o -SEARCH_UTIL_FILES += spec_init_separator.o -SEARCH_UTIL_FILES += type_initial_value.o -SEARCH_UTIL_FILES += add_en_eno_param_decl.o -SEARCH_UTIL_FILES += get_sizeof_datatype.o -SEARCH_UTIL_FILES += get_function_type.o - -default: all - -all: $(SEARCH_UTIL_FILES) - -clean: - rm -f *.o Makefile.depend - -CXXFLAGS += -I. -I../* - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/absyntax_utils/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,31 @@ +include ../common.mk + +lib_LIBRARIES = libabsyntax_utils.a + +libabsyntax_utils_a_SOURCES = \ + absyntax_utils.cc \ + add_en_eno_param_decl.cc \ + decompose_var_instance_name.cc \ + case_element_iterator.cc \ + function_call_iterator.cc \ + function_call_param_iterator.cc \ + function_param_iterator.cc \ + get_function_type.cc \ + get_sizeof_datatype.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 \ + 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 + +#search_il_operand_type.cc +#search_type_code.c + diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/absyntax_utils/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,542 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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__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) \ + case_element_iterator.$(OBJEXT) \ + function_call_iterator.$(OBJEXT) \ + function_call_param_iterator.$(OBJEXT) \ + function_param_iterator.$(OBJEXT) get_function_type.$(OBJEXT) \ + get_sizeof_datatype.$(OBJEXT) search_base_type.$(OBJEXT) \ + search_constant_type.$(OBJEXT) \ + search_expression_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) +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 \ + case_element_iterator.cc \ + function_call_iterator.cc \ + function_call_param_iterator.cc \ + function_param_iterator.cc \ + get_function_type.cc \ + get_sizeof_datatype.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 \ + 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 + +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; + +$(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|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ + cd "$(DESTDIR)$(libdir)" && rm -f $$files + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libabsyntax_utils.a: $(libabsyntax_utils_a_OBJECTS) $(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)/case_element_iterator.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_function_type.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_sizeof_datatype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_base_type.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_constant_type.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_expression_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_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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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 + + +#search_il_operand_type.cc +#search_type_code.c + +# 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: diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/absyntax_utils.cc --- a/absyntax_utils/absyntax_utils.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/absyntax_utils.cc Thu Sep 08 20:25:00 2011 +0200 @@ -50,6 +50,8 @@ #include #include #include +#include /* required for strlen() */ +#include /* required for atoi() */ #include "../util/symtable.hh" #include "../util/dsymtable.hh" @@ -94,6 +96,25 @@ } +/* extract the value of an integer from an integer_c object !! */ +/* NOTE: it must ignore underscores! */ +int extract_integer(symbol_c *sym) { + std::string str = ""; + integer_c *integer; + neg_integer_c * neg_integer; + + if ((neg_integer = dynamic_cast(sym)) != NULL) + return - extract_integer((integer_c *)neg_integer->exp); + + if ((integer = dynamic_cast(sym)) == NULL) ERROR; + + for(unsigned int i = 0; i < strlen(integer->value); i++) + if (integer->value[i] != '_') str += integer->value[i]; + + return atoi(str.c_str()); +} + + /***********************************************************************/ /***********************************************************************/ diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/absyntax_utils.hh --- a/absyntax_utils/absyntax_utils.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/absyntax_utils.hh Thu Sep 08 20:25:00 2011 +0200 @@ -55,9 +55,13 @@ /* returns 0 if the names are equal!! Case is ignored. */ int compare_identifiers(symbol_c *ident1, symbol_c *ident2); +/* extract the value of an integer from an integer_c object !! */ +int extract_integer(symbol_c *integer); + /* A symbol table with all globally declared functions... */ extern function_declaration_c null_symbol1; -extern dsymtable_c function_symtable; +typedef dsymtable_c function_symtable_t; +extern function_symtable_t function_symtable; /* A symbol table with all globally declared functions block types... */ extern function_block_declaration_c null_symbol2; diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/add_en_eno_param_decl.cc --- a/absyntax_utils/add_en_eno_param_decl.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/add_en_eno_param_decl.cc Thu Sep 08 20:25:00 2011 +0200 @@ -150,8 +150,17 @@ en_declared = false; eno_declared = false; iterate_list(symbol); + /* insert elements to begining of list! */ + /* We want EN first, and then ENO. + * But, since we are insertin them into the head of the list, we must insert EN last so it will stay in the first position! + */ + if(eno_declared == false) symbol->insert_element(build_eno_param()); + if(en_declared == false) symbol->insert_element(build_en_param()); + /* append elements to end of list! */ + /* if(en_declared == false) symbol->add_element(build_en_param()); if(eno_declared == false) symbol->add_element(build_eno_param()); + */ return NULL; } diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/function_call_param_iterator.cc --- a/absyntax_utils/function_call_param_iterator.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/function_call_param_iterator.cc Thu Sep 08 20:25:00 2011 +0200 @@ -221,6 +221,13 @@ return (symbol_c *)res; } +/* Search for the value passed to the parameter named ... */ +symbol_c *function_call_param_iterator_c::search_f(const char *param_name) { + identifier_c tmp_indentifier(param_name); + return search_f(&tmp_indentifier); +} + + /* Returns the value being passed to the current parameter. */ symbol_c *function_call_param_iterator_c::get_current_value(void) { return current_value; diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/function_call_param_iterator.hh --- a/absyntax_utils/function_call_param_iterator.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/function_call_param_iterator.hh Thu Sep 08 20:25:00 2011 +0200 @@ -104,6 +104,7 @@ /* Search for the value passed to the parameter named ... */ symbol_c *search_f(symbol_c *param_name); + symbol_c *search_f(const char *param_name); /* Returns the value being passed to the current parameter. */ symbol_c *get_current_value(void); diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/function_param_iterator.cc --- a/absyntax_utils/function_param_iterator.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/function_param_iterator.cc Thu Sep 08 20:25:00 2011 +0200 @@ -48,8 +48,11 @@ -#include "function_param_iterator.hh" -#include "spec_init_separator.hh" +#include "absyntax_utils.hh" /* required for extract_integer() */ +// #include "function_param_iterator.hh" /* no longer required, aready included by absyntax_utils.hh */ +// #include "spec_init_separator.hh" /* no longer required, aready included by absyntax_utils.hh */ +#include /* required for strtol() */ +#include #include @@ -67,6 +70,49 @@ +/* compare the name of two __extensible__ function parameters. + * The usual use case is to have one of the parameters as used + * in the function declaration, and another as used in a formal function call. + * + * Will return: + * < 0 : if two parameters are not compatible, or one is invalid + * >= 0 : if both parameters .......... + */ +/* + * ("in", "i0") -> returns error (<0) + * ("in1", "in") -> returns error (<0) + * ("in", "in") -> returns error (<0) + * ("in", "inw") -> returns error (<0) + * ("in", "in10.4") -> returns error (<0) + * ("in", "in10e") -> returns error (<0) + * ("in", "") -> returns error (<0) + * ("", "in10e") -> returns error (<0) + * ("in", "in0") -> returns 0 + * ("in", "in9") -> returns 9 + * ("in", "in42") -> returns 42 + * ("in", "in-42") -> returns -42 (error!) + */ +int function_param_iterator_c::cmp_extparam_names(const char* s1, const char* s2) { + int res; + char *endptr; + int len; + + if ((s1 == NULL) || (s2 == NULL) || (*s1 == '\0') || (*s2 == '\0')) return -1; + + len = strlen(s1); + if (strncasecmp(s1, s2, len)) return -2; + + s1 = &s2[len]; + if (*s1 == '\0') return -3; + + res = strtol(s1, &endptr, 10); + if (*endptr != '\0') return -4; + + return res; +} + + + void* function_param_iterator_c::handle_param_list(list_c *list) { switch (current_operation) { case iterate_op: @@ -79,12 +125,27 @@ case search_op: for(int i = 0; i < list->n; i++) { - identifier_c *variable_name = dynamic_cast(list->elements[i]); + symbol_c *sym = list->elements[i]; + extensible_input_parameter_c *extensible_parameter = dynamic_cast(sym); + if (extensible_parameter != NULL) { + sym = extensible_parameter->var_name; + current_param_is_extensible = true; + _first_extensible_param_index = extract_integer(extensible_parameter->first_index); + } + identifier_c *variable_name = dynamic_cast(sym); if (variable_name == NULL) ERROR; - - if (strcasecmp(search_param_name->value, variable_name->value) == 0) - /* FOUND! This is the same parameter!! */ - return (void *)variable_name; + + if (!current_param_is_extensible) + if (strcasecmp(search_param_name->value, variable_name->value) == 0) + /* FOUND! This is the same parameter!! */ + return (void *)variable_name; + + if (current_param_is_extensible) { + current_extensible_param_index = cmp_extparam_names(variable_name->value, search_param_name->value); + if (current_extensible_param_index >= 0) + /* FOUND! This is a compatible extensible parameter!! */ + return (void *)variable_name; + } } break; } /* switch */ @@ -102,12 +163,26 @@ break; case search_op: + extensible_input_parameter_c *extensible_parameter = dynamic_cast(var_name); + if (extensible_parameter != NULL) { + var_name = extensible_parameter->var_name; + current_param_is_extensible = true; + _first_extensible_param_index = extract_integer(extensible_parameter->first_index); + } identifier_c *variable_name = dynamic_cast(var_name); if (variable_name == NULL) ERROR; - - if (strcasecmp(search_param_name->value, variable_name->value) == 0) - /* FOUND! This is the same parameter!! */ - return (void *)variable_name; + + if (!current_param_is_extensible) + if (strcasecmp(search_param_name->value, variable_name->value) == 0) + /* FOUND! This is the same parameter!! */ + return (void *)variable_name; + + if (current_param_is_extensible) { + current_extensible_param_index = cmp_extparam_names(variable_name->value, search_param_name->value); + if (current_extensible_param_index >= 0) + /* FOUND! This is a compatible extensible parameter!! */ + return (void *)variable_name; + } break; } /* switch */ @@ -128,6 +203,8 @@ /* start off at the first parameter once again... */ void function_param_iterator_c::reset(void) { next_param = param_count = 0; + _first_extensible_param_index = -1; + current_param_is_extensible = false; current_param_name = NULL; current_param_type = current_param_default_value = NULL; } @@ -166,6 +243,11 @@ void *res; identifier_c *identifier; + if (current_param_is_extensible) { + current_extensible_param_index++; + return current_param_name; + } + param_count = 0; en_eno_param_implicit = false; next_param++; @@ -175,6 +257,13 @@ return NULL; symbol_c *sym = (symbol_c *)res; + extensible_input_parameter_c *extensible_parameter = dynamic_cast(sym); + if (extensible_parameter != NULL) { + sym = extensible_parameter->var_name; + current_param_is_extensible = true; + _first_extensible_param_index = extract_integer(extensible_parameter->first_index); + current_extensible_param_index = _first_extensible_param_index; + } identifier = dynamic_cast(sym); if (identifier == NULL) ERROR; @@ -187,6 +276,8 @@ if (NULL == param_name) ERROR; search_param_name = dynamic_cast(param_name); if (NULL == search_param_name) ERROR; + en_eno_param_implicit = false; + current_param_is_extensible = false; current_operation = function_param_iterator_c::search_op; void *res = f_decl->accept(*this); identifier_c *res_param_name = dynamic_cast((symbol_c *)res); @@ -210,6 +301,24 @@ return en_eno_param_implicit; } +/* Returns if currently referenced parameter is an extensible parameter. */ +/* extensible paramters only occur in some standard functions, e.g. AND(word#34, word#44, word#65); */ +bool function_param_iterator_c::is_extensible_param(void) { + return current_param_is_extensible; +} + +/* Returns the index of the current extensible parameter. */ +/* If the current parameter is not an extensible paramter, returns -1 */ +int function_param_iterator_c::extensible_param_index(void) { + return (current_param_is_extensible? current_extensible_param_index : -1); +} + +/* Returns the index of the first extensible parameter, or -1 if no extensible parameter found. */ +/* WARNING: Will only return the correct value _after_ an extensible parameter has been found! */ +int function_param_iterator_c::first_extensible_param_index(void) { + return _first_extensible_param_index; +} + /* Returns the currently referenced parameter's data passing direction. * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT */ @@ -218,7 +327,7 @@ } void *function_param_iterator_c::visit(implicit_definition_c *symbol) { - en_eno_param_implicit = current_operation == function_param_iterator_c::iterate_op; + en_eno_param_implicit = true; return NULL; } @@ -243,12 +352,15 @@ * variables will get overwritten when we visit the next * var1_init_decl_c list! */ - symbol->method->accept(*this); - current_param_default_value = symbol->value; current_param_type = symbol->type; - return handle_single_param(symbol->name); + void *res = handle_single_param(symbol->name); + + /* If we have found the parameter we will be returning, we set the en_eno_param_implicit to TRUE if implicitly defined */ + if (res != NULL) symbol->method->accept(*this); + + return res; } /* var1_list ':' array_spec_init */ @@ -278,6 +390,7 @@ current_param_direction = direction_out; return symbol->var_init_decl_list->accept(*this); } + void *function_param_iterator_c::visit(eno_param_declaration_c *symbol) { TRACE("eno_param_declaration_c"); /* It is OK to store these values in the current_param_XXX @@ -286,18 +399,23 @@ * variables will get overwritten when we visit the next * var1_init_decl_c list! */ - symbol->method->accept(*this); - current_param_default_value = NULL; current_param_type = symbol->type; - return handle_single_param(symbol->name); -} + void *res = handle_single_param(symbol->name); + + /* If we have found the parameter we will be returning, we set the en_eno_param_implicit to TRUE if implicitly defined */ + if (res != NULL) symbol->method->accept(*this); + + return res; +} + void *function_param_iterator_c::visit(input_output_declarations_c *symbol) { TRACE("input_output_declarations_c"); current_param_direction = direction_inout; return symbol->var_declaration_list->accept(*this); } + void *function_param_iterator_c::visit(var_declaration_list_c *symbol) {TRACE("var_declaration_list_c"); return iterate_list(symbol);} /* var1_list ':' array_specification */ @@ -425,12 +543,12 @@ } - void *function_param_iterator_c::visit(var1_list_c *symbol) { TRACE("var1_list_c"); return handle_param_list(symbol); } + void *function_param_iterator_c::visit(var_init_decl_list_c *symbol) {TRACE("var_init_decl_list_c"); return iterate_list(symbol);} diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/function_param_iterator.hh --- a/absyntax_utils/function_param_iterator.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/function_param_iterator.hh Thu Sep 08 20:25:00 2011 +0200 @@ -90,6 +90,16 @@ symbol_c *current_param_default_value; param_direction_t current_param_direction; bool en_eno_param_implicit; + /* used when we reach an extensible parameter in the function declaration */ + /* NOTE: this will handle syntax that is not in the standard. + * It is used to handle the extensible standard functions + * (e.g. AND(word#3, word#55, word#44); ) + * See absyntax.def or iec.y for more details. + */ + bool current_param_is_extensible; + int current_extensible_param_index; + int _first_extensible_param_index; + /* Which operation of the class was called... * Search a parameter, or iterate to the next parameter. */ @@ -97,6 +107,7 @@ operation_t current_operation; private: + int cmp_extparam_names(const char* s1, const char* s2); void* handle_param_list(list_c *list); void* handle_single_param(symbol_c *var_name); @@ -128,7 +139,8 @@ /* The seach() function does not in any way affect the internal state related * to the iterate() function. * It will, however, affect the internal state necessary to correctly - * return the param_type() and default_value() of the found parameter. + * return the param_type(), default_value() and is_en_eno_param_implicit() + * of the found parameter. */ identifier_c *search(symbol_c *param_name); @@ -143,6 +155,16 @@ /* Returns if currently referenced parameter is an implicit defined EN/ENO parameter. */ bool is_en_eno_param_implicit(void); + /* Returns if currently referenced parameter is an extensible parameter. */ + /* extensible paramters only occur in some standard functions, e.g. AND(word#34, word#44, word#65); */ + bool is_extensible_param(void); + /* Returns the index of the current extensible parameter. */ + /* If the current parameter is not an extensible paramter, returns -1 */ + int extensible_param_index(void); + /* Returns the index of the first extensible parameter, or -1 if no extensible parameter found. */ + /* WARNING: Will only return the correct value _after_ an extensible parameter has been found! */ + int first_extensible_param_index(void); + /* Returns the currently referenced parameter's data passing direction. * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT */ diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/search_expression_type.cc --- a/absyntax_utils/search_expression_type.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/search_expression_type.cc Thu Sep 08 20:25:00 2011 +0200 @@ -202,11 +202,6 @@ } -integer_c search_expression_type_c::integer("1"); // what default value should we use here ??? -#include "search_type_code.c" - -/*static bool_type_name_c bool_type_name;*/ - /* 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)) @@ -385,13 +380,8 @@ } void *search_expression_type_c::visit(function_invocation_c *symbol) { - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - void *res = compute_standard_function_default(symbol); - if (res == NULL) - ERROR; - return res; - } + function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration; + if (f_decl == NULL) ERROR; return base_type(f_decl->type_name); } diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/search_expression_type.hh --- a/absyntax_utils/search_expression_type.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/search_expression_type.hh Thu Sep 08 20:25:00 2011 +0200 @@ -39,6 +39,18 @@ * 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: diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/search_type_code.c --- a/absyntax_utils/search_type_code.c Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29800 +0,0 @@ -/* - * Copyright (C) 2007-2011: Edouard TISSERANT and Laurent BESSARD - * - * See COPYING and COPYING.LESSER files for copyright details. - * - * 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 . - * - */ - -/**** - * IEC 61131-3 standard function library - * generated code, do not edit by hand - */ - - - -void *search_expression_type_c::compute_standard_function_default(function_invocation_c *st_symbol = NULL, il_formal_funct_call_c *il_symbol = NULL) { - function_type_t current_function_type; - function_call_param_iterator_c *tmp_function_call_param_iterator; - if (st_symbol != NULL && il_symbol == NULL) { - current_function_type = get_function_type((identifier_c *)st_symbol->function_name); - tmp_function_call_param_iterator = new function_call_param_iterator_c(st_symbol); - } - else if (st_symbol == NULL && il_symbol != NULL) { - current_function_type = get_function_type((identifier_c *)il_symbol->function_name); - tmp_function_call_param_iterator = new function_call_param_iterator_c(il_symbol); - } - else - ERROR; - function_call_param_iterator_c function_call_param_iterator(*tmp_function_call_param_iterator); - search_expression_type_c* search_expression_type = this; - - switch(current_function_type){ - -/**** - *REAL_TO_SINT - */ - case function_real_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_sint*/ - break; - -/**** - *REAL_TO_LINT - */ - case function_real_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_lint*/ - break; - -/**** - *REAL_TO_DINT - */ - case function_real_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_dint*/ - break; - -/**** - *REAL_TO_DATE - */ - case function_real_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_date*/ - break; - -/**** - *REAL_TO_DWORD - */ - case function_real_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_dword*/ - break; - -/**** - *REAL_TO_DT - */ - case function_real_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_dt*/ - break; - -/**** - *REAL_TO_TOD - */ - case function_real_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_tod*/ - break; - -/**** - *REAL_TO_UDINT - */ - case function_real_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_udint*/ - break; - -/**** - *REAL_TO_WORD - */ - case function_real_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_word*/ - break; - -/**** - *REAL_TO_STRING - */ - case function_real_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_string*/ - break; - -/**** - *REAL_TO_LWORD - */ - case function_real_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_lword*/ - break; - -/**** - *REAL_TO_UINT - */ - case function_real_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_uint*/ - break; - -/**** - *REAL_TO_LREAL - */ - case function_real_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_lreal*/ - break; - -/**** - *REAL_TO_BYTE - */ - case function_real_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_byte*/ - break; - -/**** - *REAL_TO_USINT - */ - case function_real_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_usint*/ - break; - -/**** - *REAL_TO_ULINT - */ - case function_real_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_ulint*/ - break; - -/**** - *REAL_TO_BOOL - */ - case function_real_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_bool*/ - break; - -/**** - *REAL_TO_TIME - */ - case function_real_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_time*/ - break; - -/**** - *REAL_TO_INT - */ - case function_real_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_int*/ - break; - -/**** - *SINT_TO_REAL - */ - case function_sint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_real*/ - break; - -/**** - *SINT_TO_LINT - */ - case function_sint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_lint*/ - break; - -/**** - *SINT_TO_DINT - */ - case function_sint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_dint*/ - break; - -/**** - *SINT_TO_DATE - */ - case function_sint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_date*/ - break; - -/**** - *SINT_TO_DWORD - */ - case function_sint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_dword*/ - break; - -/**** - *SINT_TO_DT - */ - case function_sint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_dt*/ - break; - -/**** - *SINT_TO_TOD - */ - case function_sint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_tod*/ - break; - -/**** - *SINT_TO_UDINT - */ - case function_sint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_udint*/ - break; - -/**** - *SINT_TO_WORD - */ - case function_sint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_word*/ - break; - -/**** - *SINT_TO_STRING - */ - case function_sint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_string*/ - break; - -/**** - *SINT_TO_LWORD - */ - case function_sint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_lword*/ - break; - -/**** - *SINT_TO_UINT - */ - case function_sint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_uint*/ - break; - -/**** - *SINT_TO_LREAL - */ - case function_sint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_lreal*/ - break; - -/**** - *SINT_TO_BYTE - */ - case function_sint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_byte*/ - break; - -/**** - *SINT_TO_USINT - */ - case function_sint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_usint*/ - break; - -/**** - *SINT_TO_ULINT - */ - case function_sint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_ulint*/ - break; - -/**** - *SINT_TO_BOOL - */ - case function_sint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_bool*/ - break; - -/**** - *SINT_TO_TIME - */ - case function_sint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_time*/ - break; - -/**** - *SINT_TO_INT - */ - case function_sint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_int*/ - break; - -/**** - *LINT_TO_REAL - */ - case function_lint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_real*/ - break; - -/**** - *LINT_TO_SINT - */ - case function_lint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_sint*/ - break; - -/**** - *LINT_TO_DINT - */ - case function_lint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_dint*/ - break; - -/**** - *LINT_TO_DATE - */ - case function_lint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_date*/ - break; - -/**** - *LINT_TO_DWORD - */ - case function_lint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_dword*/ - break; - -/**** - *LINT_TO_DT - */ - case function_lint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_dt*/ - break; - -/**** - *LINT_TO_TOD - */ - case function_lint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_tod*/ - break; - -/**** - *LINT_TO_UDINT - */ - case function_lint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_udint*/ - break; - -/**** - *LINT_TO_WORD - */ - case function_lint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_word*/ - break; - -/**** - *LINT_TO_STRING - */ - case function_lint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_string*/ - break; - -/**** - *LINT_TO_LWORD - */ - case function_lint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_lword*/ - break; - -/**** - *LINT_TO_UINT - */ - case function_lint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_uint*/ - break; - -/**** - *LINT_TO_LREAL - */ - case function_lint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_lreal*/ - break; - -/**** - *LINT_TO_BYTE - */ - case function_lint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_byte*/ - break; - -/**** - *LINT_TO_USINT - */ - case function_lint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_usint*/ - break; - -/**** - *LINT_TO_ULINT - */ - case function_lint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_ulint*/ - break; - -/**** - *LINT_TO_BOOL - */ - case function_lint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_bool*/ - break; - -/**** - *LINT_TO_TIME - */ - case function_lint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_time*/ - break; - -/**** - *LINT_TO_INT - */ - case function_lint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_int*/ - break; - -/**** - *DINT_TO_REAL - */ - case function_dint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_real*/ - break; - -/**** - *DINT_TO_SINT - */ - case function_dint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_sint*/ - break; - -/**** - *DINT_TO_LINT - */ - case function_dint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_lint*/ - break; - -/**** - *DINT_TO_DATE - */ - case function_dint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_date*/ - break; - -/**** - *DINT_TO_DWORD - */ - case function_dint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_dword*/ - break; - -/**** - *DINT_TO_DT - */ - case function_dint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_dt*/ - break; - -/**** - *DINT_TO_TOD - */ - case function_dint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_tod*/ - break; - -/**** - *DINT_TO_UDINT - */ - case function_dint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_udint*/ - break; - -/**** - *DINT_TO_WORD - */ - case function_dint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_word*/ - break; - -/**** - *DINT_TO_STRING - */ - case function_dint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_string*/ - break; - -/**** - *DINT_TO_LWORD - */ - case function_dint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_lword*/ - break; - -/**** - *DINT_TO_UINT - */ - case function_dint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_uint*/ - break; - -/**** - *DINT_TO_LREAL - */ - case function_dint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_lreal*/ - break; - -/**** - *DINT_TO_BYTE - */ - case function_dint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_byte*/ - break; - -/**** - *DINT_TO_USINT - */ - case function_dint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_usint*/ - break; - -/**** - *DINT_TO_ULINT - */ - case function_dint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_ulint*/ - break; - -/**** - *DINT_TO_BOOL - */ - case function_dint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_bool*/ - break; - -/**** - *DINT_TO_TIME - */ - case function_dint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_time*/ - break; - -/**** - *DINT_TO_INT - */ - case function_dint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_int*/ - break; - -/**** - *DATE_TO_REAL - */ - case function_date_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_real*/ - break; - -/**** - *DATE_TO_SINT - */ - case function_date_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_sint*/ - break; - -/**** - *DATE_TO_LINT - */ - case function_date_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_lint*/ - break; - -/**** - *DATE_TO_DINT - */ - case function_date_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_dint*/ - break; - -/**** - *DATE_TO_DWORD - */ - case function_date_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_dword*/ - break; - -/**** - *DATE_TO_UDINT - */ - case function_date_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_udint*/ - break; - -/**** - *DATE_TO_WORD - */ - case function_date_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_word*/ - break; - -/**** - *DATE_TO_STRING - */ - case function_date_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_string*/ - break; - -/**** - *DATE_TO_LWORD - */ - case function_date_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_lword*/ - break; - -/**** - *DATE_TO_UINT - */ - case function_date_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_uint*/ - break; - -/**** - *DATE_TO_LREAL - */ - case function_date_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_lreal*/ - break; - -/**** - *DATE_TO_BYTE - */ - case function_date_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_byte*/ - break; - -/**** - *DATE_TO_USINT - */ - case function_date_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_usint*/ - break; - -/**** - *DATE_TO_ULINT - */ - case function_date_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_ulint*/ - break; - -/**** - *DATE_TO_INT - */ - case function_date_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_int*/ - break; - -/**** - *DWORD_TO_REAL - */ - case function_dword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_real*/ - break; - -/**** - *DWORD_TO_SINT - */ - case function_dword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_sint*/ - break; - -/**** - *DWORD_TO_LINT - */ - case function_dword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_lint*/ - break; - -/**** - *DWORD_TO_DINT - */ - case function_dword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_dint*/ - break; - -/**** - *DWORD_TO_DATE - */ - case function_dword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_date*/ - break; - -/**** - *DWORD_TO_DT - */ - case function_dword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_dt*/ - break; - -/**** - *DWORD_TO_TOD - */ - case function_dword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_tod*/ - break; - -/**** - *DWORD_TO_UDINT - */ - case function_dword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_udint*/ - break; - -/**** - *DWORD_TO_WORD - */ - case function_dword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_word*/ - break; - -/**** - *DWORD_TO_STRING - */ - case function_dword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_string*/ - break; - -/**** - *DWORD_TO_LWORD - */ - case function_dword_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_lword*/ - break; - -/**** - *DWORD_TO_UINT - */ - case function_dword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_uint*/ - break; - -/**** - *DWORD_TO_LREAL - */ - case function_dword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_lreal*/ - break; - -/**** - *DWORD_TO_BYTE - */ - case function_dword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_byte*/ - break; - -/**** - *DWORD_TO_USINT - */ - case function_dword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_usint*/ - break; - -/**** - *DWORD_TO_ULINT - */ - case function_dword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_ulint*/ - break; - -/**** - *DWORD_TO_BOOL - */ - case function_dword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_bool*/ - break; - -/**** - *DWORD_TO_TIME - */ - case function_dword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_time*/ - break; - -/**** - *DWORD_TO_INT - */ - case function_dword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_int*/ - break; - -/**** - *DT_TO_REAL - */ - case function_dt_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_real*/ - break; - -/**** - *DT_TO_SINT - */ - case function_dt_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_sint*/ - break; - -/**** - *DT_TO_LINT - */ - case function_dt_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_lint*/ - break; - -/**** - *DT_TO_DINT - */ - case function_dt_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_dint*/ - break; - -/**** - *DT_TO_DWORD - */ - case function_dt_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_dword*/ - break; - -/**** - *DT_TO_UDINT - */ - case function_dt_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_udint*/ - break; - -/**** - *DT_TO_WORD - */ - case function_dt_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_word*/ - break; - -/**** - *DT_TO_STRING - */ - case function_dt_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_string*/ - break; - -/**** - *DT_TO_LWORD - */ - case function_dt_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_lword*/ - break; - -/**** - *DT_TO_UINT - */ - case function_dt_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_uint*/ - break; - -/**** - *DT_TO_LREAL - */ - case function_dt_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_lreal*/ - break; - -/**** - *DT_TO_BYTE - */ - case function_dt_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_byte*/ - break; - -/**** - *DT_TO_USINT - */ - case function_dt_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_usint*/ - break; - -/**** - *DT_TO_ULINT - */ - case function_dt_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_ulint*/ - break; - -/**** - *DT_TO_INT - */ - case function_dt_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_int*/ - break; - -/**** - *TOD_TO_REAL - */ - case function_tod_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_real*/ - break; - -/**** - *TOD_TO_SINT - */ - case function_tod_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_sint*/ - break; - -/**** - *TOD_TO_LINT - */ - case function_tod_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_lint*/ - break; - -/**** - *TOD_TO_DINT - */ - case function_tod_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_dint*/ - break; - -/**** - *TOD_TO_DWORD - */ - case function_tod_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_dword*/ - break; - -/**** - *TOD_TO_UDINT - */ - case function_tod_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_udint*/ - break; - -/**** - *TOD_TO_WORD - */ - case function_tod_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_word*/ - break; - -/**** - *TOD_TO_STRING - */ - case function_tod_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_string*/ - break; - -/**** - *TOD_TO_LWORD - */ - case function_tod_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_lword*/ - break; - -/**** - *TOD_TO_UINT - */ - case function_tod_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_uint*/ - break; - -/**** - *TOD_TO_LREAL - */ - case function_tod_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_lreal*/ - break; - -/**** - *TOD_TO_BYTE - */ - case function_tod_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_byte*/ - break; - -/**** - *TOD_TO_USINT - */ - case function_tod_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_usint*/ - break; - -/**** - *TOD_TO_ULINT - */ - case function_tod_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_ulint*/ - break; - -/**** - *TOD_TO_INT - */ - case function_tod_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_int*/ - break; - -/**** - *UDINT_TO_REAL - */ - case function_udint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_real*/ - break; - -/**** - *UDINT_TO_SINT - */ - case function_udint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_sint*/ - break; - -/**** - *UDINT_TO_LINT - */ - case function_udint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_lint*/ - break; - -/**** - *UDINT_TO_DINT - */ - case function_udint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_dint*/ - break; - -/**** - *UDINT_TO_DATE - */ - case function_udint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_date*/ - break; - -/**** - *UDINT_TO_DWORD - */ - case function_udint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_dword*/ - break; - -/**** - *UDINT_TO_DT - */ - case function_udint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_dt*/ - break; - -/**** - *UDINT_TO_TOD - */ - case function_udint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_tod*/ - break; - -/**** - *UDINT_TO_WORD - */ - case function_udint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_word*/ - break; - -/**** - *UDINT_TO_STRING - */ - case function_udint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_string*/ - break; - -/**** - *UDINT_TO_LWORD - */ - case function_udint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_lword*/ - break; - -/**** - *UDINT_TO_UINT - */ - case function_udint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_uint*/ - break; - -/**** - *UDINT_TO_LREAL - */ - case function_udint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_lreal*/ - break; - -/**** - *UDINT_TO_BYTE - */ - case function_udint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_byte*/ - break; - -/**** - *UDINT_TO_USINT - */ - case function_udint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_usint*/ - break; - -/**** - *UDINT_TO_ULINT - */ - case function_udint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_ulint*/ - break; - -/**** - *UDINT_TO_BOOL - */ - case function_udint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_bool*/ - break; - -/**** - *UDINT_TO_TIME - */ - case function_udint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_time*/ - break; - -/**** - *UDINT_TO_INT - */ - case function_udint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_int*/ - break; - -/**** - *WORD_TO_REAL - */ - case function_word_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_real*/ - break; - -/**** - *WORD_TO_SINT - */ - case function_word_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_sint*/ - break; - -/**** - *WORD_TO_LINT - */ - case function_word_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_lint*/ - break; - -/**** - *WORD_TO_DINT - */ - case function_word_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_dint*/ - break; - -/**** - *WORD_TO_DATE - */ - case function_word_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_date*/ - break; - -/**** - *WORD_TO_DWORD - */ - case function_word_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_dword*/ - break; - -/**** - *WORD_TO_DT - */ - case function_word_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_dt*/ - break; - -/**** - *WORD_TO_TOD - */ - case function_word_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_tod*/ - break; - -/**** - *WORD_TO_UDINT - */ - case function_word_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_udint*/ - break; - -/**** - *WORD_TO_STRING - */ - case function_word_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_string*/ - break; - -/**** - *WORD_TO_LWORD - */ - case function_word_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_lword*/ - break; - -/**** - *WORD_TO_UINT - */ - case function_word_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_uint*/ - break; - -/**** - *WORD_TO_LREAL - */ - case function_word_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_lreal*/ - break; - -/**** - *WORD_TO_BYTE - */ - case function_word_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_byte*/ - break; - -/**** - *WORD_TO_USINT - */ - case function_word_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_usint*/ - break; - -/**** - *WORD_TO_ULINT - */ - case function_word_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_ulint*/ - break; - -/**** - *WORD_TO_BOOL - */ - case function_word_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_bool*/ - break; - -/**** - *WORD_TO_TIME - */ - case function_word_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_time*/ - break; - -/**** - *WORD_TO_INT - */ - case function_word_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_int*/ - break; - -/**** - *STRING_TO_REAL - */ - case function_string_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_real*/ - break; - -/**** - *STRING_TO_SINT - */ - case function_string_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_sint*/ - break; - -/**** - *STRING_TO_LINT - */ - case function_string_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_lint*/ - break; - -/**** - *STRING_TO_DINT - */ - case function_string_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_dint*/ - break; - -/**** - *STRING_TO_DATE - */ - case function_string_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_date*/ - break; - -/**** - *STRING_TO_DWORD - */ - case function_string_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_dword*/ - break; - -/**** - *STRING_TO_DT - */ - case function_string_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_dt*/ - break; - -/**** - *STRING_TO_TOD - */ - case function_string_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_tod*/ - break; - -/**** - *STRING_TO_UDINT - */ - case function_string_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_udint*/ - break; - -/**** - *STRING_TO_WORD - */ - case function_string_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_word*/ - break; - -/**** - *STRING_TO_LWORD - */ - case function_string_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_lword*/ - break; - -/**** - *STRING_TO_UINT - */ - case function_string_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_uint*/ - break; - -/**** - *STRING_TO_LREAL - */ - case function_string_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_lreal*/ - break; - -/**** - *STRING_TO_BYTE - */ - case function_string_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_byte*/ - break; - -/**** - *STRING_TO_USINT - */ - case function_string_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_usint*/ - break; - -/**** - *STRING_TO_ULINT - */ - case function_string_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_ulint*/ - break; - -/**** - *STRING_TO_BOOL - */ - case function_string_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_bool*/ - break; - -/**** - *STRING_TO_TIME - */ - case function_string_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_time*/ - break; - -/**** - *STRING_TO_INT - */ - case function_string_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_int*/ - break; - -/**** - *LWORD_TO_REAL - */ - case function_lword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_real*/ - break; - -/**** - *LWORD_TO_SINT - */ - case function_lword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_sint*/ - break; - -/**** - *LWORD_TO_LINT - */ - case function_lword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_lint*/ - break; - -/**** - *LWORD_TO_DINT - */ - case function_lword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_dint*/ - break; - -/**** - *LWORD_TO_DATE - */ - case function_lword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_date*/ - break; - -/**** - *LWORD_TO_DWORD - */ - case function_lword_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_dword*/ - break; - -/**** - *LWORD_TO_DT - */ - case function_lword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_dt*/ - break; - -/**** - *LWORD_TO_TOD - */ - case function_lword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_tod*/ - break; - -/**** - *LWORD_TO_UDINT - */ - case function_lword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_udint*/ - break; - -/**** - *LWORD_TO_WORD - */ - case function_lword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_word*/ - break; - -/**** - *LWORD_TO_STRING - */ - case function_lword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_string*/ - break; - -/**** - *LWORD_TO_UINT - */ - case function_lword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_uint*/ - break; - -/**** - *LWORD_TO_LREAL - */ - case function_lword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_lreal*/ - break; - -/**** - *LWORD_TO_BYTE - */ - case function_lword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_byte*/ - break; - -/**** - *LWORD_TO_USINT - */ - case function_lword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_usint*/ - break; - -/**** - *LWORD_TO_ULINT - */ - case function_lword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_ulint*/ - break; - -/**** - *LWORD_TO_BOOL - */ - case function_lword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_bool*/ - break; - -/**** - *LWORD_TO_TIME - */ - case function_lword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_time*/ - break; - -/**** - *LWORD_TO_INT - */ - case function_lword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_int*/ - break; - -/**** - *UINT_TO_REAL - */ - case function_uint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_real*/ - break; - -/**** - *UINT_TO_SINT - */ - case function_uint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_sint*/ - break; - -/**** - *UINT_TO_LINT - */ - case function_uint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_lint*/ - break; - -/**** - *UINT_TO_DINT - */ - case function_uint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_dint*/ - break; - -/**** - *UINT_TO_DATE - */ - case function_uint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_date*/ - break; - -/**** - *UINT_TO_DWORD - */ - case function_uint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_dword*/ - break; - -/**** - *UINT_TO_DT - */ - case function_uint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_dt*/ - break; - -/**** - *UINT_TO_TOD - */ - case function_uint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_tod*/ - break; - -/**** - *UINT_TO_UDINT - */ - case function_uint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_udint*/ - break; - -/**** - *UINT_TO_WORD - */ - case function_uint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_word*/ - break; - -/**** - *UINT_TO_STRING - */ - case function_uint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_string*/ - break; - -/**** - *UINT_TO_LWORD - */ - case function_uint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_lword*/ - break; - -/**** - *UINT_TO_LREAL - */ - case function_uint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_lreal*/ - break; - -/**** - *UINT_TO_BYTE - */ - case function_uint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_byte*/ - break; - -/**** - *UINT_TO_USINT - */ - case function_uint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_usint*/ - break; - -/**** - *UINT_TO_ULINT - */ - case function_uint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_ulint*/ - break; - -/**** - *UINT_TO_BOOL - */ - case function_uint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_bool*/ - break; - -/**** - *UINT_TO_TIME - */ - case function_uint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_time*/ - break; - -/**** - *UINT_TO_INT - */ - case function_uint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_int*/ - break; - -/**** - *LREAL_TO_REAL - */ - case function_lreal_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_real*/ - break; - -/**** - *LREAL_TO_SINT - */ - case function_lreal_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_sint*/ - break; - -/**** - *LREAL_TO_LINT - */ - case function_lreal_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_lint*/ - break; - -/**** - *LREAL_TO_DINT - */ - case function_lreal_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_dint*/ - break; - -/**** - *LREAL_TO_DATE - */ - case function_lreal_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_date*/ - break; - -/**** - *LREAL_TO_DWORD - */ - case function_lreal_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_dword*/ - break; - -/**** - *LREAL_TO_DT - */ - case function_lreal_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_dt*/ - break; - -/**** - *LREAL_TO_TOD - */ - case function_lreal_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_tod*/ - break; - -/**** - *LREAL_TO_UDINT - */ - case function_lreal_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_udint*/ - break; - -/**** - *LREAL_TO_WORD - */ - case function_lreal_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_word*/ - break; - -/**** - *LREAL_TO_STRING - */ - case function_lreal_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_string*/ - break; - -/**** - *LREAL_TO_LWORD - */ - case function_lreal_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_lword*/ - break; - -/**** - *LREAL_TO_UINT - */ - case function_lreal_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_uint*/ - break; - -/**** - *LREAL_TO_BYTE - */ - case function_lreal_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_byte*/ - break; - -/**** - *LREAL_TO_USINT - */ - case function_lreal_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_usint*/ - break; - -/**** - *LREAL_TO_ULINT - */ - case function_lreal_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_ulint*/ - break; - -/**** - *LREAL_TO_BOOL - */ - case function_lreal_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_bool*/ - break; - -/**** - *LREAL_TO_TIME - */ - case function_lreal_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_time*/ - break; - -/**** - *LREAL_TO_INT - */ - case function_lreal_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_int*/ - break; - -/**** - *BYTE_TO_REAL - */ - case function_byte_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_real*/ - break; - -/**** - *BYTE_TO_SINT - */ - case function_byte_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_sint*/ - break; - -/**** - *BYTE_TO_LINT - */ - case function_byte_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_lint*/ - break; - -/**** - *BYTE_TO_DINT - */ - case function_byte_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_dint*/ - break; - -/**** - *BYTE_TO_DATE - */ - case function_byte_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_date*/ - break; - -/**** - *BYTE_TO_DWORD - */ - case function_byte_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_dword*/ - break; - -/**** - *BYTE_TO_DT - */ - case function_byte_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_dt*/ - break; - -/**** - *BYTE_TO_TOD - */ - case function_byte_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_tod*/ - break; - -/**** - *BYTE_TO_UDINT - */ - case function_byte_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_udint*/ - break; - -/**** - *BYTE_TO_WORD - */ - case function_byte_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_word*/ - break; - -/**** - *BYTE_TO_STRING - */ - case function_byte_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_string*/ - break; - -/**** - *BYTE_TO_LWORD - */ - case function_byte_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_lword*/ - break; - -/**** - *BYTE_TO_UINT - */ - case function_byte_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_uint*/ - break; - -/**** - *BYTE_TO_LREAL - */ - case function_byte_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_lreal*/ - break; - -/**** - *BYTE_TO_USINT - */ - case function_byte_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_usint*/ - break; - -/**** - *BYTE_TO_ULINT - */ - case function_byte_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_ulint*/ - break; - -/**** - *BYTE_TO_BOOL - */ - case function_byte_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_bool*/ - break; - -/**** - *BYTE_TO_TIME - */ - case function_byte_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_time*/ - break; - -/**** - *BYTE_TO_INT - */ - case function_byte_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_int*/ - break; - -/**** - *USINT_TO_REAL - */ - case function_usint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_real*/ - break; - -/**** - *USINT_TO_SINT - */ - case function_usint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_sint*/ - break; - -/**** - *USINT_TO_LINT - */ - case function_usint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_lint*/ - break; - -/**** - *USINT_TO_DINT - */ - case function_usint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_dint*/ - break; - -/**** - *USINT_TO_DATE - */ - case function_usint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_date*/ - break; - -/**** - *USINT_TO_DWORD - */ - case function_usint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_dword*/ - break; - -/**** - *USINT_TO_DT - */ - case function_usint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_dt*/ - break; - -/**** - *USINT_TO_TOD - */ - case function_usint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_tod*/ - break; - -/**** - *USINT_TO_UDINT - */ - case function_usint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_udint*/ - break; - -/**** - *USINT_TO_WORD - */ - case function_usint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_word*/ - break; - -/**** - *USINT_TO_STRING - */ - case function_usint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_string*/ - break; - -/**** - *USINT_TO_LWORD - */ - case function_usint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_lword*/ - break; - -/**** - *USINT_TO_UINT - */ - case function_usint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_uint*/ - break; - -/**** - *USINT_TO_LREAL - */ - case function_usint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_lreal*/ - break; - -/**** - *USINT_TO_BYTE - */ - case function_usint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_byte*/ - break; - -/**** - *USINT_TO_ULINT - */ - case function_usint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_ulint*/ - break; - -/**** - *USINT_TO_BOOL - */ - case function_usint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_bool*/ - break; - -/**** - *USINT_TO_TIME - */ - case function_usint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_time*/ - break; - -/**** - *USINT_TO_INT - */ - case function_usint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_int*/ - break; - -/**** - *ULINT_TO_REAL - */ - case function_ulint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_real*/ - break; - -/**** - *ULINT_TO_SINT - */ - case function_ulint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_sint*/ - break; - -/**** - *ULINT_TO_LINT - */ - case function_ulint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_lint*/ - break; - -/**** - *ULINT_TO_DINT - */ - case function_ulint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_dint*/ - break; - -/**** - *ULINT_TO_DATE - */ - case function_ulint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_date*/ - break; - -/**** - *ULINT_TO_DWORD - */ - case function_ulint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_dword*/ - break; - -/**** - *ULINT_TO_DT - */ - case function_ulint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_dt*/ - break; - -/**** - *ULINT_TO_TOD - */ - case function_ulint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_tod*/ - break; - -/**** - *ULINT_TO_UDINT - */ - case function_ulint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_udint*/ - break; - -/**** - *ULINT_TO_WORD - */ - case function_ulint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_word*/ - break; - -/**** - *ULINT_TO_STRING - */ - case function_ulint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_string*/ - break; - -/**** - *ULINT_TO_LWORD - */ - case function_ulint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_lword*/ - break; - -/**** - *ULINT_TO_UINT - */ - case function_ulint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_uint*/ - break; - -/**** - *ULINT_TO_LREAL - */ - case function_ulint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_lreal*/ - break; - -/**** - *ULINT_TO_BYTE - */ - case function_ulint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_byte*/ - break; - -/**** - *ULINT_TO_USINT - */ - case function_ulint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_usint*/ - break; - -/**** - *ULINT_TO_BOOL - */ - case function_ulint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_bool*/ - break; - -/**** - *ULINT_TO_TIME - */ - case function_ulint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_time*/ - break; - -/**** - *ULINT_TO_INT - */ - case function_ulint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_int*/ - break; - -/**** - *BOOL_TO_REAL - */ - case function_bool_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_real*/ - break; - -/**** - *BOOL_TO_SINT - */ - case function_bool_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_sint*/ - break; - -/**** - *BOOL_TO_LINT - */ - case function_bool_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_lint*/ - break; - -/**** - *BOOL_TO_DINT - */ - case function_bool_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_dint*/ - break; - -/**** - *BOOL_TO_DATE - */ - case function_bool_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_date*/ - break; - -/**** - *BOOL_TO_DWORD - */ - case function_bool_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_dword*/ - break; - -/**** - *BOOL_TO_DT - */ - case function_bool_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_dt*/ - break; - -/**** - *BOOL_TO_TOD - */ - case function_bool_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_tod*/ - break; - -/**** - *BOOL_TO_UDINT - */ - case function_bool_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_udint*/ - break; - -/**** - *BOOL_TO_WORD - */ - case function_bool_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_word*/ - break; - -/**** - *BOOL_TO_STRING - */ - case function_bool_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_string*/ - break; - -/**** - *BOOL_TO_LWORD - */ - case function_bool_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_lword*/ - break; - -/**** - *BOOL_TO_UINT - */ - case function_bool_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_uint*/ - break; - -/**** - *BOOL_TO_LREAL - */ - case function_bool_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_lreal*/ - break; - -/**** - *BOOL_TO_BYTE - */ - case function_bool_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_byte*/ - break; - -/**** - *BOOL_TO_USINT - */ - case function_bool_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_usint*/ - break; - -/**** - *BOOL_TO_ULINT - */ - case function_bool_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_ulint*/ - break; - -/**** - *BOOL_TO_TIME - */ - case function_bool_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_time*/ - break; - -/**** - *BOOL_TO_INT - */ - case function_bool_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_int*/ - break; - -/**** - *TIME_TO_REAL - */ - case function_time_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_real*/ - break; - -/**** - *TIME_TO_SINT - */ - case function_time_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_sint*/ - break; - -/**** - *TIME_TO_LINT - */ - case function_time_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_lint*/ - break; - -/**** - *TIME_TO_DINT - */ - case function_time_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_dint*/ - break; - -/**** - *TIME_TO_DWORD - */ - case function_time_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_dword*/ - break; - -/**** - *TIME_TO_UDINT - */ - case function_time_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_udint*/ - break; - -/**** - *TIME_TO_WORD - */ - case function_time_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_word*/ - break; - -/**** - *TIME_TO_STRING - */ - case function_time_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_string*/ - break; - -/**** - *TIME_TO_LWORD - */ - case function_time_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_lword*/ - break; - -/**** - *TIME_TO_UINT - */ - case function_time_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_uint*/ - break; - -/**** - *TIME_TO_LREAL - */ - case function_time_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_lreal*/ - break; - -/**** - *TIME_TO_BYTE - */ - case function_time_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_byte*/ - break; - -/**** - *TIME_TO_USINT - */ - case function_time_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_usint*/ - break; - -/**** - *TIME_TO_ULINT - */ - case function_time_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_ulint*/ - break; - -/**** - *TIME_TO_INT - */ - case function_time_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_int*/ - break; - -/**** - *INT_TO_REAL - */ - case function_int_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_real*/ - break; - -/**** - *INT_TO_SINT - */ - case function_int_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_sint*/ - break; - -/**** - *INT_TO_LINT - */ - case function_int_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_lint*/ - break; - -/**** - *INT_TO_DINT - */ - case function_int_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_dint*/ - break; - -/**** - *INT_TO_DATE - */ - case function_int_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_date*/ - break; - -/**** - *INT_TO_DWORD - */ - case function_int_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_dword*/ - break; - -/**** - *INT_TO_DT - */ - case function_int_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_dt*/ - break; - -/**** - *INT_TO_TOD - */ - case function_int_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_tod*/ - break; - -/**** - *INT_TO_UDINT - */ - case function_int_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_udint*/ - break; - -/**** - *INT_TO_WORD - */ - case function_int_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_word*/ - break; - -/**** - *INT_TO_STRING - */ - case function_int_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_string*/ - break; - -/**** - *INT_TO_LWORD - */ - case function_int_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_lword*/ - break; - -/**** - *INT_TO_UINT - */ - case function_int_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_uint*/ - break; - -/**** - *INT_TO_LREAL - */ - case function_int_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_lreal*/ - break; - -/**** - *INT_TO_BYTE - */ - case function_int_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_byte*/ - break; - -/**** - *INT_TO_USINT - */ - case function_int_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_usint*/ - break; - -/**** - *INT_TO_ULINT - */ - case function_int_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_ulint*/ - break; - -/**** - *INT_TO_BOOL - */ - case function_int_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_bool*/ - break; - -/**** - *INT_TO_TIME - */ - case function_int_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_time*/ - break; - -/**** - *TRUNC - */ - case function_trunc : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_trunc*/ - break; - -/**** - *BCD_TO_UDINT - */ - case function_bcd_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_udint*/ - break; - -/**** - *BCD_TO_UINT - */ - case function_bcd_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_uint*/ - break; - -/**** - *BCD_TO_ULINT - */ - case function_bcd_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_ulint*/ - break; - -/**** - *BCD_TO_USINT - */ - case function_bcd_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_usint*/ - break; - -/**** - *UDINT_TO_BCD - */ - case function_udint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_bcd*/ - break; - -/**** - *UINT_TO_BCD - */ - case function_uint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_bcd*/ - break; - -/**** - *USINT_TO_BCD - */ - case function_usint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_bcd*/ - break; - -/**** - *ULINT_TO_BCD - */ - case function_ulint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_bcd*/ - break; - -/**** - *DATE_AND_TIME_TO_TIME_OF_DAY - */ - case function_date_and_time_to_time_of_day : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_and_time_to_time_of_day*/ - break; - -/**** - *DATE_AND_TIME_TO_DATE - */ - case function_date_and_time_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_and_time_to_date*/ - break; - -/**** - *ABS - */ - case function_abs : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_abs*/ - break; - -/**** - *SQRT - */ - case function_sqrt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sqrt*/ - break; - -/**** - *LN - */ - case function_ln : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ln*/ - break; - -/**** - *LOG - */ - case function_log : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_log*/ - break; - -/**** - *EXP - */ - case function_exp : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_exp*/ - break; - -/**** - *SIN - */ - case function_sin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sin*/ - break; - -/**** - *COS - */ - case function_cos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_cos*/ - break; - -/**** - *TAN - */ - case function_tan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tan*/ - break; - -/**** - *ASIN - */ - case function_asin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_asin*/ - break; - -/**** - *ACOS - */ - case function_acos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_acos*/ - break; - -/**** - *ATAN - */ - case function_atan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_atan*/ - break; - -/**** - *ADD - */ - case function_add : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add*/ - break; - -/**** - *MUL - */ - case function_mul : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mul*/ - break; - -/**** - *SUB - */ - case function_sub : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub*/ - break; - -/**** - *DIV - */ - case function_div : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_div*/ - break; - -/**** - *MOD - */ - case function_mod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mod*/ - break; - -/**** - *EXPT - */ - case function_expt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = IN1_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_expt*/ - break; - -/**** - *MOVE - */ - case function_move : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_move*/ - break; - -/**** - *ADD_TIME - */ - case function_add_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_time*/ - break; - -/**** - *ADD_TOD_TIME - */ - case function_add_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_tod_time*/ - break; - -/**** - *ADD_DT_TIME - */ - case function_add_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_dt_time*/ - break; - -/**** - *MULTIME - */ - case function_multime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_multime*/ - break; - -/**** - *SUB_TIME - */ - case function_sub_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_time*/ - break; - -/**** - *SUB_DATE_DATE - */ - case function_sub_date_date : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_date_date*/ - break; - -/**** - *SUB_TOD_TIME - */ - case function_sub_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_time*/ - break; - -/**** - *SUB_TOD_TOD - */ - case function_sub_tod_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_tod*/ - break; - -/**** - *SUB_DT_TIME - */ - case function_sub_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_dt_time*/ - break; - -/**** - *DIVTIME - */ - case function_divtime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_divtime*/ - break; - -/**** - *SHL - */ - case function_shl : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shl*/ - break; - -/**** - *SHR - */ - case function_shr : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shr*/ - break; - -/**** - *ROR - */ - case function_ror : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ror*/ - break; - -/**** - *ROL - */ - case function_rol : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_rol*/ - break; - -/**** - *AND - */ - case function_and : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_and*/ - break; - -/**** - *OR - */ - case function_or : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_or*/ - break; - -/**** - *XOR - */ - case function_xor : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_xor*/ - break; - -/**** - *NOT - */ - case function_not : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_not*/ - break; - -/**** - *SEL - */ - case function_sel : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *G_param_name = (symbol_c *)(new identifier_c("G")); - /* Get the value from a foo( = ) style call */ - symbol_c *G_param_value = function_call_param_iterator.search_f(G_param_name); - symbol_c *G_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (G_param_value == NULL) - G_param_value = function_call_param_iterator.next_nf(); - if (G_param_value != NULL) { - G_type_symbol = search_expression_type->get_type(G_param_value); - last_type_symbol = last_type_symbol && G_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ; - } - - if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sel*/ - break; - -/**** - *MAX - */ - case function_max : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_max*/ - break; - -/**** - *MIN - */ - case function_min : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_min*/ - break; - -/**** - *LIMIT - */ - case function_limit : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *MN_param_name = (symbol_c *)(new identifier_c("MN")); - /* Get the value from a foo( = ) style call */ - symbol_c *MN_param_value = function_call_param_iterator.search_f(MN_param_name); - symbol_c *MN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (MN_param_value == NULL) - MN_param_value = function_call_param_iterator.next_nf(); - if (MN_param_value != NULL) { - MN_type_symbol = search_expression_type->get_type(MN_param_value); - last_type_symbol = last_type_symbol && MN_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ; - } - - - { - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - - { - - { - symbol_c *MX_param_name = (symbol_c *)(new identifier_c("MX")); - /* Get the value from a foo( = ) style call */ - symbol_c *MX_param_value = function_call_param_iterator.search_f(MX_param_name); - symbol_c *MX_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (MX_param_value == NULL) - MX_param_value = function_call_param_iterator.next_nf(); - if (MX_param_value != NULL) { - MX_type_symbol = search_expression_type->get_type(MX_param_value); - last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_limit*/ - break; - -/**** - *MUX - */ - case function_mux : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *K_param_name = (symbol_c *)(new identifier_c("K")); - /* Get the value from a foo( = ) style call */ - symbol_c *K_param_value = function_call_param_iterator.search_f(K_param_name); - symbol_c *K_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (K_param_value == NULL) - K_param_value = function_call_param_iterator.next_nf(); - if (K_param_value != NULL) { - K_type_symbol = search_expression_type->get_type(K_param_value); - last_type_symbol = last_type_symbol && K_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ; - } - - if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mux*/ - break; - -/**** - *GT - */ - case function_gt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_gt*/ - break; - -/**** - *GE - */ - case function_ge : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ge*/ - break; - -/**** - *EQ - */ - case function_eq : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_eq*/ - break; - -/**** - *LT - */ - case function_lt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_lt*/ - break; - -/**** - *LE - */ - case function_le : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_le*/ - break; - -/**** - *NE - */ - case function_ne : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ne*/ - break; - -/**** - *LEN - */ - case function_len : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_len*/ - break; - -/**** - *LEFT - */ - case function_left : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_left*/ - break; - -/**** - *RIGHT - */ - case function_right : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_right*/ - break; - -/**** - *MID - */ - case function_mid : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mid*/ - break; - -/**** - *CONCAT - */ - case function_concat : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat*/ - break; - -/**** - *CONCAT_DAT_TOD - */ - case function_concat_dat_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat_dat_tod*/ - break; - -/**** - *INSERT - */ - case function_insert : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_insert*/ - break; - -/**** - *DELETE - */ - case function_delete : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_delete*/ - break; - -/**** - *REPLACE - */ - case function_replace : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_replace*/ - break; - -/**** - *FIND - */ - case function_find : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_find*/ - break; - - case function_none : - ERROR; - } - return NULL; -} - -void *search_expression_type_c::compute_standard_function_il(il_function_call_c *symbol, symbol_c *param_data_type) { - - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - function_call_param_iterator_c function_call_param_iterator(symbol); - search_expression_type_c* search_expression_type = this; - - switch(current_function_type){ - -/**** - *REAL_TO_SINT - */ - case function_real_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_sint*/ - break; - -/**** - *REAL_TO_LINT - */ - case function_real_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_lint*/ - break; - -/**** - *REAL_TO_DINT - */ - case function_real_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_dint*/ - break; - -/**** - *REAL_TO_DATE - */ - case function_real_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_date*/ - break; - -/**** - *REAL_TO_DWORD - */ - case function_real_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_dword*/ - break; - -/**** - *REAL_TO_DT - */ - case function_real_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_dt*/ - break; - -/**** - *REAL_TO_TOD - */ - case function_real_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_tod*/ - break; - -/**** - *REAL_TO_UDINT - */ - case function_real_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_udint*/ - break; - -/**** - *REAL_TO_WORD - */ - case function_real_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_word*/ - break; - -/**** - *REAL_TO_STRING - */ - case function_real_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_string*/ - break; - -/**** - *REAL_TO_LWORD - */ - case function_real_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_lword*/ - break; - -/**** - *REAL_TO_UINT - */ - case function_real_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_uint*/ - break; - -/**** - *REAL_TO_LREAL - */ - case function_real_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_lreal*/ - break; - -/**** - *REAL_TO_BYTE - */ - case function_real_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_byte*/ - break; - -/**** - *REAL_TO_USINT - */ - case function_real_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_usint*/ - break; - -/**** - *REAL_TO_ULINT - */ - case function_real_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_ulint*/ - break; - -/**** - *REAL_TO_BOOL - */ - case function_real_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_bool*/ - break; - -/**** - *REAL_TO_TIME - */ - case function_real_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_time*/ - break; - -/**** - *REAL_TO_INT - */ - case function_real_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_real_to_int*/ - break; - -/**** - *SINT_TO_REAL - */ - case function_sint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_real*/ - break; - -/**** - *SINT_TO_LINT - */ - case function_sint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_lint*/ - break; - -/**** - *SINT_TO_DINT - */ - case function_sint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_dint*/ - break; - -/**** - *SINT_TO_DATE - */ - case function_sint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_date*/ - break; - -/**** - *SINT_TO_DWORD - */ - case function_sint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_dword*/ - break; - -/**** - *SINT_TO_DT - */ - case function_sint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_dt*/ - break; - -/**** - *SINT_TO_TOD - */ - case function_sint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_tod*/ - break; - -/**** - *SINT_TO_UDINT - */ - case function_sint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_udint*/ - break; - -/**** - *SINT_TO_WORD - */ - case function_sint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_word*/ - break; - -/**** - *SINT_TO_STRING - */ - case function_sint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_string*/ - break; - -/**** - *SINT_TO_LWORD - */ - case function_sint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_lword*/ - break; - -/**** - *SINT_TO_UINT - */ - case function_sint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_uint*/ - break; - -/**** - *SINT_TO_LREAL - */ - case function_sint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_lreal*/ - break; - -/**** - *SINT_TO_BYTE - */ - case function_sint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_byte*/ - break; - -/**** - *SINT_TO_USINT - */ - case function_sint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_usint*/ - break; - -/**** - *SINT_TO_ULINT - */ - case function_sint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_ulint*/ - break; - -/**** - *SINT_TO_BOOL - */ - case function_sint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_bool*/ - break; - -/**** - *SINT_TO_TIME - */ - case function_sint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_time*/ - break; - -/**** - *SINT_TO_INT - */ - case function_sint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sint_to_int*/ - break; - -/**** - *LINT_TO_REAL - */ - case function_lint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_real*/ - break; - -/**** - *LINT_TO_SINT - */ - case function_lint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_sint*/ - break; - -/**** - *LINT_TO_DINT - */ - case function_lint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_dint*/ - break; - -/**** - *LINT_TO_DATE - */ - case function_lint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_date*/ - break; - -/**** - *LINT_TO_DWORD - */ - case function_lint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_dword*/ - break; - -/**** - *LINT_TO_DT - */ - case function_lint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_dt*/ - break; - -/**** - *LINT_TO_TOD - */ - case function_lint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_tod*/ - break; - -/**** - *LINT_TO_UDINT - */ - case function_lint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_udint*/ - break; - -/**** - *LINT_TO_WORD - */ - case function_lint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_word*/ - break; - -/**** - *LINT_TO_STRING - */ - case function_lint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_string*/ - break; - -/**** - *LINT_TO_LWORD - */ - case function_lint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_lword*/ - break; - -/**** - *LINT_TO_UINT - */ - case function_lint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_uint*/ - break; - -/**** - *LINT_TO_LREAL - */ - case function_lint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_lreal*/ - break; - -/**** - *LINT_TO_BYTE - */ - case function_lint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_byte*/ - break; - -/**** - *LINT_TO_USINT - */ - case function_lint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_usint*/ - break; - -/**** - *LINT_TO_ULINT - */ - case function_lint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_ulint*/ - break; - -/**** - *LINT_TO_BOOL - */ - case function_lint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_bool*/ - break; - -/**** - *LINT_TO_TIME - */ - case function_lint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_time*/ - break; - -/**** - *LINT_TO_INT - */ - case function_lint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lint_to_int*/ - break; - -/**** - *DINT_TO_REAL - */ - case function_dint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_real*/ - break; - -/**** - *DINT_TO_SINT - */ - case function_dint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_sint*/ - break; - -/**** - *DINT_TO_LINT - */ - case function_dint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_lint*/ - break; - -/**** - *DINT_TO_DATE - */ - case function_dint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_date*/ - break; - -/**** - *DINT_TO_DWORD - */ - case function_dint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_dword*/ - break; - -/**** - *DINT_TO_DT - */ - case function_dint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_dt*/ - break; - -/**** - *DINT_TO_TOD - */ - case function_dint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_tod*/ - break; - -/**** - *DINT_TO_UDINT - */ - case function_dint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_udint*/ - break; - -/**** - *DINT_TO_WORD - */ - case function_dint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_word*/ - break; - -/**** - *DINT_TO_STRING - */ - case function_dint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_string*/ - break; - -/**** - *DINT_TO_LWORD - */ - case function_dint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_lword*/ - break; - -/**** - *DINT_TO_UINT - */ - case function_dint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_uint*/ - break; - -/**** - *DINT_TO_LREAL - */ - case function_dint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_lreal*/ - break; - -/**** - *DINT_TO_BYTE - */ - case function_dint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_byte*/ - break; - -/**** - *DINT_TO_USINT - */ - case function_dint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_usint*/ - break; - -/**** - *DINT_TO_ULINT - */ - case function_dint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_ulint*/ - break; - -/**** - *DINT_TO_BOOL - */ - case function_dint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_bool*/ - break; - -/**** - *DINT_TO_TIME - */ - case function_dint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_time*/ - break; - -/**** - *DINT_TO_INT - */ - case function_dint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dint_to_int*/ - break; - -/**** - *DATE_TO_REAL - */ - case function_date_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_real*/ - break; - -/**** - *DATE_TO_SINT - */ - case function_date_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_sint*/ - break; - -/**** - *DATE_TO_LINT - */ - case function_date_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_lint*/ - break; - -/**** - *DATE_TO_DINT - */ - case function_date_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_dint*/ - break; - -/**** - *DATE_TO_DWORD - */ - case function_date_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_dword*/ - break; - -/**** - *DATE_TO_UDINT - */ - case function_date_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_udint*/ - break; - -/**** - *DATE_TO_WORD - */ - case function_date_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_word*/ - break; - -/**** - *DATE_TO_STRING - */ - case function_date_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_string*/ - break; - -/**** - *DATE_TO_LWORD - */ - case function_date_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_lword*/ - break; - -/**** - *DATE_TO_UINT - */ - case function_date_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_uint*/ - break; - -/**** - *DATE_TO_LREAL - */ - case function_date_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_lreal*/ - break; - -/**** - *DATE_TO_BYTE - */ - case function_date_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_byte*/ - break; - -/**** - *DATE_TO_USINT - */ - case function_date_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_usint*/ - break; - -/**** - *DATE_TO_ULINT - */ - case function_date_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_ulint*/ - break; - -/**** - *DATE_TO_INT - */ - case function_date_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_to_int*/ - break; - -/**** - *DWORD_TO_REAL - */ - case function_dword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_real*/ - break; - -/**** - *DWORD_TO_SINT - */ - case function_dword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_sint*/ - break; - -/**** - *DWORD_TO_LINT - */ - case function_dword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_lint*/ - break; - -/**** - *DWORD_TO_DINT - */ - case function_dword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_dint*/ - break; - -/**** - *DWORD_TO_DATE - */ - case function_dword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_date*/ - break; - -/**** - *DWORD_TO_DT - */ - case function_dword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_dt*/ - break; - -/**** - *DWORD_TO_TOD - */ - case function_dword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_tod*/ - break; - -/**** - *DWORD_TO_UDINT - */ - case function_dword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_udint*/ - break; - -/**** - *DWORD_TO_WORD - */ - case function_dword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_word*/ - break; - -/**** - *DWORD_TO_STRING - */ - case function_dword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_string*/ - break; - -/**** - *DWORD_TO_LWORD - */ - case function_dword_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_lword*/ - break; - -/**** - *DWORD_TO_UINT - */ - case function_dword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_uint*/ - break; - -/**** - *DWORD_TO_LREAL - */ - case function_dword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_lreal*/ - break; - -/**** - *DWORD_TO_BYTE - */ - case function_dword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_byte*/ - break; - -/**** - *DWORD_TO_USINT - */ - case function_dword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_usint*/ - break; - -/**** - *DWORD_TO_ULINT - */ - case function_dword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_ulint*/ - break; - -/**** - *DWORD_TO_BOOL - */ - case function_dword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_bool*/ - break; - -/**** - *DWORD_TO_TIME - */ - case function_dword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_time*/ - break; - -/**** - *DWORD_TO_INT - */ - case function_dword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dword_to_int*/ - break; - -/**** - *DT_TO_REAL - */ - case function_dt_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_real*/ - break; - -/**** - *DT_TO_SINT - */ - case function_dt_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_sint*/ - break; - -/**** - *DT_TO_LINT - */ - case function_dt_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_lint*/ - break; - -/**** - *DT_TO_DINT - */ - case function_dt_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_dint*/ - break; - -/**** - *DT_TO_DWORD - */ - case function_dt_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_dword*/ - break; - -/**** - *DT_TO_UDINT - */ - case function_dt_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_udint*/ - break; - -/**** - *DT_TO_WORD - */ - case function_dt_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_word*/ - break; - -/**** - *DT_TO_STRING - */ - case function_dt_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_string*/ - break; - -/**** - *DT_TO_LWORD - */ - case function_dt_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_lword*/ - break; - -/**** - *DT_TO_UINT - */ - case function_dt_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_uint*/ - break; - -/**** - *DT_TO_LREAL - */ - case function_dt_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_lreal*/ - break; - -/**** - *DT_TO_BYTE - */ - case function_dt_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_byte*/ - break; - -/**** - *DT_TO_USINT - */ - case function_dt_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_usint*/ - break; - -/**** - *DT_TO_ULINT - */ - case function_dt_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_ulint*/ - break; - -/**** - *DT_TO_INT - */ - case function_dt_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_dt_to_int*/ - break; - -/**** - *TOD_TO_REAL - */ - case function_tod_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_real*/ - break; - -/**** - *TOD_TO_SINT - */ - case function_tod_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_sint*/ - break; - -/**** - *TOD_TO_LINT - */ - case function_tod_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_lint*/ - break; - -/**** - *TOD_TO_DINT - */ - case function_tod_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_dint*/ - break; - -/**** - *TOD_TO_DWORD - */ - case function_tod_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_dword*/ - break; - -/**** - *TOD_TO_UDINT - */ - case function_tod_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_udint*/ - break; - -/**** - *TOD_TO_WORD - */ - case function_tod_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_word*/ - break; - -/**** - *TOD_TO_STRING - */ - case function_tod_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_string*/ - break; - -/**** - *TOD_TO_LWORD - */ - case function_tod_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_lword*/ - break; - -/**** - *TOD_TO_UINT - */ - case function_tod_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_uint*/ - break; - -/**** - *TOD_TO_LREAL - */ - case function_tod_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_lreal*/ - break; - -/**** - *TOD_TO_BYTE - */ - case function_tod_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_byte*/ - break; - -/**** - *TOD_TO_USINT - */ - case function_tod_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_usint*/ - break; - -/**** - *TOD_TO_ULINT - */ - case function_tod_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_ulint*/ - break; - -/**** - *TOD_TO_INT - */ - case function_tod_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tod_to_int*/ - break; - -/**** - *UDINT_TO_REAL - */ - case function_udint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_real*/ - break; - -/**** - *UDINT_TO_SINT - */ - case function_udint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_sint*/ - break; - -/**** - *UDINT_TO_LINT - */ - case function_udint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_lint*/ - break; - -/**** - *UDINT_TO_DINT - */ - case function_udint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_dint*/ - break; - -/**** - *UDINT_TO_DATE - */ - case function_udint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_date*/ - break; - -/**** - *UDINT_TO_DWORD - */ - case function_udint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_dword*/ - break; - -/**** - *UDINT_TO_DT - */ - case function_udint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_dt*/ - break; - -/**** - *UDINT_TO_TOD - */ - case function_udint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_tod*/ - break; - -/**** - *UDINT_TO_WORD - */ - case function_udint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_word*/ - break; - -/**** - *UDINT_TO_STRING - */ - case function_udint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_string*/ - break; - -/**** - *UDINT_TO_LWORD - */ - case function_udint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_lword*/ - break; - -/**** - *UDINT_TO_UINT - */ - case function_udint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_uint*/ - break; - -/**** - *UDINT_TO_LREAL - */ - case function_udint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_lreal*/ - break; - -/**** - *UDINT_TO_BYTE - */ - case function_udint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_byte*/ - break; - -/**** - *UDINT_TO_USINT - */ - case function_udint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_usint*/ - break; - -/**** - *UDINT_TO_ULINT - */ - case function_udint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_ulint*/ - break; - -/**** - *UDINT_TO_BOOL - */ - case function_udint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_bool*/ - break; - -/**** - *UDINT_TO_TIME - */ - case function_udint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_time*/ - break; - -/**** - *UDINT_TO_INT - */ - case function_udint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_int*/ - break; - -/**** - *WORD_TO_REAL - */ - case function_word_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_real*/ - break; - -/**** - *WORD_TO_SINT - */ - case function_word_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_sint*/ - break; - -/**** - *WORD_TO_LINT - */ - case function_word_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_lint*/ - break; - -/**** - *WORD_TO_DINT - */ - case function_word_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_dint*/ - break; - -/**** - *WORD_TO_DATE - */ - case function_word_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_date*/ - break; - -/**** - *WORD_TO_DWORD - */ - case function_word_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_dword*/ - break; - -/**** - *WORD_TO_DT - */ - case function_word_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_dt*/ - break; - -/**** - *WORD_TO_TOD - */ - case function_word_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_tod*/ - break; - -/**** - *WORD_TO_UDINT - */ - case function_word_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_udint*/ - break; - -/**** - *WORD_TO_STRING - */ - case function_word_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_string*/ - break; - -/**** - *WORD_TO_LWORD - */ - case function_word_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_lword*/ - break; - -/**** - *WORD_TO_UINT - */ - case function_word_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_uint*/ - break; - -/**** - *WORD_TO_LREAL - */ - case function_word_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_lreal*/ - break; - -/**** - *WORD_TO_BYTE - */ - case function_word_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_byte*/ - break; - -/**** - *WORD_TO_USINT - */ - case function_word_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_usint*/ - break; - -/**** - *WORD_TO_ULINT - */ - case function_word_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_ulint*/ - break; - -/**** - *WORD_TO_BOOL - */ - case function_word_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_bool*/ - break; - -/**** - *WORD_TO_TIME - */ - case function_word_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_time*/ - break; - -/**** - *WORD_TO_INT - */ - case function_word_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_word_to_int*/ - break; - -/**** - *STRING_TO_REAL - */ - case function_string_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_real*/ - break; - -/**** - *STRING_TO_SINT - */ - case function_string_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_sint*/ - break; - -/**** - *STRING_TO_LINT - */ - case function_string_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_lint*/ - break; - -/**** - *STRING_TO_DINT - */ - case function_string_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_dint*/ - break; - -/**** - *STRING_TO_DATE - */ - case function_string_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_date*/ - break; - -/**** - *STRING_TO_DWORD - */ - case function_string_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_dword*/ - break; - -/**** - *STRING_TO_DT - */ - case function_string_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_dt*/ - break; - -/**** - *STRING_TO_TOD - */ - case function_string_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_tod*/ - break; - -/**** - *STRING_TO_UDINT - */ - case function_string_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_udint*/ - break; - -/**** - *STRING_TO_WORD - */ - case function_string_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_word*/ - break; - -/**** - *STRING_TO_LWORD - */ - case function_string_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_lword*/ - break; - -/**** - *STRING_TO_UINT - */ - case function_string_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_uint*/ - break; - -/**** - *STRING_TO_LREAL - */ - case function_string_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_lreal*/ - break; - -/**** - *STRING_TO_BYTE - */ - case function_string_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_byte*/ - break; - -/**** - *STRING_TO_USINT - */ - case function_string_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_usint*/ - break; - -/**** - *STRING_TO_ULINT - */ - case function_string_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_ulint*/ - break; - -/**** - *STRING_TO_BOOL - */ - case function_string_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_bool*/ - break; - -/**** - *STRING_TO_TIME - */ - case function_string_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_time*/ - break; - -/**** - *STRING_TO_INT - */ - case function_string_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_string_to_int*/ - break; - -/**** - *LWORD_TO_REAL - */ - case function_lword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_real*/ - break; - -/**** - *LWORD_TO_SINT - */ - case function_lword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_sint*/ - break; - -/**** - *LWORD_TO_LINT - */ - case function_lword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_lint*/ - break; - -/**** - *LWORD_TO_DINT - */ - case function_lword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_dint*/ - break; - -/**** - *LWORD_TO_DATE - */ - case function_lword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_date*/ - break; - -/**** - *LWORD_TO_DWORD - */ - case function_lword_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_dword*/ - break; - -/**** - *LWORD_TO_DT - */ - case function_lword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_dt*/ - break; - -/**** - *LWORD_TO_TOD - */ - case function_lword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_tod*/ - break; - -/**** - *LWORD_TO_UDINT - */ - case function_lword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_udint*/ - break; - -/**** - *LWORD_TO_WORD - */ - case function_lword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_word*/ - break; - -/**** - *LWORD_TO_STRING - */ - case function_lword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_string*/ - break; - -/**** - *LWORD_TO_UINT - */ - case function_lword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_uint*/ - break; - -/**** - *LWORD_TO_LREAL - */ - case function_lword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_lreal*/ - break; - -/**** - *LWORD_TO_BYTE - */ - case function_lword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_byte*/ - break; - -/**** - *LWORD_TO_USINT - */ - case function_lword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_usint*/ - break; - -/**** - *LWORD_TO_ULINT - */ - case function_lword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_ulint*/ - break; - -/**** - *LWORD_TO_BOOL - */ - case function_lword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_bool*/ - break; - -/**** - *LWORD_TO_TIME - */ - case function_lword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_time*/ - break; - -/**** - *LWORD_TO_INT - */ - case function_lword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lword_to_int*/ - break; - -/**** - *UINT_TO_REAL - */ - case function_uint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_real*/ - break; - -/**** - *UINT_TO_SINT - */ - case function_uint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_sint*/ - break; - -/**** - *UINT_TO_LINT - */ - case function_uint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_lint*/ - break; - -/**** - *UINT_TO_DINT - */ - case function_uint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_dint*/ - break; - -/**** - *UINT_TO_DATE - */ - case function_uint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_date*/ - break; - -/**** - *UINT_TO_DWORD - */ - case function_uint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_dword*/ - break; - -/**** - *UINT_TO_DT - */ - case function_uint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_dt*/ - break; - -/**** - *UINT_TO_TOD - */ - case function_uint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_tod*/ - break; - -/**** - *UINT_TO_UDINT - */ - case function_uint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_udint*/ - break; - -/**** - *UINT_TO_WORD - */ - case function_uint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_word*/ - break; - -/**** - *UINT_TO_STRING - */ - case function_uint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_string*/ - break; - -/**** - *UINT_TO_LWORD - */ - case function_uint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_lword*/ - break; - -/**** - *UINT_TO_LREAL - */ - case function_uint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_lreal*/ - break; - -/**** - *UINT_TO_BYTE - */ - case function_uint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_byte*/ - break; - -/**** - *UINT_TO_USINT - */ - case function_uint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_usint*/ - break; - -/**** - *UINT_TO_ULINT - */ - case function_uint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_ulint*/ - break; - -/**** - *UINT_TO_BOOL - */ - case function_uint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_bool*/ - break; - -/**** - *UINT_TO_TIME - */ - case function_uint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_time*/ - break; - -/**** - *UINT_TO_INT - */ - case function_uint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_int*/ - break; - -/**** - *LREAL_TO_REAL - */ - case function_lreal_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_real*/ - break; - -/**** - *LREAL_TO_SINT - */ - case function_lreal_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_sint*/ - break; - -/**** - *LREAL_TO_LINT - */ - case function_lreal_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_lint*/ - break; - -/**** - *LREAL_TO_DINT - */ - case function_lreal_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_dint*/ - break; - -/**** - *LREAL_TO_DATE - */ - case function_lreal_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_date*/ - break; - -/**** - *LREAL_TO_DWORD - */ - case function_lreal_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_dword*/ - break; - -/**** - *LREAL_TO_DT - */ - case function_lreal_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_dt*/ - break; - -/**** - *LREAL_TO_TOD - */ - case function_lreal_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_tod*/ - break; - -/**** - *LREAL_TO_UDINT - */ - case function_lreal_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_udint*/ - break; - -/**** - *LREAL_TO_WORD - */ - case function_lreal_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_word*/ - break; - -/**** - *LREAL_TO_STRING - */ - case function_lreal_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_string*/ - break; - -/**** - *LREAL_TO_LWORD - */ - case function_lreal_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_lword*/ - break; - -/**** - *LREAL_TO_UINT - */ - case function_lreal_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_uint*/ - break; - -/**** - *LREAL_TO_BYTE - */ - case function_lreal_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_byte*/ - break; - -/**** - *LREAL_TO_USINT - */ - case function_lreal_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_usint*/ - break; - -/**** - *LREAL_TO_ULINT - */ - case function_lreal_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_ulint*/ - break; - -/**** - *LREAL_TO_BOOL - */ - case function_lreal_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_bool*/ - break; - -/**** - *LREAL_TO_TIME - */ - case function_lreal_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_time*/ - break; - -/**** - *LREAL_TO_INT - */ - case function_lreal_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_lreal_to_int*/ - break; - -/**** - *BYTE_TO_REAL - */ - case function_byte_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_real*/ - break; - -/**** - *BYTE_TO_SINT - */ - case function_byte_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_sint*/ - break; - -/**** - *BYTE_TO_LINT - */ - case function_byte_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_lint*/ - break; - -/**** - *BYTE_TO_DINT - */ - case function_byte_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_dint*/ - break; - -/**** - *BYTE_TO_DATE - */ - case function_byte_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_date*/ - break; - -/**** - *BYTE_TO_DWORD - */ - case function_byte_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_dword*/ - break; - -/**** - *BYTE_TO_DT - */ - case function_byte_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_dt*/ - break; - -/**** - *BYTE_TO_TOD - */ - case function_byte_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_tod*/ - break; - -/**** - *BYTE_TO_UDINT - */ - case function_byte_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_udint*/ - break; - -/**** - *BYTE_TO_WORD - */ - case function_byte_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_word*/ - break; - -/**** - *BYTE_TO_STRING - */ - case function_byte_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_string*/ - break; - -/**** - *BYTE_TO_LWORD - */ - case function_byte_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_lword*/ - break; - -/**** - *BYTE_TO_UINT - */ - case function_byte_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_uint*/ - break; - -/**** - *BYTE_TO_LREAL - */ - case function_byte_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_lreal*/ - break; - -/**** - *BYTE_TO_USINT - */ - case function_byte_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_usint*/ - break; - -/**** - *BYTE_TO_ULINT - */ - case function_byte_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_ulint*/ - break; - -/**** - *BYTE_TO_BOOL - */ - case function_byte_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_bool*/ - break; - -/**** - *BYTE_TO_TIME - */ - case function_byte_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_time*/ - break; - -/**** - *BYTE_TO_INT - */ - case function_byte_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_byte_to_int*/ - break; - -/**** - *USINT_TO_REAL - */ - case function_usint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_real*/ - break; - -/**** - *USINT_TO_SINT - */ - case function_usint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_sint*/ - break; - -/**** - *USINT_TO_LINT - */ - case function_usint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_lint*/ - break; - -/**** - *USINT_TO_DINT - */ - case function_usint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_dint*/ - break; - -/**** - *USINT_TO_DATE - */ - case function_usint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_date*/ - break; - -/**** - *USINT_TO_DWORD - */ - case function_usint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_dword*/ - break; - -/**** - *USINT_TO_DT - */ - case function_usint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_dt*/ - break; - -/**** - *USINT_TO_TOD - */ - case function_usint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_tod*/ - break; - -/**** - *USINT_TO_UDINT - */ - case function_usint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_udint*/ - break; - -/**** - *USINT_TO_WORD - */ - case function_usint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_word*/ - break; - -/**** - *USINT_TO_STRING - */ - case function_usint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_string*/ - break; - -/**** - *USINT_TO_LWORD - */ - case function_usint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_lword*/ - break; - -/**** - *USINT_TO_UINT - */ - case function_usint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_uint*/ - break; - -/**** - *USINT_TO_LREAL - */ - case function_usint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_lreal*/ - break; - -/**** - *USINT_TO_BYTE - */ - case function_usint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_byte*/ - break; - -/**** - *USINT_TO_ULINT - */ - case function_usint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_ulint*/ - break; - -/**** - *USINT_TO_BOOL - */ - case function_usint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_bool*/ - break; - -/**** - *USINT_TO_TIME - */ - case function_usint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_time*/ - break; - -/**** - *USINT_TO_INT - */ - case function_usint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_int*/ - break; - -/**** - *ULINT_TO_REAL - */ - case function_ulint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_real*/ - break; - -/**** - *ULINT_TO_SINT - */ - case function_ulint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_sint*/ - break; - -/**** - *ULINT_TO_LINT - */ - case function_ulint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_lint*/ - break; - -/**** - *ULINT_TO_DINT - */ - case function_ulint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_dint*/ - break; - -/**** - *ULINT_TO_DATE - */ - case function_ulint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_date*/ - break; - -/**** - *ULINT_TO_DWORD - */ - case function_ulint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_dword*/ - break; - -/**** - *ULINT_TO_DT - */ - case function_ulint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_dt*/ - break; - -/**** - *ULINT_TO_TOD - */ - case function_ulint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_tod*/ - break; - -/**** - *ULINT_TO_UDINT - */ - case function_ulint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_udint*/ - break; - -/**** - *ULINT_TO_WORD - */ - case function_ulint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_word*/ - break; - -/**** - *ULINT_TO_STRING - */ - case function_ulint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_string*/ - break; - -/**** - *ULINT_TO_LWORD - */ - case function_ulint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_lword*/ - break; - -/**** - *ULINT_TO_UINT - */ - case function_ulint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_uint*/ - break; - -/**** - *ULINT_TO_LREAL - */ - case function_ulint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_lreal*/ - break; - -/**** - *ULINT_TO_BYTE - */ - case function_ulint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_byte*/ - break; - -/**** - *ULINT_TO_USINT - */ - case function_ulint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_usint*/ - break; - -/**** - *ULINT_TO_BOOL - */ - case function_ulint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_bool*/ - break; - -/**** - *ULINT_TO_TIME - */ - case function_ulint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_time*/ - break; - -/**** - *ULINT_TO_INT - */ - case function_ulint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_int*/ - break; - -/**** - *BOOL_TO_REAL - */ - case function_bool_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_real*/ - break; - -/**** - *BOOL_TO_SINT - */ - case function_bool_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_sint*/ - break; - -/**** - *BOOL_TO_LINT - */ - case function_bool_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_lint*/ - break; - -/**** - *BOOL_TO_DINT - */ - case function_bool_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_dint*/ - break; - -/**** - *BOOL_TO_DATE - */ - case function_bool_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_date*/ - break; - -/**** - *BOOL_TO_DWORD - */ - case function_bool_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_dword*/ - break; - -/**** - *BOOL_TO_DT - */ - case function_bool_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_dt*/ - break; - -/**** - *BOOL_TO_TOD - */ - case function_bool_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_tod*/ - break; - -/**** - *BOOL_TO_UDINT - */ - case function_bool_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_udint*/ - break; - -/**** - *BOOL_TO_WORD - */ - case function_bool_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_word*/ - break; - -/**** - *BOOL_TO_STRING - */ - case function_bool_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_string*/ - break; - -/**** - *BOOL_TO_LWORD - */ - case function_bool_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_lword*/ - break; - -/**** - *BOOL_TO_UINT - */ - case function_bool_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_uint*/ - break; - -/**** - *BOOL_TO_LREAL - */ - case function_bool_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_lreal*/ - break; - -/**** - *BOOL_TO_BYTE - */ - case function_bool_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_byte*/ - break; - -/**** - *BOOL_TO_USINT - */ - case function_bool_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_usint*/ - break; - -/**** - *BOOL_TO_ULINT - */ - case function_bool_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_ulint*/ - break; - -/**** - *BOOL_TO_TIME - */ - case function_bool_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_time*/ - break; - -/**** - *BOOL_TO_INT - */ - case function_bool_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bool_to_int*/ - break; - -/**** - *TIME_TO_REAL - */ - case function_time_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_real*/ - break; - -/**** - *TIME_TO_SINT - */ - case function_time_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_sint*/ - break; - -/**** - *TIME_TO_LINT - */ - case function_time_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_lint*/ - break; - -/**** - *TIME_TO_DINT - */ - case function_time_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_dint*/ - break; - -/**** - *TIME_TO_DWORD - */ - case function_time_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_dword*/ - break; - -/**** - *TIME_TO_UDINT - */ - case function_time_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_udint*/ - break; - -/**** - *TIME_TO_WORD - */ - case function_time_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_word*/ - break; - -/**** - *TIME_TO_STRING - */ - case function_time_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_string*/ - break; - -/**** - *TIME_TO_LWORD - */ - case function_time_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_lword*/ - break; - -/**** - *TIME_TO_UINT - */ - case function_time_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_uint*/ - break; - -/**** - *TIME_TO_LREAL - */ - case function_time_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_lreal*/ - break; - -/**** - *TIME_TO_BYTE - */ - case function_time_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_byte*/ - break; - -/**** - *TIME_TO_USINT - */ - case function_time_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_usint*/ - break; - -/**** - *TIME_TO_ULINT - */ - case function_time_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_ulint*/ - break; - -/**** - *TIME_TO_INT - */ - case function_time_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_time_to_int*/ - break; - -/**** - *INT_TO_REAL - */ - case function_int_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_real*/ - break; - -/**** - *INT_TO_SINT - */ - case function_int_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_sint*/ - break; - -/**** - *INT_TO_LINT - */ - case function_int_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_lint*/ - break; - -/**** - *INT_TO_DINT - */ - case function_int_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_dint*/ - break; - -/**** - *INT_TO_DATE - */ - case function_int_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_date*/ - break; - -/**** - *INT_TO_DWORD - */ - case function_int_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_dword*/ - break; - -/**** - *INT_TO_DT - */ - case function_int_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_dt*/ - break; - -/**** - *INT_TO_TOD - */ - case function_int_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_tod*/ - break; - -/**** - *INT_TO_UDINT - */ - case function_int_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_udint*/ - break; - -/**** - *INT_TO_WORD - */ - case function_int_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_word*/ - break; - -/**** - *INT_TO_STRING - */ - case function_int_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_string*/ - break; - -/**** - *INT_TO_LWORD - */ - case function_int_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_lword*/ - break; - -/**** - *INT_TO_UINT - */ - case function_int_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_uint*/ - break; - -/**** - *INT_TO_LREAL - */ - case function_int_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_lreal*/ - break; - -/**** - *INT_TO_BYTE - */ - case function_int_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_byte*/ - break; - -/**** - *INT_TO_USINT - */ - case function_int_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_usint*/ - break; - -/**** - *INT_TO_ULINT - */ - case function_int_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_ulint*/ - break; - -/**** - *INT_TO_BOOL - */ - case function_int_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_bool*/ - break; - -/**** - *INT_TO_TIME - */ - case function_int_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_int_to_time*/ - break; - -/**** - *TRUNC - */ - case function_trunc : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_trunc*/ - break; - -/**** - *BCD_TO_UDINT - */ - case function_bcd_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_udint*/ - break; - -/**** - *BCD_TO_UINT - */ - case function_bcd_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_uint*/ - break; - -/**** - *BCD_TO_ULINT - */ - case function_bcd_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_ulint*/ - break; - -/**** - *BCD_TO_USINT - */ - case function_bcd_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_bcd_to_usint*/ - break; - -/**** - *UDINT_TO_BCD - */ - case function_udint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_udint_to_bcd*/ - break; - -/**** - *UINT_TO_BCD - */ - case function_uint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_uint_to_bcd*/ - break; - -/**** - *USINT_TO_BCD - */ - case function_usint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_usint_to_bcd*/ - break; - -/**** - *ULINT_TO_BCD - */ - case function_ulint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::integer; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ulint_to_bcd*/ - break; - -/**** - *DATE_AND_TIME_TO_TIME_OF_DAY - */ - case function_date_and_time_to_time_of_day : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_and_time_to_time_of_day*/ - break; - -/**** - *DATE_AND_TIME_TO_DATE - */ - case function_date_and_time_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_date_and_time_to_date*/ - break; - -/**** - *ABS - */ - case function_abs : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_abs*/ - break; - -/**** - *SQRT - */ - case function_sqrt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sqrt*/ - break; - -/**** - *LN - */ - case function_ln : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_ln*/ - break; - -/**** - *LOG - */ - case function_log : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_log*/ - break; - -/**** - *EXP - */ - case function_exp : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_exp*/ - break; - -/**** - *SIN - */ - case function_sin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_sin*/ - break; - -/**** - *COS - */ - case function_cos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_cos*/ - break; - -/**** - *TAN - */ - case function_tan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_tan*/ - break; - -/**** - *ASIN - */ - case function_asin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_asin*/ - break; - -/**** - *ACOS - */ - case function_acos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_acos*/ - break; - -/**** - *ATAN - */ - case function_atan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_atan*/ - break; - -/**** - *ADD - */ - case function_add : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add*/ - break; - -/**** - *MUL - */ - case function_mul : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mul*/ - break; - -/**** - *SUB - */ - case function_sub : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub*/ - break; - -/**** - *DIV - */ - case function_div : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_div*/ - break; - -/**** - *MOD - */ - case function_mod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mod*/ - break; - -/**** - *EXPT - */ - case function_expt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = IN1_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_expt*/ - break; - -/**** - *MOVE - */ - case function_move : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_move*/ - break; - -/**** - *ADD_TIME - */ - case function_add_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_time*/ - break; - -/**** - *ADD_TOD_TIME - */ - case function_add_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_tod_time*/ - break; - -/**** - *ADD_DT_TIME - */ - case function_add_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_dt_time*/ - break; - -/**** - *MULTIME - */ - case function_multime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_multime*/ - break; - -/**** - *SUB_TIME - */ - case function_sub_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_time*/ - break; - -/**** - *SUB_DATE_DATE - */ - case function_sub_date_date : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_date_date*/ - break; - -/**** - *SUB_TOD_TIME - */ - case function_sub_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_time*/ - break; - -/**** - *SUB_TOD_TOD - */ - case function_sub_tod_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_tod*/ - break; - -/**** - *SUB_DT_TIME - */ - case function_sub_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_dt_time*/ - break; - -/**** - *DIVTIME - */ - case function_divtime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_divtime*/ - break; - -/**** - *SHL - */ - case function_shl : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shl*/ - break; - -/**** - *SHR - */ - case function_shr : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shr*/ - break; - -/**** - *ROR - */ - case function_ror : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ror*/ - break; - -/**** - *ROL - */ - case function_rol : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_rol*/ - break; - -/**** - *AND - */ - case function_and : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_and*/ - break; - -/**** - *OR - */ - case function_or : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_or*/ - break; - -/**** - *XOR - */ - case function_xor : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_xor*/ - break; - -/**** - *NOT - */ - case function_not : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_not*/ - break; - -/**** - *SEL - */ - case function_sel : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *G_type_symbol = param_data_type; - last_type_symbol = G_type_symbol; - - if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sel*/ - break; - -/**** - *MAX - */ - case function_max : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_max*/ - break; - -/**** - *MIN - */ - case function_min : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_min*/ - break; - -/**** - *LIMIT - */ - case function_limit : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *MN_type_symbol = param_data_type; - last_type_symbol = MN_type_symbol; - - - { - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - - { - - { - symbol_c *MX_param_name = (symbol_c *)(new identifier_c("MX")); - /* Get the value from a foo( = ) style call */ - symbol_c *MX_param_value = function_call_param_iterator.search_f(MX_param_name); - symbol_c *MX_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (MX_param_value == NULL) - MX_param_value = function_call_param_iterator.next_nf(); - if (MX_param_value != NULL) { - MX_type_symbol = search_expression_type->get_type(MX_param_value); - last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = IN_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_limit*/ - break; - -/**** - *MUX - */ - case function_mux : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *K_type_symbol = param_data_type; - last_type_symbol = K_type_symbol; - - if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = last_type_symbol; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mux*/ - break; - -/**** - *GT - */ - case function_gt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_gt*/ - break; - -/**** - *GE - */ - case function_ge : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ge*/ - break; - -/**** - *EQ - */ - case function_eq : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_eq*/ - break; - -/**** - *LT - */ - case function_lt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_lt*/ - break; - -/**** - *LE - */ - case function_le : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_le*/ - break; - -/**** - *NE - */ - case function_ne : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ne*/ - break; - -/**** - *LEN - */ - case function_len : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - }/*function_len*/ - break; - -/**** - *LEFT - */ - case function_left : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_left*/ - break; - -/**** - *RIGHT - */ - case function_right : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_right*/ - break; - -/**** - *MID - */ - case function_mid : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mid*/ - break; - -/**** - *CONCAT - */ - case function_concat : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat*/ - break; - -/**** - *CONCAT_DAT_TOD - */ - case function_concat_dat_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat_dat_tod*/ - break; - -/**** - *INSERT - */ - case function_insert : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_insert*/ - break; - -/**** - *DELETE - */ - case function_delete : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_delete*/ - break; - -/**** - *REPLACE - */ - case function_replace : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_replace*/ - break; - -/**** - *FIND - */ - case function_find : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - return return_type_symbol; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_find*/ - break; - - case function_none : - ERROR; - } - return NULL; -} diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/search_varfb_instance_type.cc --- a/absyntax_utils/search_varfb_instance_type.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/search_varfb_instance_type.cc Thu Sep 08 20:25:00 2011 +0200 @@ -94,12 +94,14 @@ search_varfb_instance_type_c::search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) { this->decompose_var_instance_name = NULL; this->current_structelement_name = NULL; - this->current_rawtype = NULL; -} - -symbol_c *search_varfb_instance_type_c::get_basetype_decl(symbol_c *variable_name) { + this->current_typeid = NULL; + this->current_basetypeid = NULL; +} + +symbol_c *search_varfb_instance_type_c::get_type_decl(symbol_c *variable_name) { this->current_structelement_name = NULL; - this->current_rawtype = NULL; + this->current_typeid = NULL; + this->current_basetypeid = NULL; this->decompose_var_instance_name = new decompose_var_instance_name_c(variable_name); if (NULL == decompose_var_instance_name) ERROR; @@ -112,10 +114,7 @@ /* Now we try to find the variable instance declaration, to determine its type... */ symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part); - if (NULL == var_decl) { - /* variable instance declaration not found! */ - ERROR; - } + if (NULL == var_decl) ERROR; /* if it is a struct or function block, we must search the type * of the struct or function block member. @@ -124,18 +123,38 @@ * decompose_var_instance_name->get_next() when and if required... */ symbol_c *res = (symbol_c *)var_decl->accept(*this); - if (NULL == res) ERROR; + /* NOTE: A Null result is not really an internal compiler error, but rather an error in + * the IEC 61131-3 source code being compiled. This means we cannot just abort the compiler with ERROR. + * // if (NULL == res) ERROR; + */ + if (NULL == res) return NULL; /* make sure that we have decomposed all structure elements of the variable name */ symbol_c *var_name = decompose_var_instance_name->next_part(); - if (NULL != var_name) ERROR; + /* NOTE: A non-NULL result is not really an internal compiler error, but rather an error in + * the IEC 61131-3 source code being compiled. + * (for example, 'int_var.struct_elem' in the source code, when 'int_var' is a simple integer, + * and not a structure, will result in this result being non-NULL!) + * This means we cannot just abort the compiler with ERROR. + * // if (NULL != var_name) ERROR; + */ + if (NULL != var_name) return NULL; return res; } + +symbol_c *search_varfb_instance_type_c::get_basetype_decl(symbol_c *variable_name) { + symbol_c *res = get_type_decl(variable_name); + if (NULL == res) return NULL; + return (symbol_c *)base_type(res); +} + + unsigned int search_varfb_instance_type_c::get_vartype(symbol_c *variable_name) { this->current_structelement_name = NULL; - this->current_rawtype = NULL; + this->current_typeid = NULL; + this->current_basetypeid = NULL; this->is_complex = false; this->decompose_var_instance_name = new decompose_var_instance_name_c(variable_name); if (NULL == decompose_var_instance_name) ERROR; @@ -171,12 +190,12 @@ } symbol_c *search_varfb_instance_type_c::get_type_id(symbol_c *variable_name) { - this->current_rawtype = NULL; - symbol_c *rawtype = this->get_basetype_decl(variable_name); - if (this->current_rawtype != NULL) - return this->current_rawtype; + this->current_typeid = NULL; + symbol_c *vartype = this->get_type_decl(variable_name); + if (this->current_typeid != NULL) + return this->current_typeid; else - return rawtype; + return vartype; } bool search_varfb_instance_type_c::type_is_complex(void) { @@ -208,23 +227,40 @@ * of a function block type... */ void *search_varfb_instance_type_c::visit(identifier_c *type_name) { + /* we only store the new type id if none had been found yet. + * Since we will recursively carry on looking at the base type + * to determine the base type declaration and id, we must only set this variable + * the first time. + * e.g. TYPE myint1_t : int := 1; + * myint2_t : int1_t := 2; + * myint3_t : int2_t := 3; + * END_TYPE; + * VAR + * myint1 : myint1_t; + * myint2 : myint2_t; + * myint3 : myint3_t; + * END_VAR + * + * If we ask for typeid of myint3, it must return myint3_t + * If we ask for basetypeid of myint3, it must return int + * + * When determining the data type of myint3, we will recursively go all the way + * down to int, but we must still only store myint3_t as the base type id. + */ + if (NULL == this->current_typeid) + this->current_typeid = type_name; + this->current_basetypeid = type_name; + /* look up the type declaration... */ symbol_c *fb_decl = function_block_type_symtable.find_value(type_name); if (fb_decl != function_block_type_symtable.end_value()) /* Type declaration found!! */ return fb_decl->accept(*this); - this->current_rawtype = type_name; - /* No. It is not a function block, so we let * the base class take care of it... */ - if (NULL == decompose_var_instance_name->next_part(false)) { - return base_type(type_name); - } - else { - return search_base_type_c::visit(type_name); - } + return search_base_type_c::visit(type_name); } /********************************/ @@ -251,8 +287,13 @@ } /* structure_type_name ':' structure_specification */ +/* NOTE: this is only used inside a TYPE ... END_TYPE declaration. + * It is never used directly when declaring a new variable! + */ void *search_varfb_instance_type_c::visit(structure_type_declaration_c *symbol) { this->is_complex = true; + + if (NULL == current_structelement_name) ERROR; return symbol->structure_specification->accept(*this); /* NOTE: structure_specification will point to either a * initialized_structure_c @@ -264,52 +305,12 @@ /* structure_type_name ASSIGN structure_initialization */ /* structure_initialization may be NULL ! */ // SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization) +/* NOTE: only the initialized structure is ever used when declaring a new variable instance */ void *search_varfb_instance_type_c::visit(initialized_structure_c *symbol) { this->is_complex = true; - /* recursively find out the data type of var_name... */ - return symbol->structure_type_name->accept(*this); -} - -/* helper symbol for structure_declaration */ -/* structure_declaration: STRUCT structure_element_declaration_list END_STRUCT */ -/* structure_element_declaration_list structure_element_declaration ';' */ -void *search_varfb_instance_type_c::visit(structure_element_declaration_list_c *symbol) { - /* make sure that we have decomposed all structure elements of the variable name */ - current_structelement_name = decompose_var_instance_name->next_part(); - /* now search the structure declaration */ - return visit_list(symbol); -} - -/* structure_element_name ':' spec_init */ -void *search_varfb_instance_type_c::visit(structure_element_declaration_c *symbol) { - if (NULL == current_structelement_name) ERROR; - - if (compare_identifiers(symbol->structure_element_name, current_structelement_name) == 0) - return symbol->spec_init->accept(*this); - - return NULL; -} - -/* helper symbol for structure_initialization */ -/* structure_initialization: '(' structure_element_initialization_list ')' */ -/* structure_element_initialization_list ',' structure_element_initialization */ -void *search_varfb_instance_type_c::visit(structure_element_initialization_list_c *symbol) {ERROR; return NULL;} /* should never get called... */ -/* structure_element_name ASSIGN value */ -void *search_varfb_instance_type_c::visit(structure_element_initialization_c *symbol) {ERROR; return NULL;} /* should never get called... */ - - - -/**************************************/ -/* B.1.5 - Program organization units */ -/**************************************/ -/*****************************/ -/* B 1.5.2 - Function Blocks */ -/*****************************/ -/* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ -// SYM_REF4(function_block_declaration_c, fblock_name, var_declarations, fblock_body, unused) -void *search_varfb_instance_type_c::visit(function_block_declaration_c *symbol) { + if (NULL != current_structelement_name) ERROR; + /* make sure that we have decomposed all strcuture elements of the variable name */ - symbol_c *var_name = decompose_var_instance_name->next_part(); if (NULL == var_name) { /* this is it... ! @@ -322,6 +323,68 @@ return (void *)symbol; } + /* look for the var_name in the structure declaration */ + current_structelement_name = var_name; + + /* recursively find out the data type of current_structelement_name... */ + return symbol->structure_type_name->accept(*this); +} + +/* helper symbol for structure_declaration */ +/* structure_declaration: STRUCT structure_element_declaration_list END_STRUCT */ +/* structure_element_declaration_list structure_element_declaration ';' */ +void *search_varfb_instance_type_c::visit(structure_element_declaration_list_c *symbol) { + if (NULL == current_structelement_name) ERROR; + /* now search the structure declaration */ + return visit_list(symbol); +} + +/* structure_element_name ':' spec_init */ +void *search_varfb_instance_type_c::visit(structure_element_declaration_c *symbol) { + if (NULL == current_structelement_name) ERROR; + + if (compare_identifiers(symbol->structure_element_name, current_structelement_name) == 0) { + current_structelement_name = NULL; + /* found the type of the element we were looking for! */ + return symbol->spec_init->accept(*this); + } + + /* Did not find the type of the element we were looking for! */ + /* Will keep looking... */ + return NULL; +} + +/* helper symbol for structure_initialization */ +/* structure_initialization: '(' structure_element_initialization_list ')' */ +/* structure_element_initialization_list ',' structure_element_initialization */ +void *search_varfb_instance_type_c::visit(structure_element_initialization_list_c *symbol) {ERROR; return NULL;} /* should never get called... */ +/* structure_element_name ASSIGN value */ +void *search_varfb_instance_type_c::visit(structure_element_initialization_c *symbol) {ERROR; return NULL;} /* should never get called... */ + + + +/**************************************/ +/* B.1.5 - Program organization units */ +/**************************************/ +/*****************************/ +/* B 1.5.2 - Function Blocks */ +/*****************************/ +/* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ +// SYM_REF4(function_block_declaration_c, fblock_name, var_declarations, fblock_body, unused) +void *search_varfb_instance_type_c::visit(function_block_declaration_c *symbol) { + /* make sure that we have decomposed all strcuture elements of the variable name */ + symbol_c *var_name = decompose_var_instance_name->next_part(); + if (NULL == var_name) { + /* this is it... ! + * No need to look any further... + * Note also that, unlike for the struct types, a function block may + * not be defined based on another (i.e. no inheritance is allowed), + * so this function block is already the most base type. + * We simply return it. + */ + return (void *)symbol; + } + /* now search the function block declaration for the variable... */ search_var_instance_decl_c search_decl(symbol); symbol_c *var_decl = search_decl.get_decl(var_name); @@ -329,7 +392,7 @@ /* variable instance declaration not found! */ return NULL; } - +#if 0 /* We have found the declaration. * Should we look any further? */ @@ -342,4 +405,7 @@ current_structelement_name = var_name; /* recursively find out the data type of var_name... */ return symbol->var_declarations->accept(*this); -} +#endif + /* carry on recursively, in case the variable has more elements to be decomposed... */ + return var_decl->accept(*this); +} diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/search_varfb_instance_type.hh --- a/absyntax_utils/search_varfb_instance_type.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/search_varfb_instance_type.hh Thu Sep 08 20:25:00 2011 +0200 @@ -91,14 +91,28 @@ search_var_instance_decl_c search_var_instance_decl; decompose_var_instance_name_c *decompose_var_instance_name; symbol_c *current_structelement_name; - symbol_c *current_rawtype; + symbol_c *current_typeid; + symbol_c *current_basetypeid; bool is_complex; public: search_varfb_instance_type_c(symbol_c *search_scope); symbol_c *get_basetype_decl(symbol_c *variable_name); + symbol_c *get_type_decl(symbol_c *variable_name); symbol_c *get_type_id(symbol_c *variable_name); + /* NOTE: this function should be remvoed/deleted. + * However, it is currently used in stage 4, and before deleting it + * requires that the stage4 code be analysed and fixed (i.e. replace by + * a call to one of the above functions get_basetype_decl(), + * get_type_decl(), get_type_id(). + * + * At the moment, I have a feeling that this whole class search_varfb_instance_type_c + * will not be needed in the future (i.e. when we finish implementing type checking + * in stage 3 correctly, where we store on each symbol in the abstract syntax + * tree it's data type, so stage4 implementations will not need to deduce the data + * types again), so it does not make much sense to spend more time on it. + */ unsigned int get_vartype(symbol_c *variable_name); bool type_is_complex(void); diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/spec_init_separator.cc --- a/absyntax_utils/spec_init_separator.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/spec_init_separator.cc Thu Sep 08 20:25:00 2011 +0200 @@ -176,5 +176,35 @@ return NULL; } + +/* STRING '[' integer ']' + * STRING ASSIGN single_byte_character_string + * STRING '[' integer ']' ASSIGN single_byte_character_string + */ +void *spec_init_sperator_c::visit(single_byte_string_spec_c *symbol) { + TRACE("spec_init_sperator_c::single_byte_string_spec_c"); + switch (search_what) { + case search_spec: return symbol->string_spec; + case search_init: return symbol->single_byte_character_string; + } + ERROR; /* should never occur */ + return NULL; +} + +/* WSTRING '[' integer ']' + * WSTRING ASSIGN double_byte_character_string + * WSTRING '[' integer ']' ASSIGN double_byte_character_string + */ +void *spec_init_sperator_c::visit(double_byte_string_spec_c *symbol) { + TRACE("spec_init_sperator_c::double_byte_string_spec_c"); + switch (search_what) { + case search_spec: return symbol->string_spec; + case search_init: return symbol->double_byte_character_string; + } + ERROR; /* should never occur */ + return NULL; +} + + spec_init_sperator_c *spec_init_sperator_c ::class_instance = NULL; spec_init_sperator_c::search_what_t spec_init_sperator_c::search_what; diff -r b826f13c260e -r 7a11f9e9e703 absyntax_utils/spec_init_separator.hh --- a/absyntax_utils/spec_init_separator.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/absyntax_utils/spec_init_separator.hh Thu Sep 08 20:25:00 2011 +0200 @@ -101,4 +101,17 @@ /* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */ /* structure_initialization -> may be NULL ! */ void *visit(fb_name_decl_c *symbol); + + /* STRING '[' integer ']' + * STRING ASSIGN single_byte_character_string + * STRING '[' integer ']' ASSIGN single_byte_character_string + */ + void *visit(single_byte_string_spec_c *symbol); + + /* WSTRING '[' integer ']' + * WSTRING ASSIGN double_byte_character_string + * WSTRING '[' integer ']' ASSIGN double_byte_character_string + */ + void *visit(double_byte_string_spec_c *symbol); + }; /* class spec_init_sperator_c */ diff -r b826f13c260e -r 7a11f9e9e703 aclocal.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aclocal.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,951 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 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. + +# 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 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. + +# 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.1], [], + [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.1])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 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. + +# 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 +# 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 10 + +# 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'. + 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 + ;; + 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='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])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 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. + +# 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 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. + +# 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 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_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 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. + +# 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 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_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 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. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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 /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 + diff -r b826f13c260e -r 7a11f9e9e703 common.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common.mk Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,3 @@ +AM_CXXFLAGS = -g -Wall -Wpointer-arith -Wwrite-strings -Wno-unused + + diff -r b826f13c260e -r 7a11f9e9e703 config/INSTALL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/INSTALL Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff -r b826f13c260e -r 7a11f9e9e703 config/aclocal.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/aclocal.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,8917 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 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. + +# 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.65],, +[m4_warning([this file was generated for autoconf 2.65. +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'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# 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. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# 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 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 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. + +# 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.1], [], + [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.1])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 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. + +# 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 +# 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 10 + +# 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'. + 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 + ;; + 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='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])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 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. + +# 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 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. + +# 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 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_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 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. + +# 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 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_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 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. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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 /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 + diff -r b826f13c260e -r 7a11f9e9e703 config/config.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/config.h.in Thu Sep 08 20:25:00 2011 +0200 @@ -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 header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the 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 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 header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the 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 header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the 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 header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIMEB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the 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 and . */ +#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 , + , or 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 , + , or 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 , + , or 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 diff -r b826f13c260e -r 7a11f9e9e703 config/depcomp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/depcomp Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# 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 2, 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -r b826f13c260e -r 7a11f9e9e703 config/install-sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/install-sh Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -r b826f13c260e -r 7a11f9e9e703 config/libtool.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/libtool.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,7377 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) diff -r b826f13c260e -r 7a11f9e9e703 config/ltmain.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/ltmain.sh Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,8413 @@ +# Generated from ltmain.m4sh. + +# ltmain.sh (GNU libtool) 2.2.6b +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" +TIMESTAMP="" +package_revision=1.3017 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs 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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done + +$lt_unset CDPATH + + + + + +: ${CP="cp -f"} +: ${ECHO="echo"} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# Generated shell functions inserted here. + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: +func_dirname_and_basename "$progpath" +progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + done + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "X$my_tmpdir" | $Xsed +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "X$1" | $Xsed \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + + + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/# -h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + $ECHO + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help +# Echo long help message to standard output and exit. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + exit $? +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case "$@ " in + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { +test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + $ECHO + $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? +} + + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + $ECHO "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $ECHO + $ECHO "If you ever happen to want to link against installed libraries" + $ECHO "in a given directory, LIBDIR, you must either use libtool, and" + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" + $ECHO "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" + $ECHO " during execution" + fi + if test -n "$runpath_var"; then + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" + $ECHO " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" + $ECHO "pages." + ;; + *) + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + $ECHO "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + $ECHO >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + $ECHO >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + + +# func_emit_wrapper_part1 [arg=no] +# +# Emit the first part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part1 () +{ + func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part1_arg1=$1 + fi + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs 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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $ECHO "\ + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done +" +} +# end: func_emit_wrapper_part1 + +# func_emit_wrapper_part2 [arg=no] +# +# Emit the second part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part2 () +{ + func_emit_wrapper_part2_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part2_arg1=$1 + fi + + $ECHO "\ + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} +# end: func_emit_wrapper_part2 + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + # split this up so that func_emit_cwrapperexe_src + # can call each part independently. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_path_tmp1=`( cmd //c echo "$1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_tmp1=`cygpath -w "$1"` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result="" + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_to_host_pathlist_tmp2="$1" + # Once set for this call, this variable should not be + # reassigned. It is used in tha fallback case. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e 's|^:*||' -e 's|:*$||'` + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" + fi + fi + fi + IFS=: + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result" ; then + func_error "Could not determine the host path(s) corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +# define setmode _setmode +#else +# include +# include +# ifdef __CYGWIN__ +# include +# define HAVE_SETENV +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} +#else +# define LTWRAPPER_DEBUGPRINTF(args) +#endif + +const char *program_name = NULL; + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_fatal (const char *message, ...); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_opt_process_env_set (const char *arg); +void lt_opt_process_env_prepend (const char *arg); +void lt_opt_process_env_append (const char *arg); +int lt_split_name_value (const char *arg, char** name, char** value); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); + +static const char *script_text_part1 = +EOF + + func_emit_wrapper_part1 yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + cat <"))); + for (i = 0; i < newargc; i++) + { + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void *p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), + string) : NULL; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal ("Could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} + +void +lt_setenv (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +int +lt_split_name_value (const char *arg, char** name, char** value) +{ + const char *p; + int len; + if (!arg || !*arg) + return 1; + + p = strchr (arg, (int)'='); + + if (!p) + return 1; + + *value = xstrdup (++p); + + len = strlen (arg) - strlen (*value); + *name = XMALLOC (char, len); + strncpy (*name, arg, len-1); + (*name)[len - 1] = '\0'; + + return 0; +} + +void +lt_opt_process_env_set (const char *arg) +{ + char *name = NULL; + char *value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); + } + + lt_setenv (name, value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_prepend (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_append (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 1); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + + +EOF +} +# end: func_emit_cwrapperexe_src + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $ECHO + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because the file extensions .$libext of this argument makes me believe" + $ECHO "*** that it is just a static archive that I should not use here." + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + $ECHO + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $ECHO + $ECHO "*** And there doesn't seem to be a static archive available" + $ECHO "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $ECHO + $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $ECHO "*** But as you try to build a module library, libtool will still create " + $ECHO "*** a static module, that should work as long as the dlopening application" + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + done + fi + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO + if test "X$deplibs_check_method" = "Xnone"; then + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + else + $ECHO "*** Warning: inter-library dependencies are not known to be supported." + fi + $ECHO "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $ECHO + $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + $ECHO "*** a static module, that should work as long as the dlopening" + $ECHO "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $ECHO "*** The inter-library dependencies that have been dropped here will be" + $ECHO "*** automatically added whenever a program is linked with this library" + $ECHO "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $ECHO + $ECHO "*** Since this library must not contain undefined symbols," + $ECHO "*** because either the platform does not support them or" + $ECHO "*** it was explicitly requested with -no-undefined," + $ECHO "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + $ECHO 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + $ECHO ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *cegcc) + # Disable wrappers for cegcc, we are cross compiling anyway. + wrappers_required=no + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $ECHO "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff -r b826f13c260e -r 7a11f9e9e703 config/ltoptions.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/ltoptions.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,368 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff -r b826f13c260e -r 7a11f9e9e703 config/ltsugar.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/ltsugar.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff -r b826f13c260e -r 7a11f9e9e703 config/ltversion.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/ltversion.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# 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. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff -r b826f13c260e -r 7a11f9e9e703 config/lt~obsolete.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/lt~obsolete.m4 Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# 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 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff -r b826f13c260e -r 7a11f9e9e703 config/missing --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/missing Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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 2, 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -r b826f13c260e -r 7a11f9e9e703 config/ylwrap --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/ylwrap Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,223 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# Written by Tom Tromey . +# +# 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 2, 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case "$1" in + '') + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 + ;; + --basedir) + basedir=$2 + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + +Wrapper for lex/yacc invocations, renaming files as desired. + + INPUT is the input file + OUTPUT is one file PROG generates + DESIRED is the file we actually want instead of OUTPUT + PROGRAM is program to run + ARGS are passed to PROG + +Any number of OUTPUT,DESIRED pairs may be used. + +Report bugs to . +EOF + exit $? + ;; + -v|--v*) + echo "ylwrap $scriptversion" + exit $? + ;; +esac + + +# The input. +input="$1" +shift +case "$input" in + [\\/]* | ?:[\\/]*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. + input="`pwd`/$input" + ;; +esac + +pairlist= +while test "$#" -ne 0; do + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift +done + +# The program to run. +prog="$1" +shift +# Make any relative path in $prog absolute. +case "$prog" in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; +esac + +# FIXME: add hostname here for parallel makes that run commands on +# other machines. But that might take us over the 14-char limit. +dirname=ylwrap$$ +trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 +mkdir $dirname || exit 1 + +cd $dirname + +case $# in + 0) $prog "$input" ;; + *) $prog "$@" "$input" ;; +esac +ret=$? + +if test $ret -eq 0; then + set X $pairlist + shift + first=yes + # Since DOS filename conventions don't allow two dots, + # the DOS version of Bison writes out y_tab.c instead of y.tab.c + # and y_tab.h instead of y.tab.h. Test to see if this is the case. + y_tab_nodot="no" + if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot="yes" + fi + + # The directory holding the input. + input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` + # Quote $INPUT_DIR so we can use it in a regexp. + # FIXME: really we should care about more than `.' and `\'. + input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` + + while test "$#" -ne 0; do + from="$1" + # Handle y_tab.c and y_tab.h output by DOS + if test $y_tab_nodot = "yes"; then + if test $from = "y.tab.c"; then + from="y_tab.c" + else + if test $from = "y.tab.h"; then + from="y_tab.h" + fi + fi + fi + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; + esac + + # We do not want to overwrite a header file if it hasn't + # changed. This avoid useless recompilations. However the + # parser itself (the first file) should always be updated, + # because it is the destination of the .y.c rule in the + # Makefile. Divert the output of all other files to a temporary + # file so we can compare them to existing versions. + if test $first = no; then + realtarget="$target" + target="tmp-`echo $target | sed s/.*[\\/]//g`" + fi + # Edit out `#line' or `#' directives. + # + # We don't want the resulting debug information to point at + # an absolute srcdir; it is better for it to just mention the + # .y file with no path. + # + # We want to use the real output file name, not yy.lex.c for + # instance. + # + # We want the include guards to be adjusted too. + FROM=`echo "$from" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + TARGET=`echo "$2" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + + sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ + -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? + + # Check whether header files must be updated. + if test $first = no; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else + echo updating "$2" + mv -f "$target" "$realtarget" + fi + fi + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + ret=1 + fi + fi + shift + shift + first=no + done +else + ret=$? +fi + +# Remove the directory. +cd .. +rm -rf $dirname + +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -r b826f13c260e -r 7a11f9e9e703 configure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,7154 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for matiec 0.1. +# +# Report bugs to . +# +# +# 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 &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 +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#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 +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 if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + 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 . +_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 declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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='\' +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 +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 +#include +#include +#include +/* 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'. + 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 + ;; + 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'. + 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 + ;; + 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 + + +# 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 to if __STDC__ is defined, since + # 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 +#else +# include +#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 +_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 to if __STDC__ is defined, since + # 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 +#else +# include +#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 +_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 +#include +#include +#include + +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 + +_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 + +_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 +#include +#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 +#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 +#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 +#include +#include + +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 +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#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 +#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 ." + +_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` +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 +' >$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 +' >$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 + + + diff -r b826f13c260e -r 7a11f9e9e703 configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure.ac Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,62 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.61]) +AC_INIT([matiec], [0.1], [msousa@fe.up.pt, beremiz-devel@lists.sourceforge.net]) +AC_CONFIG_HEADERS([config/config.h]) +AC_CONFIG_AUX_DIR(config) + +AM_INIT_AUTOMAKE([foreign]) + +# 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. +AC_PROG_YACC +AC_PROG_LEX +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +# Checks for header files. +AC_CHECK_HEADERS([float.h limits.h stdint.h stdlib.h string.h strings.h sys/timeb.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_INLINE +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MKTIME +AC_FUNC_REALLOC +AC_CHECK_FUNCS([clock_gettime memset pow strcasecmp strdup strtoul strtoull]) + +AC_CONFIG_MACRO_DIR([config]) + +AC_CONFIG_FILES([Makefile \ + absyntax/Makefile \ + absyntax_utils/Makefile \ + stage1_2/Makefile \ + stage3/Makefile \ + stage4/Makefile \ + stage4/generate_c/Makefile \ + stage4/generate_iec/Makefile]) +AC_OUTPUT + + diff -r b826f13c260e -r 7a11f9e9e703 lib/create_standard_function_txt.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/create_standard_function_txt.sh Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,907 @@ +#!/bin/sh +# +# copyright 2011 Mario de Sousa (msousa@fe.up.pt) +# +# Offered to the public under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either version 2 +# 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 Lesser +# General Public License for more details. +# +# This code is made available on the understanding that it will not be +# used in safety-critical situations without a full and competent review. +# + +echo "(************************************************)" +echo "(************************************************)" +echo "(*** ***)" +echo "(*** The IEC 61131-3 standard functions ***)" +echo "(*** ***)" +echo "(*** Auto-generated file. Do not edit! ***)" +echo "(*** ***)" +echo "(************************************************)" +echo "(************************************************)" + + +echo "{disable code generation}" + +# Lets parse this file with the C pre-processor! +#cpp <<"END" | sed "s/ FUNCTION/\nFUNCTION/g" | grep -v '#' +# We usee gcc -E instead, as it seems cpp on OSX works differently! However, it needs an input file parameter... +#gcc -E <<"END" | sed "s/ FUNCTION/\nFUNCTION/g" | grep -v '#' +cpp <<"END" | sed "s/ FUNCTION/\nFUNCTION/g" | grep -v '#' + +#define __DEFINE_CLASHING_FUNCTIONS + +/* Macro that expand to subtypes */ +#define __ANY(DO) __ANY_DERIVED(DO) __ANY_ELEMENTARY(DO) +#define __ANY_DERIVED(DO) +#define __ANY_ELEMENTARY(DO) __ANY_MAGNITUDE(DO) __ANY_BIT(DO) __ANY_STRING(DO) __ANY_DATE(DO) +#define __ANY_MAGNITUDE(DO) __ANY_NUM(DO) DO(TIME) +#define __ANY_BIT(DO) __ANY_NBIT(DO) DO(BOOL) +#define __ANY_NBIT(DO) DO(BYTE) DO(WORD) DO(DWORD) DO(LWORD) +#define __ANY_STRING(DO) DO(STRING) +#define __ANY_DATE(DO) DO(DATE) DO(TOD) DO(DT) +#define __ANY_NUM(DO) __ANY_REAL(DO) __ANY_INT(DO) +#define __ANY_REAL(DO) DO(REAL) DO(LREAL) +#define __ANY_INT(DO) __ANY_SINT(DO) __ANY_UINT(DO) +#define __ANY_SINT(DO) DO(SINT) DO(INT) DO(DINT) DO(LINT) +#define __ANY_UINT(DO) DO(USINT) DO(UINT) DO(UDINT) DO(ULINT) + +#define __ANY_1(DO,P1) __ANY_DERIVED_1(DO,P1) __ANY_ELEMENTARY_1(DO,P1) +#define __ANY_DERIVED_1(DO,P1) +#define __ANY_ELEMENTARY_1(DO,P1) __ANY_MAGNITUDE_1(DO,P1) __ANY_BIT_1(DO,P1) __ANY_STRING_1(DO,P1) __ANY_DATE_1(DO,P1) +#define __ANY_MAGNITUDE_1(DO,P1) __ANY_NUM_1(DO,P1) DO(TIME,P1) +#define __ANY_BIT_1(DO,P1) __ANY_NBIT_1(DO,P1) DO(BOOL,P1) +#define __ANY_NBIT_1(DO,P1) DO(BYTE,P1) DO(WORD,P1) DO(DWORD,P1) DO(LWORD,P1) +#define __ANY_STRING_1(DO,P1) DO(STRING,P1) +#define __ANY_DATE_1(DO,P1) DO(DATE,P1) DO(TOD,P1) DO(DT,P1) +#define __ANY_NUM_1(DO,P1) __ANY_REAL_1(DO,P1) __ANY_INT_1(DO,P1) +#define __ANY_REAL_1(DO,P1) DO(REAL,P1) DO(LREAL,P1) +#define __ANY_INT_1(DO,P1) __ANY_SINT_1(DO,P1) __ANY_UINT_1(DO,P1) +#define __ANY_SINT_1(DO,P1) DO(SINT,P1) DO(INT,P1) DO(DINT,P1) DO(LINT,P1) +#define __ANY_UINT_1(DO,P1) DO(USINT,P1) DO(UINT,P1) DO(UDINT,P1) DO(ULINT,P1) + + + +/*****************************************************************/ +/*****************************************************************/ +/***** *****/ +/***** IEC 61131-3 *****/ +/***** S T A N D A R D F U N C T I O N S *****/ +/***** *****/ +/*****************************************************************/ +/*****************************************************************/ + +/* NOTE: We only define and declare the explicitly typed standard functions + * (e.g., SIN_REAL, SIN_LREAL, ..., ADD_SINT, ADD_INT, ADD_LINT, ...) + * We do not declare/define the overloaded functions + * (SIN, ADD, ...). + * When handling a call to an overloaded function, the iec2c compiler + * will determine in stage3 the data type of the parameter being passed, + * and in stage4 generate the C code to call the correct + * typed standard function. + */ + +/* NOTE on explicit typing of: + * - Table 25 - Standard bit shift functions + * - Table 29 - Character string Functions + * + * In section 2.5.1.4 (Typing, overloading, and type conversion) of the IEC 61131-3 (version 2) + * of the standard, it is stated: + * "A standard function, [...] is said to be overloaded when it + * can operate on input data elements of various types within a generic type designator as defined in + * 2.3.2. For instance, an overloaded addition function on generic type ANY_NUM can operate on data + * of types LREAL, REAL, DINT, INT, and SINT." + * [...] + * "When a function which normally represents an overloaded operator is to be typed, i.e., the types + * of its inputs and outputs restricted to a particular elementary or derived data type as defined in + * 2.3, this shall be done by appending an "underline" character followed by the required type, as + * shown in table 21." + * + * However, this explanation (as well as the example in table 21) only refers to functions where the same + * generic data type is used for the single input and the output parameter. + * How can we create explicitly types functions when this is not the case? + * It does not seem to be covered by the standard. + * + * For this reason, we do not define the LEN_SINT, LEN_INT, LEN_STRING, LEN_[ANY_INT], LEN_[ANY_STRING] functions... + */ + + +/*****************************************/ +/*****************************************/ +/* 2.5.1.5.1 Type Conversion Functions */ +/*****************************************/ +/*****************************************/ + +/* macros for non-extensible functions */ +#define __function_1p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME) \ +FUNCTION fname : to_TYPENAME\ + VAR_INPUT p1_NAME : p1_TYPENAME; END_VAR\ + RETURN; \ +END_FUNCTION\ + +#define __function_2p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME) \ +FUNCTION fname : to_TYPENAME\ + VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME : p2_TYPENAME; END_VAR\ + RETURN; \ +END_FUNCTION\ + +#define __function_3p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME,p3_NAME,p3_TYPENAME) \ +FUNCTION fname : to_TYPENAME\ + VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME : p2_TYPENAME; p3_NAME : p3_TYPENAME; END_VAR\ + RETURN; \ +END_FUNCTION\ + +#define __function_4p(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME,p3_NAME,p3_TYPENAME,p4_NAME,p4_TYPENAME) \ +FUNCTION fname : to_TYPENAME\ + VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME : p2_TYPENAME; p3_NAME : p3_TYPENAME; p4_NAME : p4_TYPENAME; END_VAR\ + RETURN; \ +END_FUNCTION\ + + +/* macro for extensible functions */ +#define __function_1e(fname,to_TYPENAME,p1_NAME,p1_TYPENAME, FIRST_INDEX) \ +FUNCTION fname : to_TYPENAME\ + VAR_INPUT p1_NAME FIRST_INDEX .. : p1_TYPENAME; END_VAR\ + RETURN; \ +END_FUNCTION\ + +#define __function_2e(fname,to_TYPENAME,p1_NAME,p1_TYPENAME,p2_NAME,p2_TYPENAME, FIRST_INDEX) \ +FUNCTION fname : to_TYPENAME\ + VAR_INPUT p1_NAME : p1_TYPENAME; p2_NAME FIRST_INDEX .. : p2_TYPENAME; END_VAR\ + RETURN; \ +END_FUNCTION\ + + + + + + +#define __to_anynum_(from_TYPENAME) __ANY_NUM_1(__iec_,from_TYPENAME) +#define __to_anyint_(from_TYPENAME) __ANY_INT_1(__iec_,from_TYPENAME) +#define __to_anybit_(from_TYPENAME) __ANY_BIT_1(__iec_,from_TYPENAME) +#define __to_anynbit_(from_TYPENAME) __ANY_NBIT_1(__iec_,from_TYPENAME) +#define __to_anysint_(from_TYPENAME) __ANY_SINT_1(__iec_,from_TYPENAME) +#define __to_anyuint_(from_TYPENAME) __ANY_UINT_1(__iec_,from_TYPENAME) +#define __to_anyreal_(from_TYPENAME) __ANY_REAL_1(__iec_,from_TYPENAME) +#define __to_anydate_(from_TYPENAME) __ANY_DATE_1(__iec_,from_TYPENAME) +#define __to_time_(from_TYPENAME) __iec_(TIME,from_TYPENAME) +#define __to_string_(from_TYPENAME) __iec_(STRING,from_TYPENAME) + + +/*****************/ +/* *_TO_** */ +/*****************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __function_1p(from_TYPENAME##_TO_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) + +/******** [ANY_BIT]_TO_[ANY_NUM | ANY_BIT] ************/ +__ANY_BIT(__to_anynum_) +__ANY_BIT(__to_anybit_) + +/******** [ANY_NUM]_TO_[ANY_NUM | ANY_BIT] ************/ +__ANY_NUM(__to_anynum_) +__ANY_NUM(__to_anybit_) + + +/******** [ANY_BIT | ANY_NUM]_TO_[TIME | ANY_DATE] ************/ +__ANY_BIT(__to_time_) +__ANY_NUM(__to_time_) +__ANY_BIT(__to_anydate_) +__ANY_NUM(__to_anydate_) + + +/******** [TIME | ANY_DATE]_TO_[ANY_BIT | ANY_NUM] ************/ +__to_anynum_(TIME) +__to_anybit_(TIME) +__ANY_DATE(__to_anynum_) +__ANY_DATE(__to_anybit_) + + +/******** [ANY_DATE]_TO_[ANY_DATE | TIME] ************/ +/* Not supported: DT_TO_TIME */ +/*__iec_(to_TYPENAME,from_TYPENAME)*/ +__iec_(DATE,DT) +__iec_(DT,DT) +__iec_(TOD,DT) +/* Not supported: DATE_TO_TIME */ +__iec_(DATE,DATE) +/* Not supported: DATE_TO_DT */ +/* Not supported: DATE_TO_TOD */ +/* Not supported: TOD_TO_TIME */ +/* Not supported: TOD_TO_DATE */ +/* Not supported: TOD_TO_DT */ +__iec_(TOD,TOD) + + +/******** TIME_TO_[ANY_DATE] ************/ +/* Not supported: TIME_TO_DATE */ +/* Not supported: TIME_TO_DT */ +/* Not supported: TIME_TO_TOD */ + +/******** TIME_TO_TIME ************/ +__iec_(TIME,TIME) + + +/******** [ANY_BIT]_TO_STRING ************/ +__ANY_BIT(__to_string_) + + +/******** [ANY_NUM]_TO_STRING ************/ +__ANY_NUM(__to_string_) + +/******** [ANY_DATE]_TO_STRING ************/ +__ANY_DATE(__to_string_) + + +/******** TIME_TO_STRING ************/ +__iec_(STRING,TIME) + + +/******** STRING_TO_[ANY_BIT] ************/ +__to_anybit_(STRING) + + +/******** STRING_TO_[ANY_NUM] ************/ +__to_anynum_(STRING) + + +/******** STRING_TO_[ANY_DATE] ************/ +__to_anydate_(STRING) + + +/******** STRING_TO_TIME ************/ +__iec_(TIME,STRING) + +#undef __iec_ + + + +/**************/ +/* TRUNC */ +/**************/ +/* overloaded function! */ +#define __iec_(to_TYPENAME,from_TYPENAME) __function_1p(TRUNC, to_TYPENAME, IN, from_TYPENAME) +__ANY_REAL(__to_anyint_) +#undef __iec_ + + +/*******************/ +/* *_TO_BCD_* */ +/*******************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __function_1p(from_TYPENAME##_TO_BCD_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) +__ANY_UINT(__to_anynbit_) +#undef __iec_ + + +/*******************/ +/* *_BCD_TO_* */ +/*******************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __function_1p(from_TYPENAME##_BCD_TO_##to_TYPENAME, to_TYPENAME, IN, from_TYPENAME) +__ANY_NBIT(__to_anyuint_) +#undef __iec_ + +/***********************************/ +/***********************************/ +/* 2.5.1.5.2 Numerical Functions */ +/***********************************/ +/***********************************/ + +/******************************************************************/ +/*** Table 23 - Standard functions of one numeric variable ***/ +/******************************************************************/ + + /**************/ + /* ABS */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(ABS_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(ABS, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +__ANY_INT(__iec_) +#undef __iec_ + + /**************/ + /* SQRT */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(SQRT_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(SQRT, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* LN */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(LN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(LN, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* LOG */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(LOG_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(LOG, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* EXP */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(EXP_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(EXP, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* SIN */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(SIN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(SIN, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* COS */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(COS_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(COS, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* TAN */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(TAN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(TAN, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* ASIN */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(ASIN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(ASIN, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* ACOS */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(ACOS_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(ACOS, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* ATAN */ + /**************/ +#define __iec_(TYPENAME) \ +__function_1p(ATAN_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(ATAN, TYPENAME, IN, TYPENAME) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + + +/*****************************************************/ +/*** Table 24 - Standard arithmetic functions ***/ +/*****************************************************/ + +#define __arith_expand(fname,TYPENAME) \ +__function_1e(fname##_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */\ +__function_1e(fname, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ + + +#define __arith_static(fname,TYPENAME) \ +__function_1p(fname##_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */\ +__function_1p(fname, TYPENAME, IN, TYPENAME) /* overloaded function */ + + /**************/ + /* ADD */ + /**************/ +#define __iec_(TYPENAME) __arith_expand(ADD, TYPENAME) +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* MUL */ + /**************/ +#define __iec_(TYPENAME) __arith_expand(MUL, TYPENAME) +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* SUB */ + /**************/ +#define __iec_(TYPENAME) __arith_static(SUB, TYPENAME) +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* DIV */ + /**************/ +#define __iec_(TYPENAME)\ +__function_2p(DIV_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */\ +__function_2p(DIV, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* MOD */ + /**************/ +#ifdef __DEFINE_CLASHING_FUNCTIONS +#define __iec_(TYPENAME)\ +__function_2p(MOD_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* explicitly typed function */\ +__function_2p(MOD, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) /* overloaded function */ +__ANY_INT(__iec_) +#undef __iec_ +#endif + + /**************/ + /* EXPT */ + /**************/ +#define __in1_anyreal_(in2_TYPENAME) __ANY_REAL_1(__iec_,in2_TYPENAME) +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +__function_2p(EXPT, in1_TYPENAME, IN1, in1_TYPENAME, IN2, in2_TYPENAME) /* overloaded function */ +__ANY_NUM(__in1_anyreal_) +#undef __iec_ + + /***************/ + /* MOVE */ + /***************/ +#define __iec_(TYPENAME) __arith_static(MOVE, TYPENAME) +__ANY(__iec_) +#undef __iec_ + + + + +/***********************************/ +/***********************************/ +/* 2.5.1.5.3 Bit String Functions */ +/***********************************/ +/***********************************/ + +/****************************************************/ +/*** Table 25 - Standard bit shift functions ***/ +/****************************************************/ +/* We do not delcare explcitly typed versions of the functions in table 29. + * See note at top of this file regarding explicitly typed functions for more details. + */ +#define __in1_anybit_(in2_TYPENAME) __ANY_BIT_1(__iec_,in2_TYPENAME) + + + /**************/ + /* SHL */ + /**************/ +#define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(SHL, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ +__ANY_INT(__in1_anybit_) +#undef __iec_ + + /**************/ + /* SHR */ + /**************/ +#define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(SHR, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ +__ANY_INT(__in1_anybit_) +#undef __iec_ + + /**************/ + /* ROR */ + /**************/ +#define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(ROR, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ +__ANY_INT(__in1_anybit_) +#undef __iec_ + + /**************/ + /* ROL */ + /**************/ +#define __iec_(in1_TYPENAME,in2_TYPENAME) __function_2p(ROL, in1_TYPENAME, IN, in1_TYPENAME, N, in2_TYPENAME) /* overloaded function */ +__ANY_INT(__in1_anybit_) +#undef __iec_ + + + +/*********************/ +/*** Table 26 ***/ +/*********************/ + + /**************/ + /* AND */ + /**************/ +#ifdef __DEFINE_CLASHING_FUNCTIONS +#define __iec_(TYPENAME) \ +__function_1e(AND, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(AND_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_BIT(__iec_) +#undef __iec_ +#endif + + /*************/ + /* OR */ + /*************/ +#ifdef __DEFINE_CLASHING_FUNCTIONS +#define __iec_(TYPENAME) \ +__function_1e(OR, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(OR_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_BIT(__iec_) +#undef __iec_ +#endif + + /**************/ + /* XOR */ + /**************/ +#ifdef __DEFINE_CLASHING_FUNCTIONS +#define __iec_(TYPENAME) \ +__function_1e(XOR, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(XOR_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_BIT(__iec_) +#undef __iec_ +#endif + + /**************/ + /* NOT */ + /**************/ +#ifdef __DEFINE_CLASHING_FUNCTIONS +#define __iec_(TYPENAME) \ +__function_1p(NOT, TYPENAME, IN, TYPENAME) /* overloaded function */ \ +__function_1p(NOT_##TYPENAME, TYPENAME, IN, TYPENAME) /* explicitly typed function */ +__ANY_BIT(__iec_) +#undef __iec_ +#endif + + + + + + +/***************************************************/ +/***************************************************/ +/* 2.5.1.5.4 Selection and comparison Functions */ +/***************************************************/ +/***************************************************/ + +/*********************/ +/*** Table 27 ***/ +/*********************/ + + /**************/ + /* SEL */ + /**************/ +/* The standard states that the inputs for SEL and MUX must be named starting off from 0, + * unlike remaining functions, that start off at 1. + */ +#define __iec_(TYPENAME) \ +__function_3p(SEL, TYPENAME, G, BOOL, IN0, TYPENAME, IN1, TYPENAME) /* overloaded function */ \ +__function_3p(SEL_##TYPENAME, TYPENAME, G, BOOL, IN0, TYPENAME, IN1, TYPENAME) /* explicitly typed function */ +__ANY(__iec_) +#undef __iec_ + + /**************/ + /* MAX */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(MAX, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(MAX_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* MIN */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(MIN, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(MIN_##TYPENAME, TYPENAME, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* LIMIT */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_3p(LIMIT, TYPENAME, MN, TYPENAME, IN, TYPENAME, MX, TYPENAME) /* overloaded function */ \ +__function_3p(LIMIT_##TYPENAME, TYPENAME, MN, TYPENAME, IN, TYPENAME, MX, TYPENAME) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* MUX */ + /**************/ +/* The standard states that the inputs for SEL and MUX must be named starting off from 0, + * unlike remaining functions, that start off at 1. + */ +/* The standard considers the explicit typing of MUX function as a special case... + * It should look like: + * MUX_SINT_REAL, MUX_SINT_STRING, MUX_SINT_[ANY] + * MUX_INT_REAL, MUX_INT_STRING, MUX_INT_[ANY] + * MUX_[ANY_INT]_[ANY] + */ +#define __in1_anyint_(in2_TYPENAME) __ANY_INT_1(__iec_,in2_TYPENAME) +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +__function_2e(MUX, in2_TYPENAME, K, in1_TYPENAME, IN, in2_TYPENAME, 0) /* overloaded function */ \ +__function_2e(MUX_##in1_TYPENAME##_##in2_TYPENAME, in2_TYPENAME, K, in1_TYPENAME, IN, in2_TYPENAME, 0) /* explicitly typed function */ +__ANY(__in1_anyint_) +#undef __iec_ + + + +/******************************************/ +/*** Table 28 ***/ +/*** Standard comparison functions ***/ +/******************************************/ + + /**************/ + /* GT */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(GT, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(GT_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* GE */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(GE, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(GE_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* EQ */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(EQ, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(EQ_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* LT */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(LT, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(LT_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* LE */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(LE, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(LE_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + /**************/ + /* NE */ + /**************/ +/* Should be for: ANY_ELEMENTARY, but we currently do not support WSTRING yet... */ +/* However, we can call __ANY_ELEMENTARY since the __ANY_STRING macro does not call DO(WSTRING) */ +#define __iec_(TYPENAME) \ +__function_1e(NE, BOOL, IN, TYPENAME, 1) /* overloaded function */ \ +__function_1e(NE_##TYPENAME, BOOL, IN, TYPENAME, 1) /* explicitly typed function */ +__ANY_ELEMENTARY(__iec_) +#undef __iec_ + + + +/*********************************************/ +/*********************************************/ +/* 2.5.1.5.5 Character string Functions */ +/*********************************************/ +/*********************************************/ + +/*************************************/ +/*** Table 29 ***/ +/*** Character string Functions ***/ +/*************************************/ + +/* We do not delcare explcitly typed versions of the functions in table 29. + * See note at top of this file regarding explicitly typed functions for more details. + */ + +#define __A_anyint_(B_TYPENAME) __ANY_INT_1(__iec_,B_TYPENAME) + + + + /***************/ + /* LEN */ + /***************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_1p(LEN, A_TYPENAME, IN, B_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /****************/ + /* LEFT */ + /****************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_2p(LEFT, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /*****************/ + /* RIGHT */ + /*****************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_2p(RIGHT, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /***************/ + /* MID */ + /***************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_3p(MID, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME, P, A_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /******************/ + /* CONCAT */ + /******************/ +#define __iec_(TYPENAME) \ +__function_1e(CONCAT, TYPENAME, IN, TYPENAME, 1) /* overloaded function */ +__ANY_STRING(__iec_) +#undef __iec_ + + + /******************/ + /* INSERT */ + /******************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_3p(INSERT, B_TYPENAME, IN1, B_TYPENAME, IN2, B_TYPENAME, P, A_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /******************/ + /* DELETE */ + /******************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_3p(DELETE, B_TYPENAME, IN, B_TYPENAME, L, A_TYPENAME, P, A_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /*******************/ + /* REPLACE */ + /*******************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_4p(REPLACE, B_TYPENAME, IN1, B_TYPENAME, IN2, B_TYPENAME, L, A_TYPENAME, P, A_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + + /****************/ + /* FIND */ + /****************/ +#define __iec_(A_TYPENAME,B_TYPENAME) \ +__function_2p(FIND, A_TYPENAME, IN1, B_TYPENAME, IN2, B_TYPENAME) /* overloaded function */ +__ANY_STRING(__A_anyint_) +#undef __iec_ + + +/*********************************************/ +/*********************************************/ +/* 2.5.1.5.6 Functions of time data types */ +/*********************************************/ +/*********************************************/ + +/**************************************/ +/*** Table 30 ***/ +/*** Functions of time data types ***/ +/**************************************/ + +__function_2p(ADD_TIME, TIME, IN1, TIME, IN2, TIME) +__function_2p(ADD_TOD_TIME, TOD, IN1, TOD, IN2, TIME) +__function_2p(ADD_DT_TIME, DT, IN1, DT, IN2, TIME) + +__function_2p(SUB_TIME, TIME, IN1, TIME, IN2, TIME) +__function_2p(SUB_DATE_DATE, TIME, IN1, DATE, IN2, DATE) +__function_2p(SUB_TOD_TIME, TOD, IN1, TOD, IN2, TIME) +__function_2p(SUB_TOD_TOD, TIME, IN1, TOD, IN2, TOD) +__function_2p(SUB_DT_TIME, DT, IN1, DT, IN2, TIME) +__function_2p(SUB_DT_DT, TIME, IN1, DT, IN2, DT) + + +/*** MULTIME ***/ +#define __iec_(TYPENAME) \ +__function_2p(MULTIME_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) /* explicitly typed function */\ +__function_2p(MULTIME, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + +/*** MUL ***/ +/* NOTE: We can not include the explicitly typed function + * __function_2p(DIV_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) + * as it would clash with another function with the exact same name declared above + * __function_2p(DIV_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) + * and the standard does not define this explicitly defined function as being overloaded + * (i.e. having an ANY_***) input or output parameter + * Note that our compiler would nevertheless work just fine with this overloaded declaration. + */ +#define __iec_(TYPENAME) \ +__function_2p(MUL, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + +/*** DIVTIME ***/ +#define __iec_(TYPENAME) \ +__function_2p(DIVTIME_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) /* explicitly typed function */\ +__function_2p(DIVTIME, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + +/*** DIV ***/ +/* NOTE: We can not include the explicitly typed function + * __function_2p(DIV_##TYPENAME, TIME, IN1, TIME, IN2, TYPENAME) + * as it would clash with another function with the exact same name declared above + * __function_2p(DIV_##TYPENAME, TYPENAME, IN1, TYPENAME, IN2, TYPENAME) + * and the standard does not define this explicitly defined function as being overloaded + * (i.e. having an ANY_***) input or output parameter + * Note that our compiler would nevertheless work just fine with this overloaded declaration. + */ +#define __iec_(TYPENAME) \ +__function_2p(DIV, TIME, IN1, TIME, IN2, TYPENAME) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + + +/*** CONCAT_DATE_TOD ***/ +__function_2p(CONCAT_DATE_TOD, DT, IN1, DATE, IN2, TOD) + + + + +/****************************************************/ +/****************************************************/ +/* 2.5.1.5.6 Functions of enumerated data types */ +/****************************************************/ +/****************************************************/ + +/********************************************/ +/*** Table 31 ***/ +/*** Functions of enumerated data types ***/ +/********************************************/ + +/* Do we support this? */ + +END + +echo "{enable code generation}" +echo diff -r b826f13c260e -r 7a11f9e9e703 lib/iec_std_lib.h --- a/lib/iec_std_lib.h Wed Sep 07 19:28:10 2011 +0200 +++ b/lib/iec_std_lib.h Thu Sep 08 20:25:00 2011 +0200 @@ -1,5 +1,6 @@ /* - * (c) 2008 Edouard TISSERANT + * copyright 2008 Edouard TISSERANT + * copyright 2011 Mario de Sousa (msousa@fe.up.pt) * * Offered to the public under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either version 2 @@ -18,6 +19,13 @@ * IEC 61131-3 standard function library */ +/* NOTE: This file is full of (what may seem at first) very strange macros. + * If you want to know what all these strange macros are doing, + * just parse this file through a C preprocessor (e.g. cpp), + * and analyse the output! + * $gcc -E iec_std_lib.h + */ + #include #include #include @@ -51,7 +59,7 @@ u_int16_t body[STR_MAX_LEN]; } WSTRING; */ - +/* # if __WORDSIZE == 64 #define __32b_sufix #define __64b_sufix L @@ -59,6 +67,19 @@ #define __32b_sufix L #define __64b_sufix LL #endif +*/ + +# if __WORDSIZE == 64 +#define __32b_sufix +#define __64b_sufix L +#else +#define __32b_sufix L +/* changed this from LL to L temporarily. It was causing a bug when compiling resulting code with gcc. + * I have other things to worry about at the moment.. + */ +#define __64b_sufix L +#endif + #define __lit(type,value,sfx) (type)value##sfx // Keep this macro expention step to let sfx change into L or LL @@ -83,7 +104,7 @@ #define __BYTE_LITERAL(value) __literal(BYTE,value,) #define __WORD_LITERAL(value) __literal(WORD,value,) #define __DWORD_LITERAL(value) __literal(DWORD,value,__32b_sufix) -#define __LWORD_LITERAL(value) __literal(LWORD,value,__32b_sufix) +#define __LWORD_LITERAL(value) __literal(LWORD,value,__64b_sufix) @@ -136,17 +157,33 @@ DATE DATEvar; } __IL_DEFVAR_T; -/*****************/ -/* Misc internal */ -/*****************/ + +/**********************************************************************/ +/**********************************************************************/ +/***** *****/ +/***** Some helper functions... *****/ +/***** ...used later: *****/ +/***** - when declaring the IEC 61131-3 standard functions *****/ +/***** - in the C source code itself in SFC and ST expressions *****/ +/***** *****/ +/**********************************************************************/ +/**********************************************************************/ + + +/****************************/ +/* Notify IEC runtime error */ +/****************************/ /* function that generates an IEC runtime error */ -static inline void IEC_error(void) { +static inline void __iec_error(void) { /* TODO... */ fprintf(stderr, "IEC 61131-3 runtime error.\n"); /*exit(1);*/ } +/*******************************/ +/* Time normalization function */ +/*******************************/ static inline void __normalize_timespec (IEC_TIMESPEC *ts) { if( ts->tv_nsec < -1000000000 || (( ts->tv_sec > 0 ) && ( ts->tv_nsec < 0 ))){ @@ -159,6 +196,10 @@ } } +/**********************************************/ +/* Time conversion to/from timespec functions */ +/**********************************************/ + static inline IEC_TIMESPEC __time_to_timespec(int sign, double mseconds, double seconds, double minutes, double hours, double days) { IEC_TIMESPEC ts; @@ -197,7 +238,7 @@ epoch_seconds = mktime(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */ if ((time_t)(-1) == epoch_seconds) - IEC_error(); + __iec_error(); ts.tv_sec = epoch_seconds; ts.tv_nsec = 0; @@ -223,56 +264,35 @@ epoch_seconds = mktime(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */ if ((time_t)(-1) == epoch_seconds) - IEC_error(); + __iec_error(); ts.tv_sec += epoch_seconds; if (ts.tv_sec < epoch_seconds) /* since the TOD is always positive, if the above happens then we had an overflow */ - IEC_error(); + __iec_error(); return ts; } -/********************/ -/* EN/ENO PARAMS */ -/********************/ - -#define EN_ENO_PARAMS BOOL EN, BOOL *ENO -#define TEST_EN(TYPENAME)\ - if (!EN) {\ - if (ENO != NULL)\ - *ENO = __BOOL_LITERAL(FALSE);\ - return __INIT_##TYPENAME;\ - }\ - else if (ENO != NULL)\ - *ENO = __BOOL_LITERAL(TRUE); -#define TEST_EN_COND(TYPENAME, COND)\ - if (!EN || (COND)) {\ - if (ENO != NULL)\ - *ENO = __BOOL_LITERAL(FALSE);\ - return __INIT_##TYPENAME;\ - }\ - else if (ENO != NULL)\ - *ENO = __BOOL_LITERAL(TRUE); - -/***************/ -/* Time ops */ -/***************/ -#define __TIME_CMP(t1, t2) (t2.tv_sec == t1.tv_sec ? t1.tv_nsec - t2.tv_nsec : t1.tv_sec - t2.tv_sec) - -static inline TIME __TIME_ADD(TIME IN1, TIME IN2){ +/*******************/ +/* Time operations */ +/*******************/ + +#define __time_cmp(t1, t2) (t2.tv_sec == t1.tv_sec ? t1.tv_nsec - t2.tv_nsec : t1.tv_sec - t2.tv_sec) + +static inline TIME __time_add(TIME IN1, TIME IN2){ TIME res ={IN1.tv_sec + IN2.tv_sec, IN1.tv_nsec + IN2.tv_nsec }; __normalize_timespec(&res); return res; } -static inline TIME __TIME_SUB(TIME IN1, TIME IN2){ +static inline TIME __time_sub(TIME IN1, TIME IN2){ TIME res ={IN1.tv_sec - IN2.tv_sec, IN1.tv_nsec - IN2.tv_nsec }; __normalize_timespec(&res); return res; } -static inline TIME __TIME_MUL(TIME IN1, LREAL IN2){ +static inline TIME __time_mul(TIME IN1, LREAL IN2){ LREAL s_f = IN1.tv_sec * IN2; time_t s = s_f; div_t ns = div((LREAL)IN1.tv_nsec * IN2, 1000000000); @@ -281,7 +301,7 @@ __normalize_timespec(&res); return res; } -static inline TIME __TIME_DIV(TIME IN1, LREAL IN2){ +static inline TIME __time_div(TIME IN1, LREAL IN2){ LREAL s_f = IN1.tv_sec / IN2; time_t s = s_f; TIME res = {s, @@ -290,183 +310,6 @@ return res; } -static inline TIME __date_and_time_to_time_of_day(EN_ENO_PARAMS, TIME IN){ - TEST_EN(TIME) - return (TIME){IN.tv_sec % 86400, IN.tv_nsec}; -} -static inline TIME __date_and_time_to_date(EN_ENO_PARAMS, TIME IN){ - TEST_EN(TIME) - return (TIME){IN.tv_sec - (IN.tv_sec % (24*60*60)), 0}; -} -static inline TIME __time_add(EN_ENO_PARAMS, TIME IN1, TIME IN2){ - TEST_EN(TIME) - return __TIME_ADD(IN1, IN2); -} -static inline TIME __time_sub(EN_ENO_PARAMS, TIME IN1, TIME IN2){ - TEST_EN(TIME) - return __TIME_SUB(IN1, IN2); -} -static inline TIME __time_mul(EN_ENO_PARAMS, TIME IN1, LREAL IN2){ - TEST_EN(TIME) - return __TIME_MUL(IN1, IN2); -} -static inline TIME __time_div(EN_ENO_PARAMS, TIME IN1, LREAL IN2){ - TEST_EN(TIME) - return __TIME_DIV(IN1, IN2); -} - -/***************/ -/* String ops */ -/***************/ -#define __STR_CMP(str1, str2) memcmp((char*)&str1.body,(char*)&str2.body, str1.len < str2.len ? str1.len : str2.len) - -static inline __strlen_t __len(EN_ENO_PARAMS, STRING IN){ - TEST_EN(UINT) - return IN.len; -} -static inline STRING __left(EN_ENO_PARAMS, STRING IN, __strlen_t L){ - STRING res; - TEST_EN_COND(STRING, L < 0) - res = __INIT_STRING; - L = L < IN.len ? L : IN.len; - memcpy(&res.body, &IN.body, L); - res.len = L; - return res; -} -static inline STRING __right(EN_ENO_PARAMS, STRING IN, __strlen_t L){ - STRING res; - TEST_EN_COND(STRING, L < 0) - res = __INIT_STRING; - L = L < IN.len ? L : IN.len; - memcpy(&res.body, &IN.body[IN.len - L], L); - res.len = L; - return res; -} -static inline STRING __mid(EN_ENO_PARAMS, STRING IN, __strlen_t L, __strlen_t P){ - STRING res; - TEST_EN_COND(STRING, L < 0 || P < 0) - res = __INIT_STRING; - if(P <= IN.len){ - P -= 1; /* now can be used as [index]*/ - L = L + P <= IN.len ? L : IN.len - P; - memcpy(&res.body, &IN.body[P] , L); - res.len = L; - } - return res; -} -static inline STRING __concat(EN_ENO_PARAMS, UINT param_count, ...){ - UINT i; - STRING res; - va_list ap; - __strlen_t charcount; - TEST_EN(STRING) - charcount = 0; - res = __INIT_STRING; - - va_start (ap, param_count); /* Initialize the argument list. */ - - for (i = 0; i < param_count && charcount < STR_MAX_LEN; i++) - { - STRING tmp = va_arg(ap, STRING); - __strlen_t charrem = STR_MAX_LEN - charcount; - __strlen_t to_write = tmp.len > charrem ? charrem : tmp.len; - memcpy(&res.body[charcount], &tmp.body , to_write); - charcount += to_write; - } - - res.len = charcount; - - va_end (ap); /* Clean up. */ - return res; -} -static inline STRING __insert(EN_ENO_PARAMS, STRING IN1, STRING IN2, __strlen_t P){ - STRING res; - __strlen_t to_copy; - TEST_EN_COND(STRING, P < 0) - res = __INIT_STRING; - - to_copy = P > IN1.len ? IN1.len : P; - memcpy(&res.body, &IN1.body , to_copy); - P = res.len = to_copy; - - to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len; - memcpy(&res.body[res.len], &IN2.body , to_copy); - res.len += to_copy; - - to_copy = IN1.len - P < STR_MAX_LEN - res.len ? IN1.len - P : STR_MAX_LEN - res.len ; - memcpy(&res.body[res.len], &IN1.body[P] , to_copy); - res.len += to_copy; - - return res; -} -static inline STRING __delete(EN_ENO_PARAMS, STRING IN, __strlen_t L, __strlen_t P){ - STRING res; - __strlen_t to_copy; - TEST_EN_COND(STRING, L < 0 || P < 0) - res = __INIT_STRING; - - to_copy = P > IN.len ? IN.len : P-1; - memcpy(&res.body, &IN.body , to_copy); - P = res.len = to_copy; - - if( IN.len > P + L ){ - to_copy = IN.len - P - L; - memcpy(&res.body[res.len], &IN.body[P + L], to_copy); - res.len += to_copy; - } - - return res; -} -static inline STRING __replace(EN_ENO_PARAMS, STRING IN1, STRING IN2, __strlen_t L, __strlen_t P){ - STRING res; - __strlen_t to_copy; - TEST_EN_COND(STRING, L < 0 || P < 0) - res = __INIT_STRING; - - to_copy = P > IN1.len ? IN1.len : P-1; - memcpy(&res.body, &IN1.body , to_copy); - P = res.len = to_copy; - - to_copy = IN2.len < L ? IN2.len : L; - - if( to_copy + res.len > STR_MAX_LEN ) - to_copy = STR_MAX_LEN - res.len; - - memcpy(&res.body[res.len], &IN2.body , to_copy); - res.len += to_copy; - - P += L; - if( res.len < STR_MAX_LEN && P < IN1.len) - { - to_copy = IN1.len - P; - memcpy(&res.body[res.len], &IN1.body[P] , to_copy); - res.len += to_copy; - } - - return res; -} - - - -static inline __strlen_t __pfind(STRING* IN1, STRING* IN2){ - UINT count1 = 0; /* offset of first matching char in IN1 */ - UINT count2 = 0; /* count of matching char */ - while(count1 + count2 < IN1->len && count2 < IN2->len) - { - if(IN1->body[count1 + count2] != IN2->body[count2]){ - count1 += count2 + 1; - count2 = 0; - } - else { - count2++; - } - } - return count2 == IN2->len -1 ? 0 : count1 + 1; -} -static inline __strlen_t __find(EN_ENO_PARAMS, STRING IN1, STRING IN2){ - TEST_EN(UINT) - return __pfind(&IN1, &IN2); -} /***************/ /* Convertions */ @@ -474,67 +317,49 @@ /*****************/ /* REAL_TO_INT */ /*****************/ -static inline LINT __real_round(LREAL IN) -{ +static inline LINT __real_round(LREAL IN) { return fmod(IN, 1) == 0 ? ((LINT)IN / 2) * 2 : (LINT)IN; } -static inline LINT __preal_to_sint(LREAL IN) -{ +static inline LINT __preal_to_sint(LREAL IN) { return IN >= 0 ? __real_round(IN + 0.5) : __real_round(IN - 0.5); } -static inline LINT __preal_to_uint(LREAL IN) -{ +static inline LINT __preal_to_uint(LREAL IN) { return IN >= 0 ? __real_round(IN + 0.5) : 0; } -static inline LINT __real_to_sint(EN_ENO_PARAMS, LREAL IN){ - TEST_EN(LINT) - return (LINT)__preal_to_sint(IN); -} -static inline LWORD __real_to_bit(EN_ENO_PARAMS, LREAL IN){ - TEST_EN(LWORD) - return (LWORD)__preal_to_uint(IN); -} -static inline ULINT __real_to_uint(EN_ENO_PARAMS, LREAL IN){ - TEST_EN(ULINT) - return (ULINT)__preal_to_uint(IN); -} +static inline LINT __real_to_sint(LREAL IN) {return (LINT)__preal_to_sint(IN);} +static inline LWORD __real_to_bit(LREAL IN) {return (LWORD)__preal_to_uint(IN);} +static inline ULINT __real_to_uint(LREAL IN) {return (ULINT)__preal_to_uint(IN);} + /***************/ /* TO_STRING */ /***************/ -static inline STRING __bool_to_string(EN_ENO_PARAMS, BOOL IN) -{ - TEST_EN(STRING) - if(IN) - return (STRING){4, "TRUE"}; +static inline STRING __bool_to_string(BOOL IN) { + if(IN) return (STRING){4, "TRUE"}; return (STRING){5,"FALSE"}; } -static inline STRING __bit_to_string(EN_ENO_PARAMS, LWORD IN){ +static inline STRING __bit_to_string(LWORD IN) { STRING res; - TEST_EN(STRING) res = __INIT_STRING; res.len = snprintf((char*)res.body, STR_MAX_LEN, "16#%llx", IN); if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } -static inline STRING __real_to_string(EN_ENO_PARAMS, LREAL IN){ +static inline STRING __real_to_string(LREAL IN) { STRING res; - TEST_EN(STRING) res = __INIT_STRING; res.len = snprintf((char*)res.body, STR_MAX_LEN, "%.10g", IN); if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } -static inline STRING __sint_to_string(EN_ENO_PARAMS, LINT IN){ +static inline STRING __sint_to_string(LINT IN) { STRING res; - TEST_EN(STRING) res = __INIT_STRING; res.len = snprintf((char*)res.body, STR_MAX_LEN, "%lld", IN); if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } -static inline STRING __uint_to_string(EN_ENO_PARAMS, ULINT IN){ +static inline STRING __uint_to_string(ULINT IN) { STRING res; - TEST_EN(STRING) res = __INIT_STRING; res.len = snprintf((char*)res.body, STR_MAX_LEN, "%llu", IN); if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; @@ -543,12 +368,11 @@ /***************/ /* FROM_STRING */ /***************/ -static inline BOOL __string_to_bool(EN_ENO_PARAMS, STRING IN){ - TEST_EN(BOOL) +static inline BOOL __string_to_bool(STRING IN) { return IN.len == 5 ? !memcmp(&IN.body,"TRUE", IN.len) : 0; } -static inline LINT __pstring_to_sint(STRING* IN){ +static inline LINT __pstring_to_sint(STRING* IN) { LINT res = 0; __strlen_t l; unsigned int shift = 0; @@ -609,22 +433,12 @@ return res; } -static inline LINT __string_to_sint(EN_ENO_PARAMS, STRING IN){ - TEST_EN(LINT) - return (LINT)__pstring_to_sint(&IN); -} -static inline LWORD __string_to_bit(EN_ENO_PARAMS, STRING IN){ - TEST_EN(LWORD) - return (LWORD)__pstring_to_sint(&IN); -} -static inline ULINT __string_to_uint(EN_ENO_PARAMS, STRING IN){ - TEST_EN(ULINT) - return (ULINT)__pstring_to_sint(&IN); -} -static inline LREAL __string_to_real(EN_ENO_PARAMS, STRING IN){ - __strlen_t l; - TEST_EN(LREAL) - l = IN.len; +static inline LINT __string_to_sint(STRING IN) {return (LINT)__pstring_to_sint(&IN);} +static inline LWORD __string_to_bit (STRING IN) {return (LWORD)__pstring_to_sint(&IN);} +static inline ULINT __string_to_uint(STRING IN) {return (ULINT)__pstring_to_sint(&IN);} +static inline LREAL __string_to_real(STRING IN) { + __strlen_t l; + l = IN.len; /* search the dot */ while(--l > 0 && IN.body[l] != '.'); if(l != 0){ @@ -637,18 +451,10 @@ /***************/ /* TO_TIME */ /***************/ -static inline TIME __int_to_time(EN_ENO_PARAMS, LINT IN){ - TEST_EN(TIME) - return (TIME){IN, 0}; -} - -static inline TIME __real_to_time(EN_ENO_PARAMS, LREAL IN){ - TEST_EN(TIME) - return (TIME){IN, (IN - (LINT)IN) * 1000000000}; -} -static inline TIME __string_to_time(EN_ENO_PARAMS, STRING IN){ - __strlen_t l; - TEST_EN(TIME) +static inline TIME __int_to_time(LINT IN) {return (TIME){IN, 0};} +static inline TIME __real_to_time(LREAL IN) {return (TIME){IN, (IN - (LINT)IN) * 1000000000};} +static inline TIME __string_to_time(STRING IN){ + __strlen_t l; /* TODO : * * Duration literals without underlines: T#14ms T#-14ms T#14.7s T#14.7m @@ -671,7 +477,7 @@ */ /* Quick hack : only transform seconds */ /* search the dot */ - l = IN.len; + l = IN.len; while(--l > 0 && IN.body[l] != '.'); if(l != 0){ LREAL IN_val = atof((const char *)&IN.body); @@ -684,18 +490,13 @@ /***************/ /* FROM_TIME */ /***************/ -static inline LREAL __time_to_real(EN_ENO_PARAMS, TIME IN){ - TEST_EN(LREAL) +static inline LREAL __time_to_real(TIME IN){ return (LREAL)IN.tv_sec + ((LREAL)IN.tv_nsec/1000000000); } -static inline LINT __time_to_int(EN_ENO_PARAMS, TIME IN){ - TEST_EN(LINT) - return IN.tv_sec; -} -static inline STRING __time_to_string(EN_ENO_PARAMS, TIME IN){ +static inline LINT __time_to_int(TIME IN) {return IN.tv_sec;} +static inline STRING __time_to_string(TIME IN){ STRING res; div_t days; - TEST_EN(STRING) /*t#5d14h12m18s3.5ms*/ res = __INIT_STRING; days = div(IN.tv_sec ,86400); @@ -721,32 +522,30 @@ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } -static inline STRING __date_to_string(EN_ENO_PARAMS, DATE IN){ +static inline STRING __date_to_string(DATE IN){ STRING res; struct tm* broken_down_time; time_t seconds; - TEST_EN(STRING) /* D#1984-06-25 */ res = __INIT_STRING; seconds = IN.tv_sec; if (NULL == (broken_down_time = localtime(&seconds))){ /* get the UTC (GMT) broken down time */ - IEC_error(); + __iec_error(); return (STRING){7,"D#ERROR"}; } res.len = snprintf((char*)&res.body, STR_MAX_LEN, "D#%d-%2.2d-%2.2d", broken_down_time->tm_year + 1900, broken_down_time->tm_mon + 1, broken_down_time->tm_mday); if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } -static inline STRING __tod_to_string(EN_ENO_PARAMS, TOD IN){ +static inline STRING __tod_to_string(TOD IN){ STRING res; struct tm* broken_down_time; time_t seconds; - TEST_EN(STRING) /* TOD#15:36:55.36 */ res = __INIT_STRING; seconds = IN.tv_sec; if (NULL == (broken_down_time = localtime(&seconds))){ /* get the UTC (GMT) broken down time */ - IEC_error(); + __iec_error(); return (STRING){9,"TOD#ERROR"}; } if(IN.tv_nsec == 0){ @@ -757,15 +556,14 @@ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } -static inline STRING __dt_to_string(EN_ENO_PARAMS, DT IN){ +static inline STRING __dt_to_string(DT IN){ STRING res; struct tm* broken_down_time; time_t seconds; - TEST_EN(STRING) /* DT#1984-06-25-15:36:55.36 */ seconds = IN.tv_sec; if (NULL == (broken_down_time = localtime(&seconds))){ /* get the UTC (GMT) broken down time */ - IEC_error(); + __iec_error(); return (STRING){8,"DT#ERROR"}; } if(IN.tv_nsec == 0){ @@ -788,12 +586,21 @@ if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN; return res; } - /* BCD */ + + /**********************************************/ + /* [ANY_DATE | TIME] _TO_ [ANY_DATE | TIME] */ + /**********************************************/ + +static inline TOD __date_and_time_to_time_of_day(DT IN) {return (TOD){IN.tv_sec % 86400, IN.tv_nsec};} +static inline DATE __date_and_time_to_date(DT IN){return (DATE){IN.tv_sec - (IN.tv_sec % (24*60*60)), 0};} + + /*****************/ + /* FROM/TO BCD */ + /*****************/ #define __bcd_digit(fac) -static inline ULINT __bcd_to_uint(EN_ENO_PARAMS, LWORD IN){ +static inline ULINT __bcd_to_uint(LWORD IN){ ULINT res; ULINT i; - TEST_EN(ULINT) res = IN & 0xf; for(i = 10ULL; i <= 1000000000000000ULL; i *= 10){ @@ -804,10 +611,9 @@ return res; } -static inline LWORD __uint_to_bcd(EN_ENO_PARAMS, ULINT IN){ +static inline LWORD __uint_to_bcd(ULINT IN){ LWORD res; USINT i; - TEST_EN(LWORD) res = IN % 10; for(i = 4; i<=60; i += 4){ @@ -818,6 +624,296 @@ return res; } + + /************/ + /* MOVE_* */ + /************/ + +/* some helpful __move_[ANY] functions, used in the *_TO_** and MOVE standard functions */ +/* e.g. __move_BOOL, __move_BYTE, __move_REAL, __move_TIME, ... */ +#define __iec_(TYPENAME)\ +static inline TYPENAME __move_##TYPENAME(TYPENAME op1) {return op1;} +__ANY(__iec_) +#undef __iec_ + + + +/*****************************************************************/ +/*****************************************************************/ +/***** *****/ +/***** IEC 61131-3 *****/ +/***** S T A N D A R D F U N C T I O N S *****/ +/***** *****/ +/*****************************************************************/ +/*****************************************************************/ + +/* NOTE: If you want to know what all these strange macros are doing, + * just parse this file through a C preprocessor, and analyse the output! + * $gcc -E iec_std_lib.h + */ + +/* NOTE: We only define and declare the explicitly typed standard functions + * (e.g., SIN_REAL, SIN_LREAL, ..., ADD_SINT, ADD_INT, ADD_LINT, ...) + * We do not declare/define the overloaded functions + * (SIN, ADD, ...). + * When handling a call to an overloaded function, the iec2c compiler + * will determine in stage3 the data type of the parameter being passed, + * and in stage4 generate the C code to call the correct + * typed standard function. + */ + +/* NOTE on explicit typing of: + * - Table 25 - Standard bit shift functions + * - Table 29 - Character string Functions + * + * In section 2.5.1.4 (Typing, overloading, and type conversion) of the IEC 61131-3 (version 2) + * of the standard, it is stated: + * "A standard function, [...] is said to be overloaded when it + * can operate on input data elements of various types within a generic type designator as defined in + * 2.3.2. For instance, an overloaded addition function on generic type ANY_NUM can operate on data + * of types LREAL, REAL, DINT, INT, and SINT." + * [...] + * "When a function which normally represents an overloaded operator is to be typed, i.e., the types + * of its inputs and outputs restricted to a particular elementary or derived data type as defined in + * 2.3, this shall be done by appending an "underline" character followed by the required type, as + * shown in table 21." + * + * However, this explanation (as well as the example in table 21) only refers to functions where the same + * generic data type is used for the single input and the output parameter. + * How can we create explicitly types functions when this is not the case? + * It does not seem to be covered by the standard. + * + * For this reason, we do not define the LEN_SINT, LEN_INT, LEN_STRING, LEN_[ANY_INT], LEN_[ANY_STRING] functions... + */ + + +/********************/ +/* EN/ENO PARAMS */ +/********************/ + +#define EN_ENO_PARAMS BOOL EN, BOOL *ENO + +#define TEST_EN(TYPENAME)\ + if (!EN) {\ + if (ENO != NULL)\ + *ENO = __BOOL_LITERAL(FALSE);\ + return __INIT_##TYPENAME;\ + }\ + else if (ENO != NULL)\ + *ENO = __BOOL_LITERAL(TRUE); + +#define TEST_EN_COND(TYPENAME, COND)\ + if (!EN || (COND)) {\ + if (ENO != NULL)\ + *ENO = __BOOL_LITERAL(FALSE);\ + return __INIT_##TYPENAME;\ + }\ + else if (ENO != NULL)\ + *ENO = __BOOL_LITERAL(TRUE); + + + +/*****************************************/ +/*****************************************/ +/* 2.5.1.5.1 Type Conversion Functions */ +/*****************************************/ +/*****************************************/ + +#define __convert_type(from_TYPENAME,to_TYPENAME, oper) \ +static inline to_TYPENAME from_TYPENAME##_TO_##to_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\ + TEST_EN(to_TYPENAME)\ + return (to_TYPENAME)oper(op);\ +} + + +#define __to_anynum_(from_TYPENAME) __ANY_NUM_1(__iec_,from_TYPENAME) +#define __to_anyint_(from_TYPENAME) __ANY_INT_1(__iec_,from_TYPENAME) +#define __to_anybit_(from_TYPENAME) __ANY_BIT_1(__iec_,from_TYPENAME) +#define __to_anynbit_(from_TYPENAME) __ANY_NBIT_1(__iec_,from_TYPENAME) +#define __to_anysint_(from_TYPENAME) __ANY_SINT_1(__iec_,from_TYPENAME) +#define __to_anyuint_(from_TYPENAME) __ANY_UINT_1(__iec_,from_TYPENAME) +#define __to_anyreal_(from_TYPENAME) __ANY_REAL_1(__iec_,from_TYPENAME) +#define __to_anydate_(from_TYPENAME) __ANY_DATE_1(__iec_,from_TYPENAME) + +/******** [ANY_BIT]_TO_[ANY_NUM | ANT_BIT] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __move_##to_TYPENAME) +__ANY_BIT(__to_anynum_) +__ANY_BIT(__to_anybit_) +#undef __iec_ + +/******** [ANY_INT]_TO_[ANY_NUM | ANT_BIT] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __move_##to_TYPENAME) +__ANY_INT(__to_anynum_) +__ANY_INT(__to_anybit_) +#undef __iec_ + +/******** [ANY_REAL]_TO_[ANY_BIT] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __real_to_bit) +__ANY_REAL(__to_anybit_) +#undef __iec_ + +/******** [ANY_REAL]_TO_[ANY_INT] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __real_to_sint) +__ANY_REAL(__to_anysint_) +#undef __iec_ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __real_to_uint) +__ANY_REAL(__to_anyuint_) +#undef __iec_ + +/******** [ANY_REAL]_TO_[ANY_REAL] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __move_##to_TYPENAME) +__ANY_REAL(__to_anyreal_) +#undef __iec_ + +/******** [ANY_BIT | ANY_INT]_TO_[TIME | ANY_DATE] ************/ +#define __iec_(from_TYPENAME) __convert_type(from_TYPENAME, TIME, __int_to_time) +__ANY_BIT(__iec_) +__ANY_INT(__iec_) +#undef __iec_ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __int_to_time) +__ANY_BIT(__to_anydate_) +__ANY_INT(__to_anydate_) +#undef __iec_ + +/******** [ANY_REAL]_TO_[TIME | ANY_DATE] ************/ +#define __iec_(from_TYPENAME) __convert_type(from_TYPENAME, TIME, __real_to_time) +__ANY_REAL(__iec_) +#undef __iec_ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __real_to_time) +__ANY_REAL(__to_anydate_) +#undef __iec_ + +/******** [TIME | ANY_DATE]_TO_[ANY_BIT | ANY_INT] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __time_to_int) +__to_anyint_(TIME) +__to_anybit_(TIME) +__ANY_DATE(__to_anyint_) +__ANY_DATE(__to_anybit_) +#undef __iec_ + +/******** [TIME | ANY_DATE]_TO_[ANY_REAL] ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) __convert_type(from_TYPENAME, to_TYPENAME, __time_to_real) +__to_anyreal_(TIME) +__ANY_DATE(__to_anyreal_) +#undef __iec_ + + +/******** [ANY_DATE]_TO_[ANY_DATE | TIME] ************/ +/* Not supported: DT_TO_TIME */ +__convert_type(DT, DATE, __date_and_time_to_date) +__convert_type(DT, DT, __move_DT) +__convert_type(DT, TOD, __date_and_time_to_time_of_day) +/* Not supported: DATE_TO_TIME */ +__convert_type(DATE, DATE, __move_DATE) +/* Not supported: DATE_TO_DT */ +/* Not supported: DATE_TO_TOD */ +/* Not supported: TOD_TO_TIME */ +/* Not supported: TOD_TO_DATE */ +/* Not supported: TOD_TO_DT */ +__convert_type(TOD, TOD, __move_TOD) + + +/******** TIME_TO_[ANY_DATE] ************/ +/* Not supported: TIME_TO_DATE */ +/* Not supported: TIME_TO_DT */ +/* Not supported: TIME_TO_TOD */ + +/******** TIME_TO_TIME ************/ +__convert_type(TIME, TIME, __move_TIME) + + +/******** [ANY_BIT]_TO_STRING ************/ +__convert_type(BOOL, STRING, __bool_to_string) +#define __iec_(from_TYPENAME) __convert_type(from_TYPENAME, STRING, __bit_to_string) +__ANY_NBIT(__iec_) +#undef __iec_ + +/******** [ANY_INT]_TO_STRING ************/ +#define __iec_(from_TYPENAME) __convert_type(from_TYPENAME, STRING, __sint_to_string) +__ANY_SINT(__iec_) +#undef __iec_ +#define __iec_(from_TYPENAME) __convert_type(from_TYPENAME, STRING, __uint_to_string) +__ANY_UINT(__iec_) +#undef __iec_ + +/******** [ANY_REAL]_TO_STRING ************/ +#define __iec_(from_TYPENAME) __convert_type(from_TYPENAME, STRING, __real_to_string) +__ANY_REAL(__iec_) +#undef __iec_ + +/******** [ANY_DATE]_TO_STRING ************/ +__convert_type(DATE, STRING, __date_to_string) +__convert_type(DT, STRING, __dt_to_string) +__convert_type(TOD, STRING, __tod_to_string) + +/******** TIME_TO_STRING ************/ +__convert_type(TIME, STRING, __time_to_string) + + +/******** STRING_TO_[ANY_BIT] ************/ +__convert_type(STRING, BOOL, __string_to_bool) +#define __iec_(to_TYPENAME) __convert_type(STRING, to_TYPENAME, __string_to_bit) +__ANY_NBIT(__iec_) +#undef __iec_ + +/******** STRING_TO_[ANY_INT] ************/ +#define __iec_(to_TYPENAME) __convert_type(STRING, to_TYPENAME, __string_to_sint) +__ANY_SINT(__iec_) +#undef __iec_ +#define __iec_(to_TYPENAME) __convert_type(STRING, to_TYPENAME, __string_to_uint) +__ANY_UINT(__iec_) +#undef __iec_ + +/******** STRING_TO_[ANY_REAL] ************/ +#define __iec_(to_TYPENAME) __convert_type(STRING, to_TYPENAME, __string_to_real) +__ANY_REAL(__iec_) +#undef __iec_ + +/******** STRING_TO_[ANY_DATE] ************/ +#define __iec_(to_TYPENAME) __convert_type(STRING, to_TYPENAME, __string_to_time) +__ANY_DATE(__iec_) +#undef __iec_ + +/******** STRING_TO_TIME ************/ +__convert_type(STRING, TIME, __string_to_time) + + +/******** TRUNC ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) \ +static inline to_TYPENAME TRUNC__##to_TYPENAME##__##from_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\ + TEST_EN(to_TYPENAME)\ + return (to_TYPENAME)__move_##to_TYPENAME(op);\ +} +__ANY_REAL(__to_anyint_) +#undef __iec_ + + +/******** _TO_BCD ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) \ +static inline to_TYPENAME from_TYPENAME##_TO_BCD_##to_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\ + TEST_EN(to_TYPENAME)\ + return (to_TYPENAME)__uint_to_bcd(op);\ +} +__ANY_UINT(__to_anynbit_) +#undef __iec_ + + +/******** BCD_TO_ ************/ +#define __iec_(to_TYPENAME,from_TYPENAME) \ +static inline to_TYPENAME from_TYPENAME##_BCD_TO_##to_TYPENAME(EN_ENO_PARAMS, from_TYPENAME op){\ + TEST_EN(to_TYPENAME)\ + return (to_TYPENAME)__bcd_to_uint(op);\ +} +__ANY_NBIT(__to_anyuint_) +#undef __iec_ + + +/***********************************/ +/***********************************/ +/* 2.5.1.5.2 Numerical Functions */ +/***********************************/ +/***********************************/ + /* workaround for va-args limitation on shorter than int params */ #define VA_ARGS_REAL LREAL #define VA_ARGS_LREAL LREAL @@ -841,11 +937,187 @@ #define VA_ARGS_TOD TOD #define VA_ARGS_DT DT -/*******************************************/ -/* Arithmetic and bitwise functions */ -/*******************************************/ + +#define __numeric(fname,TYPENAME, FUNC) \ +static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ + TEST_EN(TYPENAME)\ + return FUNC(op);\ +} + +/******************************************************************/ +/*** Table 23 - Standard functions of one numeric variable ***/ +/******************************************************************/ + + /**************/ + /* ABS */ + /**************/ +/* explicitly typed function */ +#define __iec_(TYPENAME) \ +static inline TYPENAME ABS_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ + TEST_EN(TYPENAME)\ + if (op < 0)\ + return -op;\ + return op;\ +} +__ANY_REAL(__iec_) +__ANY_SINT(__iec_) +#undef __iec_ + +#define __iec_(TYPENAME) \ +static inline TYPENAME ABS_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ + TEST_EN(TYPENAME)\ + return op;\ +} +__ANY_UINT(__iec_) +#undef __iec_ + +/* overloaded function */ +#define __iec_(TYPENAME) \ +static inline TYPENAME ABS__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ + TEST_EN(TYPENAME)\ + if (op < 0)\ + return -op;\ + return op;\ +} +__ANY_REAL(__iec_) +__ANY_SINT(__iec_) +#undef __iec_ + +#define __iec_(TYPENAME) \ +static inline TYPENAME ABS__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ + TEST_EN(TYPENAME)\ + return op;\ +} +__ANY_UINT(__iec_) +#undef __iec_ + + + /**************/ + /* SQRT */ + /**************/ +/* explicitly typed function */ +#define __iec_(TYPENAME) \ +__numeric(SQRT_, TYPENAME, sqrt) /* explicitly typed function */\ +__numeric(SQRT__##TYPENAME##__, TYPENAME, sqrt) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* LN */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(LN_, TYPENAME, log) /* explicitly typed function */\ +__numeric(LN__##TYPENAME##__, TYPENAME, log) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + + /**************/ + /* LOG */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(LOG_, TYPENAME, log10) /* explicitly typed function */\ +__numeric(LOG__##TYPENAME##__, TYPENAME, log10) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* EXP */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(EXP_, TYPENAME, exp) /* explicitly typed function */\ +__numeric(EXP__##TYPENAME##__, TYPENAME, exp) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + + /**************/ + /* SIN */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(SIN_, TYPENAME, sin) /* explicitly typed function */\ +__numeric(SIN__##TYPENAME##__, TYPENAME, sin) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + + /**************/ + /* COS */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(COS_, TYPENAME, cos) /* explicitly typed function */\ +__numeric(COS__##TYPENAME##__, TYPENAME, cos) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* TAN */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(TAN_, TYPENAME, tan) /* explicitly typed function */\ +__numeric(TAN__##TYPENAME##__, TYPENAME, tan) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + + /**************/ + /* ASIN */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(ASIN_, TYPENAME, asin) /* explicitly typed function */\ +__numeric(ASIN__##TYPENAME##__, TYPENAME, asin) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* ACOS */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(ACOS_, TYPENAME, acos) /* explicitly typed function */\ +__numeric(ACOS__##TYPENAME##__, TYPENAME, acos) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + /**************/ + /* ATAN */ + /**************/ +#define __iec_(TYPENAME) \ +__numeric(ATAN_, TYPENAME, atan) /* explicitly typed function */\ +__numeric(ATAN__##TYPENAME##__, TYPENAME, atan) /* overloaded function */ +__ANY_REAL(__iec_) +#undef __iec_ + + + +/*****************************************************/ +/*** Table 24 - Standard arithmetic functions ***/ +/*****************************************************/ +/* + Unfortunately, the following does not work!! + +#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) + #define __arith_expand(fname,TYPENAME, OP) \ -static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ +#define fname(EN, ENO, ...) fname__(EN, ENO, NUMARGS(__VA_ARGS__), __VA_ARGS__)\ +static inline TYPENAME fname__(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ + va_list ap;\ + UINT i;\ + TEST_EN(TYPENAME)\ + \ + va_start (ap, op1); \ + \ + for (i = 0; i < param_count - 1; i++){\ + op1 = op1 OP va_arg (ap, VA_ARGS_##TYPENAME);\ + }\ + \ + va_end (ap); \ + return op1;\ +} +*/ + + +#define __arith_expand(fname,TYPENAME, OP) \ +static inline TYPENAME fname(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ va_list ap;\ UINT i;\ TEST_EN(TYPENAME)\ @@ -861,292 +1133,353 @@ } #define __arith_static(fname,TYPENAME, OP) \ -static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\ +static inline TYPENAME fname(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\ TEST_EN(TYPENAME)\ return op1 OP op2;\ } -/**************/ -/* ADD */ -/**************/ -#define __add_(TYPENAME) __arith_expand(__add_, TYPENAME, + ) -ANY_NUM(__add_) - -/**************/ -/* MUL */ -/**************/ -#define __mul_(TYPENAME) __arith_expand(__mul_, TYPENAME, * ) -ANY_NUM(__mul_) - -/**************/ -/* SUB */ -/**************/ -#define __sub_(TYPENAME) __arith_static(__sub_, TYPENAME, - ) -ANY_NUM(__sub_) - -/**************/ -/* DIV */ -/**************/ -#define __div_(TYPENAME)\ -static inline TYPENAME __div_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\ + /**************/ + /* ADD */ + /**************/ +#define __iec_(TYPENAME) \ +__arith_expand(ADD_##TYPENAME, TYPENAME, +) /* explicitly typed function */\ +__arith_expand(ADD__##TYPENAME##__##TYPENAME, TYPENAME, +) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* MUL */ + /**************/ +#define __iec_(TYPENAME) \ +__arith_expand(MUL_##TYPENAME, TYPENAME, *) /* explicitly typed function */\ +__arith_expand(MUL__##TYPENAME##__##TYPENAME, TYPENAME, *) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* SUB */ + /**************/ +#define __iec_(TYPENAME) \ +__arith_expand(SUB_##TYPENAME, TYPENAME, -) /* explicitly typed function */\ +__arith_expand(SUB__##TYPENAME##__##TYPENAME##__##TYPENAME, TYPENAME, -) /* overloaded function */ +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* DIV */ + /**************/ +/* The explicitly typed standard functions */ +#define __iec_(TYPENAME)\ +static inline TYPENAME DIV_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\ TEST_EN_COND(TYPENAME, op2 == 0)\ return op1 / op2;\ } -ANY_NUM(__div_) - -/**************/ -/* MOD */ -/**************/ -#define __mod_(TYPENAME) __arith_static(__mod_, TYPENAME, % ) -ANY_INT(__mod_) - -/**************/ -/* AND */ -/**************/ -__arith_expand(__and_, BOOL, && ) -#define __and_(TYPENAME) __arith_expand(__and_, TYPENAME, & ) -ANY_NBIT(__and_) - -/*************/ -/* OR */ -/*************/ -__arith_expand(__or_, BOOL, || ) -#define __or_(TYPENAME) __arith_expand(__or_, TYPENAME, |) -ANY_NBIT(__or_) - -/**************/ -/* XOR */ -/**************/ -static inline BOOL __xor_BOOL(EN_ENO_PARAMS, UINT param_count, BOOL op1, ...){ - va_list ap; - UINT i; - TEST_EN(BOOL) - - va_start (ap, op1); /* Initialize the argument list. */ - - for (i = 0; i < param_count - 1; i++){ - BOOL tmp = va_arg (ap, VA_ARGS_BOOL); - op1 = (op1 && !tmp) || (!op1 && tmp); - } - - va_end (ap); /* Clean up. */ - return op1; -} -#define __xor_(TYPENAME) __arith_expand(__xor_, TYPENAME, ^) -ANY_NBIT(__xor_) - -/**************/ -/* NOT */ -/**************/ -static inline BOOL __not_BOOL(EN_ENO_PARAMS, BOOL op1){ +__ANY_NUM(__iec_) +#undef __iec_ + +/* The overloaded standard functions */ +#define __iec_(TYPENAME)\ +static inline TYPENAME DIV__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1, TYPENAME op2){\ + TEST_EN_COND(TYPENAME, op2 == 0)\ + return op1 / op2;\ +} +__ANY_NUM(__iec_) +#undef __iec_ + + /**************/ + /* MOD */ + /**************/ +/* The explicitly typed standard functions */ +#define __iec_(TYPENAME)\ +__arith_expand(MOD_##TYPENAME, TYPENAME, %) /* explicitly typed function */\ +__arith_expand(MOD__##TYPENAME##__##TYPENAME##__##TYPENAME, TYPENAME, %) /* overloaded function */ +__ANY_INT(__iec_) +#undef __iec_ + + /**************/ + /* EXPT */ + /**************/ +/* overloaded function */ +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +static inline in1_TYPENAME EXPT__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME\ + (EN_ENO_PARAMS, in1_TYPENAME IN1, in2_TYPENAME IN2){\ + TEST_EN(in1_TYPENAME)\ + return pow(IN1, IN2);\ +} +#define __in1_anyreal_(in2_TYPENAME) __ANY_REAL_1(__iec_,in2_TYPENAME) +__ANY_NUM(__in1_anyreal_) +#undef __iec_ + + + + /***************/ + /* MOVE */ + /***************/ +/* The explicitly typed standard functions */ +#define __iec_(TYPENAME)\ +static inline TYPENAME MOVE_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\ + TEST_EN(TYPENAME)\ + return op1;\ +} +__ANY(__iec_) +#undef __iec_ + +/* Overloaded function */ +#define __iec_(TYPENAME)\ +static inline TYPENAME MOVE__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\ + TEST_EN(TYPENAME)\ + return op1;\ +} +__ANY(__iec_) +#undef __iec_ + + + + + + +/***********************************/ +/***********************************/ +/* 2.5.1.5.3 Bit String Functions */ +/***********************************/ +/***********************************/ + +/****************************************************/ +/*** Table 25 - Standard bit shift functions ***/ +/****************************************************/ + +/* We do not delcare explcitly typed versions of the functions in table 25. + * See note above regarding explicitly typed functions for more details. + */ +#define __in1_anynbit_(in2_TYPENAME) __ANY_NBIT_1(__iec_,in2_TYPENAME) + +#define __shift_(fname, in1_TYPENAME, in2_TYPENAME, OP)\ +static inline in1_TYPENAME fname(EN_ENO_PARAMS, in1_TYPENAME IN, in2_TYPENAME N) {\ + TEST_EN(in1_TYPENAME)\ + return IN OP N;\ +} + + /**************/ + /* SHL */ + /**************/ +#define __iec_(TYPENAME) \ +/* Overloaded function */\ +static inline BOOL SHL__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \ + TEST_EN(BOOL);\ + return (N==0)? IN : __INIT_BOOL; /* shifting by N>1 will always introduce a 0 */\ +} +__ANY_INT(__iec_) +#undef __iec_ + + +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +__shift_(SHL__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME, in1_TYPENAME, in2_TYPENAME, << )/* Overloaded function */ +__ANY_INT(__in1_anynbit_) +#undef __iec_ + + + /**************/ + /* SHR */ + /**************/ +#define __iec_(TYPENAME) \ +/* Overloaded function */\ +static inline BOOL SHR__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \ + TEST_EN(BOOL);\ + return (N==0)? IN : __INIT_BOOL; /* shifting by N>1 will always introduce a 0 */\ +} +__ANY_INT(__iec_) +#undef __iec_ + + +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +__shift_(SHR__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME, in1_TYPENAME, in2_TYPENAME, >> )/* Overloaded function */ +__ANY_INT(__in1_anynbit_) +#undef __iec_ + + + /**************/ + /* ROR */ + /**************/ +#define __iec_(TYPENAME) \ +/* Overloaded function */\ +static inline BOOL ROR__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \ + TEST_EN(BOOL);\ + return IN; /* rotating a single bit by any value N will not change that bit! */\ +} +__ANY_INT(__iec_) +#undef __iec_ + + +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +static inline in1_TYPENAME ROR__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS, in1_TYPENAME IN, in2_TYPENAME N){\ + TEST_EN(in1_TYPENAME)\ + N %= 8*sizeof(in1_TYPENAME);\ + return (IN >> N) | (IN << (8*sizeof(in1_TYPENAME)-N));\ +} +__ANY_INT(__in1_anynbit_) +#undef __iec_ + + + /**************/ + /* ROL */ + /**************/ +#define __iec_(TYPENAME) \ +/* Overloaded function */\ +static inline BOOL ROL__BOOL__##TYPENAME(EN_ENO_PARAMS, BOOL IN, TYPENAME N) { \ + TEST_EN(BOOL);\ + return IN; /* rotating a single bit by any value N will not change that bit! */\ +} +__ANY_INT(__iec_) +#undef __iec_ + + +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +static inline in1_TYPENAME ROL__##in1_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS, in1_TYPENAME IN, in2_TYPENAME N){\ + TEST_EN(in1_TYPENAME)\ + N %= 8*sizeof(in1_TYPENAME);\ + return (IN << N) | (IN >> (8*sizeof(in1_TYPENAME)-N));\ +} +__ANY_INT(__in1_anynbit_) +#undef __iec_ + + + +/*********************/ +/*** Table 26 ***/ +/*********************/ + + /**************/ + /* AND */ + /**************/ +__arith_expand(AND_BOOL, BOOL, && ) /* The explicitly typed standard functions */ +__arith_expand(AND__BOOL__BOOL, BOOL, && ) /* Overloaded function */ + +#define __iec_(TYPENAME) \ +__arith_expand(AND_##TYPENAME, TYPENAME, &) /* The explicitly typed standard functions */\ +__arith_expand(AND__##TYPENAME##__##TYPENAME, TYPENAME, &) /* Overloaded function */ +__ANY_NBIT(__iec_) +#undef __iec_ + + /*************/ + /* OR */ + /*************/ +__arith_expand(OR_BOOL, BOOL, || ) /* The explicitly typed standard functions */ +__arith_expand(OR__BOOL__BOOL, BOOL, || ) /* Overloaded function */ + +#define __iec_(TYPENAME) \ +__arith_expand(OR_##TYPENAME, TYPENAME, |) /* The explicitly typed standard functions */\ +__arith_expand(OR__##TYPENAME##__##TYPENAME, TYPENAME, |) /* Overloaded function */ +__ANY_NBIT(__iec_) +#undef __iec_ + + /**************/ + /* XOR */ + /**************/ +#define __xorbool_expand(fname) \ +static inline BOOL fname(EN_ENO_PARAMS, UINT param_count, BOOL op1, ...){ \ + va_list ap; \ + UINT i; \ + TEST_EN(BOOL) \ +\ + va_start (ap, op1); /* Initialize the argument list. */ \ +\ + for (i = 0; i < param_count - 1; i++){ \ + BOOL tmp = va_arg (ap, VA_ARGS_BOOL); \ + op1 = (op1 && !tmp) || (!op1 && tmp); \ + } \ +\ + va_end (ap); /* Clean up. */ \ + return op1; \ +} + +__xorbool_expand(XOR_BOOL) /* The explicitly typed standard functions */ +__xorbool_expand(XOR__BOOL__BOOL) /* Overloaded function */ + +#define __iec_(TYPENAME) \ +__arith_expand(XOR_##TYPENAME, TYPENAME, ^) /* The explicitly typed standard functions */\ +__arith_expand(XOR__##TYPENAME##__##TYPENAME, TYPENAME, ^) /* Overloaded function */\ +__ANY_NBIT(__iec_) +#undef __iec_ + + + /**************/ + /* NOT */ + /**************/ +/* The explicitly typed standard functions */ +static inline BOOL NOT_BOOL(EN_ENO_PARAMS, BOOL op1){ TEST_EN(BOOL) return !op1; } -#define __not_(TYPENAME)\ -static inline TYPENAME __not_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\ +/* Overloaded function */ +static inline BOOL NOT__BOOL__BOOL(EN_ENO_PARAMS, BOOL op1){ + TEST_EN(BOOL) + return !op1; +} + +/* The explicitly typed standard functions */ +#define __iec_(TYPENAME)\ +static inline TYPENAME NOT_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\ TEST_EN(TYPENAME)\ return ~op1;\ } -ANY_NBIT(__not_) - -/***************/ -/* MOVE */ -/***************/ -#define __move_(TYPENAME)\ -static inline TYPENAME __move_##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\ +__ANY_NBIT(__iec_) +#undef __iec_ + +/* Overloaded function */ +#define __iec_(TYPENAME)\ +static inline TYPENAME NOT__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME op1){\ TEST_EN(TYPENAME)\ - return op1;\ -} -ANY(__move_) - -/**************/ -/* Binary ops */ -/**************/ -#define __shift_(fname, TYPENAME, OP)\ -static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, TYPENAME IN, USINT N) {\ - TEST_EN(TYPENAME)\ - return IN OP N;\ -} - -#define __shl_(TYPENAME) __shift_(__shl_, TYPENAME, << ) -/* Call previously defined macro for each ANY_NBIT */ -ANY_NBIT(__shl_) - -#define __shr_(TYPENAME) __shift_(__shr_, TYPENAME, >> ) -/* Call previously defined macro for each ANY_NBIT */ -ANY_NBIT(__shr_) - -#define __ror_(TYPENAME)\ -static inline TYPENAME __ror_##TYPENAME(EN_ENO_PARAMS, TYPENAME IN, USINT N){\ - TEST_EN(TYPENAME)\ - N %= 8*sizeof(TYPENAME);\ - return (IN >> N) | (IN << (8*sizeof(TYPENAME)-N));\ -} -/* Call previously defined macro for each ANY_NBIT */ -ANY_NBIT(__ror_) - -#define __rol_(TYPENAME)\ -static inline TYPENAME __rol_##TYPENAME(EN_ENO_PARAMS, TYPENAME IN, USINT N){\ - TEST_EN(TYPENAME)\ - N %= 8*sizeof(TYPENAME);\ - return (IN << N) | (IN >> (8*sizeof(TYPENAME)-N));\ -} -/* Call previously defined macro for each ANY_NBIT */ -ANY_NBIT(__rol_) - -/*******************************************/ -/* Arithmetic and bitwise functions */ -/*******************************************/ - -#define __numeric(fname,TYPENAME, FUNC) \ -static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ - TEST_EN(TYPENAME)\ - return FUNC(op);\ -} - - /**************/ - /* ABS */ - /**************/ -#define __abs_signed(TYPENAME) \ -static inline TYPENAME __abs_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ - TEST_EN(TYPENAME)\ - if (op < 0)\ - return -op;\ - return op;\ -} -ANY_REAL(__abs_signed) -ANY_SINT(__abs_signed) - -#define __abs_unsigned(TYPENAME) \ -static inline TYPENAME __abs_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ - TEST_EN(TYPENAME)\ - return op;\ -} -ANY_UINT(__abs_unsigned) - - /**************/ - /* SQRT */ - /**************/ -#define __sqrt_(TYPENAME) __numeric(__sqrt_, TYPENAME, sqrt) -ANY_REAL(__sqrt_) - - /**************/ - /* LN */ - /**************/ -#define __ln_(TYPENAME) __numeric(__ln_, TYPENAME, log) -ANY_REAL(__ln_) - - /**************/ - /* LOG */ - /**************/ -#define __log_(TYPENAME) __numeric(__log_, TYPENAME, log10) -ANY_REAL(__log_) - - /**************/ - /* EXP */ - /**************/ -#define __exp_(TYPENAME) __numeric(__exp_, TYPENAME, exp) -ANY_REAL(__exp_) - - /**************/ - /* SIN */ - /**************/ -#define __sin_(TYPENAME) __numeric(__sin_, TYPENAME, sin) -ANY_REAL(__sin_) - - /**************/ - /* COS */ - /**************/ -#define __cos_(TYPENAME) __numeric(__cos_, TYPENAME, cos) -ANY_REAL(__cos_) - - /**************/ - /* TAN */ - /**************/ -#define __tan_(TYPENAME) __numeric(__tan_, TYPENAME, tan) -ANY_REAL(__tan_) - - /**************/ - /* ASIN */ - /**************/ -#define __asin_(TYPENAME) __numeric(__asin_, TYPENAME, asin) -ANY_REAL(__asin_) - - /**************/ - /* ACOS */ - /**************/ -#define __acos_(TYPENAME) __numeric(__acos_, TYPENAME, acos) -ANY_REAL(__acos_) - - /**************/ - /* ATAN */ - /**************/ -#define __atan_(TYPENAME) __numeric(__atan_, TYPENAME, atan) -ANY_REAL(__atan_) - - /**************/ - /* EXPT */ - /**************/ -#define __expt_(TYPENAME)\ -static inline TYPENAME __expt_##TYPENAME(EN_ENO_PARAMS, TYPENAME IN1, LREAL IN2){\ - TEST_EN(TYPENAME)\ - return pow(IN1, IN2);\ -} -ANY_REAL(__expt_) - -/**************/ -/* Selection */ -/**************/ - - /**************/ - /* SEL */ - /**************/ - -#define __sel_(TYPENAME)\ -static inline TYPENAME __sel_##TYPENAME(EN_ENO_PARAMS, BOOL G, TYPENAME op0, TYPENAME op1){\ + return ~op1;\ +} +__ANY_NBIT(__iec_) +#undef __iec_ + + + + + + +/***************************************************/ +/***************************************************/ +/* 2.5.1.5.4 Selection and comparison Functions */ +/***************************************************/ +/***************************************************/ + +/*********************/ +/*** Table 27 ***/ +/*********************/ + + + /**************/ + /* SEL */ + /**************/ + +/* The explicitly typed standard functions */ +#define __iec_(TYPENAME)\ +static inline TYPENAME SEL_##TYPENAME(EN_ENO_PARAMS, BOOL G, TYPENAME op0, TYPENAME op1){\ TEST_EN(TYPENAME)\ return G ? op1 : op0;\ } -ANY(__sel_) - - /**************/ - /* limit */ - /**************/ - -#define __limit_(TYPENAME)\ -static inline TYPENAME __limit_##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\ +__ANY(__iec_) +#undef __iec_ + +/* Overloaded function */ +#define __iec_(TYPENAME)\ +static inline TYPENAME SEL__##TYPENAME##__BOOL__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, BOOL G, TYPENAME op0, TYPENAME op1){\ TEST_EN(TYPENAME)\ - return IN > MN ? IN < MX ? IN : MX : MN;\ -} - -/* Call previously defined macro for each concerned type */ -ANY_NBIT(__limit_) -ANY_NUM(__limit_) - -#define __limit_time(TYPENAME)\ -static inline TYPENAME __limit_##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\ - TEST_EN(TYPENAME)\ - return __TIME_CMP(IN, MN) > 0 ? /* IN>MN ?*/\ - __TIME_CMP(IN, MX) < 0 ? /* IN 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN; -} + return G ? op1 : op0;\ +} +__ANY(__iec_) +#undef __iec_ + /**************/ /* MAX */ /**************/ #define __extrem_(fname,TYPENAME, COND) \ -static inline TYPENAME fname##TYPENAME(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ +static inline TYPENAME fname(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ va_list ap;\ UINT i;\ TEST_EN(TYPENAME)\ @@ -1162,52 +1495,130 @@ return op1;\ } -#define __max_num(TYPENAME) __extrem_(__max_,TYPENAME, op1 < tmp) -ANY_NBIT(__max_num) -ANY_NUM(__max_num) - -__extrem_(__max_, STRING, __STR_CMP(op1,tmp) < 0) -#define __max_time(TYPENAME) __extrem_(__max_, TYPENAME, __TIME_CMP(op1, tmp) < 0) - -/* Call previously defined macro for each concerned type */ -ANY_DATE(__max_time) -__max_time(TIME) +/* Max for numerical data types */ +#define __iec_(TYPENAME) \ +__extrem_(MAX_##TYPENAME,TYPENAME, op1 < tmp) /* The explicitly typed standard functions */\ +__extrem_(MAX__##TYPENAME##__##TYPENAME,TYPENAME, op1 < tmp) /* Overloaded function */ +__ANY_BIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Max for time data types */ +#define __iec_(TYPENAME) \ +__extrem_(MAX_##TYPENAME, TYPENAME, __time_cmp(op1, tmp) < 0) /* The explicitly typed standard functions */\ +__extrem_(MAX__##TYPENAME##__##TYPENAME, TYPENAME, __time_cmp(op1, tmp) < 0) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Max for string data types */ +__extrem_(MAX_STRING, STRING, __STR_CMP(op1,tmp) < 0) /* The explicitly typed standard functions */ +__extrem_(MAX__STRING__STRING, STRING, __STR_CMP(op1,tmp) < 0) /* Overloaded function */ /**************/ /* MIN */ /**************/ -#define __min_num(TYPENAME) __extrem_(__min_, TYPENAME, op1 > tmp) -ANY_NBIT(__min_num) -ANY_NUM(__min_num) - -__extrem_(__min_, STRING, __STR_CMP(op1,tmp) > 0) - -#define __min_time(TYPENAME) __extrem_(__min_, TYPENAME, __TIME_CMP(op1, tmp) > 0) - -/* Call previously defined macro for each concerned type */ -ANY_DATE(__min_time) -__min_time(TIME) +/* Min for numerical data types */ +#define __iec_(TYPENAME) \ +__extrem_(MIN_##TYPENAME, TYPENAME, op1 > tmp) /* The explicitly typed standard functions */\ +__extrem_(MIN__##TYPENAME##__##TYPENAME, TYPENAME, op1 > tmp) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Min for time data types */ +#define __iec_(TYPENAME) \ +__extrem_(MIN_##TYPENAME, TYPENAME, __time_cmp(op1, tmp) > 0) /* The explicitly typed standard functions */\ +__extrem_(MIN__##TYPENAME##__##TYPENAME, TYPENAME, __time_cmp(op1, tmp) > 0) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Min for string data types */ +__extrem_(MIN_STRING, STRING, __STR_CMP(op1,tmp) > 0) /* The explicitly typed standard functions */ +__extrem_(MIN__STRING__STRING, STRING, __STR_CMP(op1,tmp) > 0) /* Overloaded function */ + + /**************/ + /* LIMIT */ + /**************/ + +/* Limit for numerical data types */ +#define __iec_(TYPENAME)\ +/* The explicitly typed standard functions */\ +static inline TYPENAME LIMIT_##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\ + TEST_EN(TYPENAME)\ + return IN > MN ? IN < MX ? IN : MX : MN;\ +}\ +/* Overloaded function */\ +static inline TYPENAME LIMIT__##TYPENAME##__##TYPENAME##__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\ + TEST_EN(TYPENAME)\ + return IN > MN ? IN < MX ? IN : MX : MN;\ +} +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + + +/* Limit for time data types */ +#define __iec_(TYPENAME)\ +/* The explicitly typed standard functions */\ +static inline TYPENAME LIMIT_##TYPENAME(EN_ENO_PARAMS, TYPENAME MN, TYPENAME IN, TYPENAME MX){\ + TEST_EN(TYPENAME)\ + return __time_cmp(IN, MN) > 0 ? /* IN>MN ?*/\ + __time_cmp(IN, MX) < 0 ? /* IN 0 ? /* IN>MN ?*/\ + __time_cmp(IN, MX) < 0 ? /* IN 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN; +} + +/* Overloaded function */ +static inline STRING LIMIT__STRING__STRING__STRING__STRING(EN_ENO_PARAMS, STRING MN, STRING IN, STRING MX){ + TEST_EN(STRING) + return __STR_CMP(IN, MN) > 0 ? __STR_CMP(IN, MX) < 0 ? IN : MX : MN; +} + /**************/ /* MUX */ /**************/ -#define __mux_(TYPENAME) \ -static inline TYPENAME __mux_##TYPENAME(EN_ENO_PARAMS, UINT param_count, UINT K, ...){\ +/* The standard states that the inputs for SEL and MUX must be named starting off from 0, + * unlike remaining functions, that start off at 1. + */ +/* The explicitly typed standard functions */ +#define __in1_anyint_(in2_TYPENAME) __ANY_INT_1(__iec_,in2_TYPENAME) +#define __iec_(in1_TYPENAME,in2_TYPENAME) \ +static inline in2_TYPENAME MUX__##in2_TYPENAME##__##in1_TYPENAME##__##in2_TYPENAME(EN_ENO_PARAMS, UINT param_count, in1_TYPENAME K, ...){\ va_list ap;\ UINT i;\ - TYPENAME tmp;\ - TEST_EN_COND(TYPENAME, K >= param_count)\ - tmp = __INIT_##TYPENAME;\ + in2_TYPENAME tmp;\ + TEST_EN_COND(in2_TYPENAME, K >= param_count)\ + tmp = __INIT_##in2_TYPENAME;\ \ va_start (ap, K); /* Initialize the argument list. */\ \ for (i = 0; i < param_count; i++){\ if(K == i){\ - tmp = va_arg (ap, VA_ARGS_##TYPENAME);\ + tmp = va_arg (ap, VA_ARGS_##in2_TYPENAME);\ va_end (ap); /* Clean up. */\ return tmp;\ }else{\ - va_arg (ap, VA_ARGS_##TYPENAME);\ + va_arg (ap, VA_ARGS_##in2_TYPENAME);\ }\ }\ \ @@ -1215,14 +1626,17 @@ return tmp;\ } -ANY(__mux_) - -/**************/ -/* Comparison */ -/**************/ +__ANY(__in1_anyint_) +#undef __iec_ + + +/******************************************/ +/*** Table 28 ***/ +/*** Standard comparison functions ***/ +/******************************************/ #define __compare_(fname,TYPENAME, COND) \ -static inline BOOL fname##TYPENAME(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ +static inline BOOL fname(EN_ENO_PARAMS, UINT param_count, TYPENAME op1, ...){\ va_list ap;\ UINT i;\ TEST_EN(BOOL)\ @@ -1247,91 +1661,537 @@ } #define __compare_num(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, op1 TEST tmp ) -#define __compare_time(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, __TIME_CMP(op1, tmp) TEST 0) +#define __compare_time(fname, TYPENAME, TEST) __compare_(fname, TYPENAME, __time_cmp(op1, tmp) TEST 0) #define __compare_string(fname, TEST) __compare_(fname, STRING, __STR_CMP(op1, tmp) TEST 0 ) /**************/ /* GT */ /**************/ - -#define __gt_num(TYPENAME) __compare_num(__gt_, TYPENAME, > ) -ANY_NBIT(__gt_num) -ANY_NUM(__gt_num) - -#define __gt_time(TYPENAME) __compare_time(__gt_, TYPENAME, > ) -ANY_DATE(__gt_time) -__gt_time(TIME) - -__compare_string(__gt_, > ) +/* Comparison for numerical data types */ +#define __iec_(TYPENAME) \ +__compare_num(GT_##TYPENAME, TYPENAME, > ) /* The explicitly typed standard functions */\ +__compare_num(GT__BOOL__##TYPENAME, TYPENAME, > ) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Comparison for time data types */ +#define __iec_(TYPENAME) \ +__compare_time(GT_##TYPENAME, TYPENAME, > ) /* The explicitly typed standard functions */\ +__compare_time(GT__BOOL__##TYPENAME, TYPENAME, > ) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Comparison for string data types */ +__compare_string(GT_STRING, > ) /* The explicitly typed standard functions */ +__compare_string(GT__BOOL__STRING, > ) /* Overloaded function */ /**************/ /* GE */ /**************/ - -#define __ge_num(TYPENAME) __compare_num(__ge_, TYPENAME, >= ) -ANY_BIT(__ge_num) -ANY_NUM(__ge_num) - -#define __ge_time(TYPENAME) __compare_time(__ge_, TYPENAME, >= ) -ANY_DATE(__ge_time) -__ge_time(TIME) - -__compare_string(__ge_, >=) +/* Comparison for numerical data types */ +#define __iec_(TYPENAME) \ +__compare_num(GE_##TYPENAME, TYPENAME, >= ) /* The explicitly typed standard functions */\ +__compare_num(GE__BOOL__##TYPENAME, TYPENAME, >= ) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Comparison for time data types */ +#define __iec_(TYPENAME) \ +__compare_time(GE_##TYPENAME, TYPENAME, >= ) /* The explicitly typed standard functions */\ +__compare_time(GE__BOOL__##TYPENAME, TYPENAME, >= ) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Comparison for string data types */ +__compare_string(GE_STRING, >= ) /* The explicitly typed standard functions */ +__compare_string(GE__BOOL__STRING, >= ) /* Overloaded function */ + + /**************/ /* EQ */ /**************/ - -#define __eq_num(TYPENAME) __compare_num(__eq_, TYPENAME, == ) -ANY_BIT(__eq_num) -ANY_NUM(__eq_num) - -#define __eq_time(TYPENAME) __compare_time(__eq_, TYPENAME, == ) -ANY_DATE(__eq_time) -__eq_time(TIME) - -__compare_string(__eq_, == ) +/* Comparison for numerical data types */ +#define __iec_(TYPENAME) \ +__compare_num(EQ_##TYPENAME, TYPENAME, == ) /* The explicitly typed standard functions */\ +__compare_num(EQ__BOOL__##TYPENAME, TYPENAME, == ) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Comparison for time data types */ +#define __iec_(TYPENAME) \ +__compare_time(EQ_##TYPENAME, TYPENAME, == ) /* The explicitly typed standard functions */\ +__compare_time(EQ__BOOL__##TYPENAME, TYPENAME, == ) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Comparison for string data types */ +__compare_string(EQ_STRING, == ) /* The explicitly typed standard functions */ +__compare_string(EQ__BOOL__STRING, == ) /* Overloaded function */ + /**************/ /* LT */ /**************/ - -#define __lt_num(TYPENAME) __compare_num(__lt_, TYPENAME, < ) -ANY_BIT(__lt_num) -ANY_NUM(__lt_num) - -#define __lt_time(TYPENAME) __compare_time(__lt_, TYPENAME, < ) -ANY_DATE(__lt_time) -__lt_time(TIME) - -__compare_string(__lt_, < ) +/* Comparison for numerical data types */ +#define __iec_(TYPENAME) \ +__compare_num(LT_##TYPENAME, TYPENAME, < ) /* The explicitly typed standard functions */\ +__compare_num(LT__BOOL__##TYPENAME, TYPENAME, < ) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Comparison for time data types */ +#define __iec_(TYPENAME) \ +__compare_time(LT_##TYPENAME, TYPENAME, < ) /* The explicitly typed standard functions */\ +__compare_time(LT__BOOL__##TYPENAME, TYPENAME, < ) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Comparison for string data types */ +__compare_string(LT_STRING, < ) /* The explicitly typed standard functions */ +__compare_string(LT__BOOL__STRING, < ) /* Overloaded function */ + /**************/ /* LE */ /**************/ - -#define __le_num(TYPENAME) __compare_num(__le_, TYPENAME, <= ) -ANY_BIT(__le_num) -ANY_NUM(__le_num) - -#define __le_time(TYPENAME) __compare_time(__le_, TYPENAME, <= ) -ANY_DATE(__le_time) -__le_time(TIME) - -__compare_string(__le_, <= ) +/* Comparison for numerical data types */ +#define __iec_(TYPENAME) \ +__compare_num(LE_##TYPENAME, TYPENAME, <= ) /* The explicitly typed standard functions */\ +__compare_num(LE__BOOL__##TYPENAME, TYPENAME, <= ) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Comparison for time data types */ +#define __iec_(TYPENAME) \ +__compare_time(LE_##TYPENAME, TYPENAME, <= ) /* The explicitly typed standard functions */\ +__compare_time(LE__BOOL__##TYPENAME, TYPENAME, <= ) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Comparison for string data types */ +__compare_string(LE_STRING, <= ) /* The explicitly typed standard functions */ +__compare_string(LE__BOOL__STRING, <= ) /* Overloaded function */ + /**************/ /* NE */ /**************/ - -#define __ne_num(TYPENAME) __compare_num(__ne_, TYPENAME, != ) -ANY_BIT(__ne_num) -ANY_NUM(__ne_num) - -#define __ne_time(TYPENAME) __compare_time(__ne_, TYPENAME, != ) -ANY_DATE(__ne_time) -__ne_time(TIME) - -__compare_string(__ne_, != ) - +/* Comparison for numerical data types */ +#define __iec_(TYPENAME) \ +__compare_num(NE_##TYPENAME, TYPENAME, != ) /* The explicitly typed standard functions */\ +__compare_num(NE__BOOL__##TYPENAME##__##TYPENAME, TYPENAME, != ) /* Overloaded function */ +__ANY_NBIT(__iec_) +__ANY_NUM(__iec_) +#undef __iec_ + +/* Comparison for time data types */ +#define __iec_(TYPENAME) \ +__compare_time(NE_##TYPENAME, TYPENAME, != ) /* The explicitly typed standard functions */\ +__compare_time(NE__BOOL__##TYPENAME##__##TYPENAME, TYPENAME, != ) /* Overloaded function */ +__ANY_DATE(__iec_) +__iec_(TIME) +#undef __iec_ + +/* Comparison for string data types */ +__compare_string(NE_STRING, != ) /* The explicitly typed standard functions */ +__compare_string(NE__BOOL__STRING__STRING, != ) /* Overloaded function */ + + + + + + +/*********************************************/ +/*********************************************/ +/* 2.5.1.5.5 Character string Functions */ +/*********************************************/ +/*********************************************/ + +/*************************************/ +/*** Table 29 ***/ +/*** Character string Functions ***/ +/*************************************/ + +/* We do not delcare explcitly typed versions of the functions in table 29. + * See note above regarding explicitly typed functions for more details. + */ + + +#define __STR_CMP(str1, str2) memcmp((char*)&str1.body,(char*)&str2.body, str1.len < str2.len ? str1.len : str2.len) + + + /***************/ + /* LEN */ + /***************/ +static inline __strlen_t __len(STRING IN) {return IN.len;} + +/* A function, with 1 input paramter, implementing a generic OPERATION */ +#define __genoper_1p_(fname,ret_TYPENAME, par_TYPENAME, OPERATION) \ +static inline ret_TYPENAME fname(EN_ENO_PARAMS, par_TYPENAME par1){\ + TEST_EN(ret_TYPENAME)\ + return (ret_TYPENAME)OPERATION(par1);\ +} + +#define __iec_(TYPENAME) __genoper_1p_(LEN__##TYPENAME##__STRING, TYPENAME, STRING, __len) +__ANY_INT(__iec_) +#undef __iec_ + + + /****************/ + /* LEFT */ + /****************/ + +static inline STRING __left(STRING IN, __strlen_t L){ + STRING res; + res = __INIT_STRING; + L = L < IN.len ? L : IN.len; + memcpy(&res.body, &IN.body, L); + res.len = L; + return res; +} + +#define __iec_(TYPENAME) \ +static inline STRING LEFT__STRING__STRING__##TYPENAME(EN_ENO_PARAMS, STRING str, TYPENAME L){\ + TEST_EN_COND(STRING, L < 0)\ + return (STRING)__left(str,L);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + + /*****************/ + /* RIGHT */ + /*****************/ + +static inline STRING __right(STRING IN, __strlen_t L){ + STRING res; + res = __INIT_STRING; + L = L < IN.len ? L : IN.len; + memcpy(&res.body, &IN.body[IN.len - L], L); + res.len = L; + return res; +} + + +#define __iec_(TYPENAME) \ +static inline STRING RIGHT__STRING__STRING__##TYPENAME(EN_ENO_PARAMS, STRING str, TYPENAME L){\ + TEST_EN_COND(STRING, L < 0)\ + return (STRING)__right(str,L);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + + /***************/ + /* MID */ + /***************/ + +static inline STRING __mid(STRING IN, __strlen_t L, __strlen_t P){ + STRING res; + res = __INIT_STRING; + if(P <= IN.len){ + P -= 1; /* now can be used as [index]*/ + L = L + P <= IN.len ? L : IN.len - P; + memcpy(&res.body, &IN.body[P] , L); + res.len = L; + } + return res; +} + +#define __iec_(TYPENAME) \ +static inline STRING MID__STRING__STRING__##TYPENAME##__##TYPENAME(EN_ENO_PARAMS, STRING str, TYPENAME L, TYPENAME P){\ + TEST_EN_COND(STRING, L < 0 || P < 0)\ + return (STRING)__mid(str,L,P);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + + /******************/ + /* CONCAT */ + /******************/ + +static inline STRING CONCAT__STRING__STRING(UINT param_count, ...){ + UINT i; + STRING res; + va_list ap; + __strlen_t charcount; + charcount = 0; + res = __INIT_STRING; + + va_start (ap, param_count); /* Initialize the argument list. */ + + for (i = 0; i < param_count && charcount < STR_MAX_LEN; i++) + { + STRING tmp = va_arg(ap, STRING); + __strlen_t charrem = STR_MAX_LEN - charcount; + __strlen_t to_write = tmp.len > charrem ? charrem : tmp.len; + memcpy(&res.body[charcount], &tmp.body , to_write); + charcount += to_write; + } + + res.len = charcount; + + va_end (ap); /* Clean up. */ + return res; +} + + /******************/ + /* INSERT */ + /******************/ + +static inline STRING __insert(STRING IN1, STRING IN2, __strlen_t P){ + STRING res; + __strlen_t to_copy; + res = __INIT_STRING; + + to_copy = P > IN1.len ? IN1.len : P; + memcpy(&res.body, &IN1.body , to_copy); + P = res.len = to_copy; + + to_copy = IN2.len + res.len > STR_MAX_LEN ? STR_MAX_LEN - res.len : IN2.len; + memcpy(&res.body[res.len], &IN2.body , to_copy); + res.len += to_copy; + + to_copy = IN1.len - P < STR_MAX_LEN - res.len ? IN1.len - P : STR_MAX_LEN - res.len ; + memcpy(&res.body[res.len], &IN1.body[P] , to_copy); + res.len += to_copy; + + return res; +} + +#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);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + + /******************/ + /* DELETE */ + /******************/ + +static inline STRING __delete(STRING IN, __strlen_t L, __strlen_t P){ + STRING res; + __strlen_t to_copy; + res = __INIT_STRING; + + to_copy = P > IN.len ? IN.len : P-1; + memcpy(&res.body, &IN.body , to_copy); + P = res.len = to_copy; + + if( IN.len > P + L ){ + to_copy = IN.len - P - L; + memcpy(&res.body[res.len], &IN.body[P + L], to_copy); + res.len += to_copy; + } + + return res; +} + +#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);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + + /*******************/ + /* REPLACE */ + /*******************/ + +static inline STRING __replace(STRING IN1, STRING IN2, __strlen_t L, __strlen_t P){ + STRING res; + __strlen_t to_copy; + res = __INIT_STRING; + + to_copy = P > IN1.len ? IN1.len : P-1; + memcpy(&res.body, &IN1.body , to_copy); + P = res.len = to_copy; + + to_copy = IN2.len < L ? IN2.len : L; + + if( to_copy + res.len > STR_MAX_LEN ) + to_copy = STR_MAX_LEN - res.len; + + memcpy(&res.body[res.len], &IN2.body , to_copy); + res.len += to_copy; + + P += L; + if( res.len < STR_MAX_LEN && P < IN1.len) + { + to_copy = IN1.len - P; + memcpy(&res.body[res.len], &IN1.body[P] , to_copy); + res.len += to_copy; + } + + return res; +} + +#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);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + /****************/ + /* FIND */ + /****************/ + +static inline __strlen_t __pfind(STRING* IN1, STRING* IN2){ + UINT count1 = 0; /* offset of first matching char in IN1 */ + UINT count2 = 0; /* count of matching char */ + while(count1 + count2 < IN1->len && count2 < IN2->len) + { + if(IN1->body[count1 + count2] != IN2->body[count2]){ + count1 += count2 + 1; + count2 = 0; + } + else { + count2++; + } + } + return count2 == IN2->len -1 ? 0 : count1 + 1; +} + +#define __iec_(TYPENAME) \ +static inline TYPENAME FIND__##TYPENAME##__STRING__STRING(EN_ENO_PARAMS, STRING str1, STRING str2){\ + TEST_EN(TYPENAME)\ + return (TYPENAME)__pfind(&str1,&str2);\ +} +__ANY_INT(__iec_) +#undef __iec_ + + +/*********************************************/ +/*********************************************/ +/* 2.5.1.5.6 Functions of time data types */ +/*********************************************/ +/*********************************************/ + +/**************************************/ +/*** Table 30 ***/ +/*** Functions of time data types ***/ +/**************************************/ + + +static inline TIME ADD_TIME(EN_ENO_PARAMS, TIME IN1, TIME IN2){ + TEST_EN(TIME) + return __time_add(IN1, IN2); +} + +static inline TOD ADD_TOD_TIME(EN_ENO_PARAMS, TOD IN1, TIME IN2){ + TEST_EN(TOD) + return __time_add(IN1, IN2); +} + +static inline DT ADD_DT_TIME(EN_ENO_PARAMS, DT IN1, TIME IN2){ + TEST_EN(DT) + return __time_add(IN1, IN2); +} + +static inline TIME SUB_TIME(EN_ENO_PARAMS, TIME IN1, TIME IN2){ + TEST_EN(TIME) + return __time_sub(IN1, IN2); +} + +static inline TIME SUB_DATE_DATE(EN_ENO_PARAMS, DATE IN1, DATE IN2){ + TEST_EN(TIME) + return __time_sub(IN1, IN2); +} + +static inline TOD SUB_TOD_TIME(EN_ENO_PARAMS, TOD IN1, TIME IN2){ + TEST_EN(TOD) + return __time_sub(IN1, IN2); +} + +static inline TIME SUB_TOD_TOD(EN_ENO_PARAMS, TOD IN1, TOD IN2){ + TEST_EN(TIME) + return __time_sub(IN1, IN2); +} + +static inline DT SUB_DT_TIME(EN_ENO_PARAMS, DT IN1, TIME IN2){ + TEST_EN(DT) + return __time_sub(IN1, IN2); +} + +static inline TIME SUB_DT_DT(EN_ENO_PARAMS, DT IN1, DT IN2){ + TEST_EN(TIME) + return __time_sub(IN1, IN2); +} + + +/*** MULTIME ***/ +#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);\ +} +__ANY_NUM(__iec_) +#undef __iec_ + +/*** MUL ***/ +#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);\ +} +__ANY_NUM(__iec_) +#undef __iec_ + +/*** DIVTIME ***/ +#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);\ +} +__ANY_NUM(__iec_) +#undef __iec_ + +/*** DIV ***/ +#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);\ +} +__ANY_NUM(__iec_) +#undef __iec_ + +/*** CONCAT_DATE_TOD ***/ +static inline DT CONCAT_DATE_TOD(EN_ENO_PARAMS, DATE IN1, TOD IN2){ + TEST_EN(DT) + return __time_add(IN1, IN2); +} + + + +/****************************************************/ +/****************************************************/ +/* 2.5.1.5.6 Functions of enumerated data types */ +/****************************************************/ +/****************************************************/ + +/********************************************/ +/*** Table 31 ***/ +/*** Functions of enumerated data types ***/ +/********************************************/ + +/* Do we support this? */ diff -r b826f13c260e -r 7a11f9e9e703 lib/iec_std_lib_generated.h --- a/lib/iec_std_lib_generated.h Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2007-2011: Edouard TISSERANT and Laurent BESSARD - * - * See COPYING and COPYING.LESSER files for copyright details. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library. If not, see . - * - */ - -/**** - * IEC 61131-3 standard function library - * generated code, do not edit by hand - */ - - - -/* Macro that expand to subtypes */ -#define ANY(DO) ANY_DERIVED(DO) ANY_ELEMENTARY(DO) -#define ANY_DERIVED(DO) -#define ANY_ELEMENTARY(DO) ANY_MAGNITUDE(DO) ANY_BIT(DO) ANY_STRING(DO) ANY_DATE(DO) -#define ANY_MAGNITUDE(DO) ANY_NUM(DO) DO(TIME) -#define ANY_BIT(DO) ANY_NBIT(DO) DO(BOOL) -#define ANY_NBIT(DO) DO(BYTE) DO(WORD) DO(DWORD) DO(LWORD) -#define ANY_STRING(DO) DO(STRING) -#define ANY_DATE(DO) DO(DATE) DO(TOD) DO(DT) -#define ANY_NUM(DO) ANY_REAL(DO) ANY_INT(DO) -#define ANY_REAL(DO) DO(REAL) DO(LREAL) -#define ANY_INT(DO) ANY_SINT(DO) ANY_UINT(DO) -#define ANY_SINT(DO) DO(SINT) DO(INT) DO(DINT) DO(LINT) -#define ANY_UINT(DO) DO(USINT) DO(UINT) DO(UDINT) DO(ULINT) diff -r b826f13c260e -r 7a11f9e9e703 lib/iec_types_all.h --- a/lib/iec_types_all.h Wed Sep 07 19:28:10 2011 +0200 +++ b/lib/iec_types_all.h Thu Sep 08 20:25:00 2011 +0200 @@ -1,7 +1,59 @@ +/* + * Copyright (C) 2007-2011: Edouard TISSERANT and Laurent BESSARD + * + * See COPYING and COPYING.LESSER files for copyright details. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + * + */ + #ifndef IEC_TYPES_ALL_H #define IEC_TYPES_ALL_H -#include "iec_std_lib_generated.h" + +/* Macro that expand to subtypes */ +#define __ANY(DO) __ANY_DERIVED(DO) __ANY_ELEMENTARY(DO) +#define __ANY_DERIVED(DO) +#define __ANY_ELEMENTARY(DO) __ANY_MAGNITUDE(DO) __ANY_BIT(DO) __ANY_STRING(DO) __ANY_DATE(DO) +#define __ANY_MAGNITUDE(DO) __ANY_NUM(DO) DO(TIME) +#define __ANY_BIT(DO) __ANY_NBIT(DO) DO(BOOL) +#define __ANY_NBIT(DO) DO(BYTE) DO(WORD) DO(DWORD) DO(LWORD) +#define __ANY_STRING(DO) DO(STRING) +#define __ANY_DATE(DO) DO(DATE) DO(TOD) DO(DT) +#define __ANY_NUM(DO) __ANY_REAL(DO) __ANY_INT(DO) +#define __ANY_REAL(DO) DO(REAL) DO(LREAL) +#define __ANY_INT(DO) __ANY_SINT(DO) __ANY_UINT(DO) +#define __ANY_SINT(DO) DO(SINT) DO(INT) DO(DINT) DO(LINT) +#define __ANY_UINT(DO) DO(USINT) DO(UINT) DO(UDINT) DO(ULINT) + + +/* Macro that expand to subtypes */ +#define __ANY_1(DO,P1) __ANY_DERIVED_1(DO,P1) __ANY_ELEMENTARY_1(DO,P1) +#define __ANY_DERIVED_1(DO,P1) +#define __ANY_ELEMENTARY_1(DO,P1) __ANY_MAGNITUDE_1(DO,P1) __ANY_BIT_1(DO,P1) __ANY_STRING_1(DO,P1) __ANY_DATE_1(DO,P1) +#define __ANY_MAGNITUDE_1(DO,P1) __ANY_NUM_1(DO,P1) DO(TIME,P1) +#define __ANY_BIT_1(DO,P1) __ANY_NBIT_1(DO,P1) DO(BOOL,P1) +#define __ANY_NBIT_1(DO,P1) DO(BYTE,P1) DO(WORD,P1) DO(DWORD,P1) DO(LWORD,P1) +#define __ANY_STRING_1(DO,P1) DO(STRING,P1) +#define __ANY_DATE_1(DO,P1) DO(DATE,P1) DO(TOD,P1) DO(DT,P1) +#define __ANY_NUM_1(DO,P1) __ANY_REAL_1(DO,P1) __ANY_INT_1(DO,P1) +#define __ANY_REAL_1(DO,P1) DO(REAL,P1) DO(LREAL,P1) +#define __ANY_INT_1(DO,P1) __ANY_SINT_1(DO,P1) __ANY_UINT_1(DO,P1) +#define __ANY_SINT_1(DO,P1) DO(SINT,P1) DO(INT,P1) DO(DINT,P1) DO(LINT,P1) +#define __ANY_UINT_1(DO,P1) DO(USINT,P1) DO(UINT,P1) DO(UDINT,P1) DO(ULINT,P1) + + /*********************/ /* IEC Types defs */ @@ -67,7 +119,7 @@ /* Those typdefs clash with windows.h */ /* i.e. this file cannot be included aside windows.h */ -ANY(__DECLARE_IEC_TYPE) +__ANY(__DECLARE_IEC_TYPE) typedef struct { __IEC_BOOL_t state; // current step state. 0 : inative, 1: active @@ -85,16 +137,16 @@ } ACTION; /* Extra debug types for SFC */ -#define ANY_SFC(DO) DO(STEP) DO(TRANSITION) DO(ACTION) +#define __ANY_SFC(DO) DO(STEP) DO(TRANSITION) DO(ACTION) /* Enumerate native types */ #define __decl_enum_type(TYPENAME) TYPENAME##_ENUM, #define __decl_enum_pointer(TYPENAME) TYPENAME##_P_ENUM, #define __decl_enum_output(TYPENAME) TYPENAME##_O_ENUM, typedef enum{ - ANY(__decl_enum_type) - ANY(__decl_enum_pointer) - ANY(__decl_enum_output) + __ANY(__decl_enum_type) + __ANY(__decl_enum_pointer) + __ANY(__decl_enum_output) /* SFC specific types are never external or global */ UNKNOWN_ENUM } __IEC_types_enum; @@ -107,7 +159,7 @@ return sizeof(TYPENAME); static inline USINT __get_type_enum_size(__IEC_types_enum t){ switch(t){ - ANY(__decl_size_case) + __ANY(__decl_size_case) /* size do not correspond to real struct. * only a bool is used to represent state*/ default: diff -r b826f13c260e -r 7a11f9e9e703 lib/ieclib.txt --- a/lib/ieclib.txt Wed Sep 07 19:28:10 2011 +0200 +++ b/lib/ieclib.txt Thu Sep 08 20:25:00 2011 +0200 @@ -21,12 +21,12 @@ * used in safety-critical situations without a full and competent review. *) -(* This is the library conatining the standard function blocks defined in the standard. *) +(* This is the library containing the standard function blocks defined in the standard. *) (* FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) *) (* The standard functions *) -(*{#include "standard_functions.txt" }*) +{#include "standard_functions.txt" } (* The standard function blocks *) {#include "edge_detection.txt" } @@ -39,6 +39,6 @@ {#include "pid_st.txt" } {#include "ramp_st.txt" } -(* From later versions of the standard *) +(* Not in the standard, but useful nonetheless. *) {#include "sema.txt" } diff -r b826f13c260e -r 7a11f9e9e703 lib/standard_functions.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/standard_functions.txt Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,1832 @@ +(************************************************) +(************************************************) +(*** ***) +(*** The IEC 61131-3 standard functions ***) +(*** ***) +(*** Auto-generated file. Do not edit! ***) +(*** ***) +(************************************************) +(************************************************) +{disable code generation} +FUNCTION BYTE_TO_REAL : REAL VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_LREAL : LREAL VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_SINT : SINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_INT : INT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_DINT : DINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_LINT : LINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_USINT : USINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_UINT : UINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_UDINT : UDINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_ULINT : ULINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_REAL : REAL VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_LREAL : LREAL VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_SINT : SINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_INT : INT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_DINT : DINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_LINT : LINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_USINT : USINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_UINT : UINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_UDINT : UDINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_ULINT : ULINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_REAL : REAL VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_LREAL : LREAL VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_SINT : SINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_INT : INT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_DINT : DINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_LINT : LINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_USINT : USINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_UINT : UINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_UDINT : UDINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_ULINT : ULINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_REAL : REAL VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_LREAL : LREAL VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_SINT : SINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_INT : INT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_DINT : DINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_LINT : LINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_USINT : USINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_UINT : UINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_UDINT : UDINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_ULINT : ULINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_REAL : REAL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_LREAL : LREAL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_SINT : SINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_INT : INT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_DINT : DINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_LINT : LINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_USINT : USINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_UINT : UINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_UDINT : UDINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_ULINT : ULINT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_BYTE : BYTE VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_WORD : WORD VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_DWORD : DWORD VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_LWORD : LWORD VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_BOOL : BOOL VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_BYTE : BYTE VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_WORD : WORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_DWORD : DWORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_LWORD : LWORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_BOOL : BOOL VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_BYTE : BYTE VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_WORD : WORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_DWORD : DWORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_LWORD : LWORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_BOOL : BOOL VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_BYTE : BYTE VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_WORD : WORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_DWORD : DWORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_LWORD : LWORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_BOOL : BOOL VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_BYTE : BYTE VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_WORD : WORD VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_DWORD : DWORD VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_LWORD : LWORD VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_BOOL : BOOL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION + + +FUNCTION REAL_TO_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_LREAL : LREAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_SINT : SINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_INT : INT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_DINT : DINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_LINT : LINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_USINT : USINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_UINT : UINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_UDINT : UDINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_ULINT : ULINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_REAL : REAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_SINT : SINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_INT : INT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_DINT : DINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_LINT : LINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_USINT : USINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_UINT : UINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_UDINT : UDINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_ULINT : ULINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_REAL : REAL VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_LREAL : LREAL VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_SINT : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_INT : INT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_DINT : DINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_LINT : LINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_USINT : USINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_UINT : UINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_UDINT : UDINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_ULINT : ULINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_REAL : REAL VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_LREAL : LREAL VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_SINT : SINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_INT : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_DINT : DINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_LINT : LINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_USINT : USINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_UINT : UINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_UDINT : UDINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_ULINT : ULINT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_REAL : REAL VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_LREAL : LREAL VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_SINT : SINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_INT : INT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_DINT : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_LINT : LINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_USINT : USINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_UINT : UINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_UDINT : UDINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_ULINT : ULINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_REAL : REAL VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_LREAL : LREAL VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_SINT : SINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_INT : INT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_DINT : DINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_LINT : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_USINT : USINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_UINT : UINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_UDINT : UDINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_ULINT : ULINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_REAL : REAL VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_LREAL : LREAL VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_SINT : SINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_INT : INT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_DINT : DINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_LINT : LINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_USINT : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_UINT : UINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_UDINT : UDINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_ULINT : ULINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_REAL : REAL VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_LREAL : LREAL VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_SINT : SINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_INT : INT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_DINT : DINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_LINT : LINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_USINT : USINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_UINT : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_UDINT : UDINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_ULINT : ULINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_REAL : REAL VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_LREAL : LREAL VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_SINT : SINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_INT : INT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_DINT : DINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_LINT : LINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_USINT : USINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_UINT : UINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_UDINT : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_ULINT : ULINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_REAL : REAL VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_LREAL : LREAL VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_SINT : SINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_INT : INT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_DINT : DINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_LINT : LINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_USINT : USINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_UINT : UINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_UDINT : UDINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_ULINT : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_BYTE : BYTE VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_WORD : WORD VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_DWORD : DWORD VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_LWORD : LWORD VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_BOOL : BOOL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_BYTE : BYTE VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_WORD : WORD VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_DWORD : DWORD VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_LWORD : LWORD VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_BOOL : BOOL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_BYTE : BYTE VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_WORD : WORD VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_DWORD : DWORD VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_LWORD : LWORD VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_BOOL : BOOL VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_BYTE : BYTE VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_WORD : WORD VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_DWORD : DWORD VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_LWORD : LWORD VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_BOOL : BOOL VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_BYTE : BYTE VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_WORD : WORD VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_DWORD : DWORD VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_LWORD : LWORD VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_BOOL : BOOL VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_BYTE : BYTE VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_WORD : WORD VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_DWORD : DWORD VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_LWORD : LWORD VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_BOOL : BOOL VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_BYTE : BYTE VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_WORD : WORD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_DWORD : DWORD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_LWORD : LWORD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_BOOL : BOOL VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_BYTE : BYTE VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_WORD : WORD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_DWORD : DWORD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_LWORD : LWORD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_BOOL : BOOL VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_BYTE : BYTE VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_WORD : WORD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_DWORD : DWORD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_LWORD : LWORD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_BOOL : BOOL VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_BYTE : BYTE VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_WORD : WORD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_DWORD : DWORD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_LWORD : LWORD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_BOOL : BOOL VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION + + + +FUNCTION BYTE_TO_TIME : TIME VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_TIME : TIME VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_TIME : TIME VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_TIME : TIME VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_TIME : TIME VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_TIME : TIME VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_TIME : TIME VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_TIME : TIME VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_TIME : TIME VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_TIME : TIME VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_TIME : TIME VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_TIME : TIME VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_TIME : TIME VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_TIME : TIME VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_TIME : TIME VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_DATE : DATE VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_TOD : TOD VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_TO_DT : DT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_DATE : DATE VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_TOD : TOD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_DT : DT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_DATE : DATE VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_TOD : TOD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_DT : DT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_DATE : DATE VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_TOD : TOD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_DT : DT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_DATE : DATE VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_TOD : TOD VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_DT : DT VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_DATE : DATE VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_TOD : TOD VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION REAL_TO_DT : DT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_DATE : DATE VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_TOD : TOD VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_DT : DT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_DATE : DATE VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_TOD : TOD VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_DT : DT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_DATE : DATE VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_TOD : TOD VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_DT : DT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_DATE : DATE VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_TOD : TOD VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_DT : DT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_DATE : DATE VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_TOD : TOD VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_DT : DT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_DATE : DATE VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_TOD : TOD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_DT : DT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_DATE : DATE VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_TOD : TOD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_DT : DT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_DATE : DATE VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_TOD : TOD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_DT : DT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_DATE : DATE VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_TOD : TOD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_DT : DT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION + + + +FUNCTION TIME_TO_REAL : REAL VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_LREAL : LREAL VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_SINT : SINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_INT : INT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_DINT : DINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_LINT : LINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_USINT : USINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_UINT : UINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_UDINT : UDINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_ULINT : ULINT VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_BYTE : BYTE VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_WORD : WORD VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_DWORD : DWORD VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_LWORD : LWORD VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_BOOL : BOOL VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_REAL : REAL VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_LREAL : LREAL VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_SINT : SINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_INT : INT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_DINT : DINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_LINT : LINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_USINT : USINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_UINT : UINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_UDINT : UDINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_ULINT : ULINT VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_REAL : REAL VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_LREAL : LREAL VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_SINT : SINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_INT : INT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_DINT : DINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_LINT : LINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_USINT : USINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_UINT : UINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_UDINT : UDINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_ULINT : ULINT VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_REAL : REAL VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_LREAL : LREAL VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_SINT : SINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_INT : INT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_DINT : DINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_LINT : LINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_USINT : USINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_UINT : UINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_UDINT : UDINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_ULINT : ULINT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_BYTE : BYTE VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_WORD : WORD VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_DWORD : DWORD VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_LWORD : LWORD VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION DATE_TO_BOOL : BOOL VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_BYTE : BYTE VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_WORD : WORD VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_DWORD : DWORD VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_LWORD : LWORD VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_BOOL : BOOL VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_BYTE : BYTE VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_WORD : WORD VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_DWORD : DWORD VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_LWORD : LWORD VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_BOOL : BOOL VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION + + + + + +FUNCTION DT_TO_DATE : DATE VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_DT : DT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_TOD : TOD VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION + +FUNCTION DATE_TO_DATE : DATE VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION + + + + + +FUNCTION TOD_TO_TOD : TOD VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION TIME_TO_TIME : TIME VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION + + + +FUNCTION BYTE_TO_STRING : STRING VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_TO_STRING : STRING VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_TO_STRING : STRING VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_TO_STRING : STRING VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION BOOL_TO_STRING : STRING VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION + + + +FUNCTION REAL_TO_STRING : STRING VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LREAL_TO_STRING : STRING VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SINT_TO_STRING : STRING VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION INT_TO_STRING : STRING VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DINT_TO_STRING : STRING VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LINT_TO_STRING : STRING VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_STRING : STRING VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_STRING : STRING VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_STRING : STRING VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_STRING : STRING VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION + + +FUNCTION DATE_TO_STRING : STRING VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION TOD_TO_STRING : STRING VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION DT_TO_STRING : STRING VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION + + + +FUNCTION TIME_TO_STRING : STRING VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION + + + +FUNCTION STRING_TO_BYTE : BYTE VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_WORD : WORD VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_DWORD : DWORD VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_LWORD : LWORD VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_BOOL : BOOL VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION + + + +FUNCTION STRING_TO_REAL : REAL VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_LREAL : LREAL VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_SINT : SINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_INT : INT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_DINT : DINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_LINT : LINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_USINT : USINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_UINT : UINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_UDINT : UDINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_ULINT : ULINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION + + + +FUNCTION STRING_TO_DATE : DATE VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_TOD : TOD VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION STRING_TO_DT : DT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION + + + +FUNCTION STRING_TO_TIME : TIME VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : SINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : INT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : DINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : LINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : USINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : UINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : UDINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : ULINT VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : SINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : INT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : DINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : LINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : USINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : UINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : UDINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TRUNC : ULINT VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION + + + + + + + +FUNCTION USINT_TO_BCD_BYTE : BYTE VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_BCD_WORD : WORD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_BCD_DWORD : DWORD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION USINT_TO_BCD_LWORD : LWORD VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_BCD_BYTE : BYTE VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_BCD_WORD : WORD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_BCD_DWORD : DWORD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UINT_TO_BCD_LWORD : LWORD VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_BCD_BYTE : BYTE VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_BCD_WORD : WORD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_BCD_DWORD : DWORD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION UDINT_TO_BCD_LWORD : LWORD VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_BCD_BYTE : BYTE VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_BCD_WORD : WORD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_BCD_DWORD : DWORD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ULINT_TO_BCD_LWORD : LWORD VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + + +FUNCTION BYTE_BCD_TO_USINT : USINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_BCD_TO_UINT : UINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_BCD_TO_UDINT : UDINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION BYTE_BCD_TO_ULINT : ULINT VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_BCD_TO_USINT : USINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_BCD_TO_UINT : UINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_BCD_TO_UDINT : UDINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION WORD_BCD_TO_ULINT : ULINT VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_BCD_TO_USINT : USINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_BCD_TO_UINT : UINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_BCD_TO_UDINT : UDINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION DWORD_BCD_TO_ULINT : ULINT VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_BCD_TO_USINT : USINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_BCD_TO_UINT : UINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_BCD_TO_UDINT : UDINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LWORD_BCD_TO_ULINT : ULINT VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_SINT : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_INT : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_DINT : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_LINT : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_USINT : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_UINT : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_UDINT : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS_ULINT : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ABS : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SQRT_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SQRT : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SQRT_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SQRT : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LN_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LN : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LN_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LN : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LOG_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LOG : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LOG_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LOG : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXP_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXP : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXP_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXP : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SIN_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SIN : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SIN_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SIN : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION COS_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION COS : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION COS_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION COS : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TAN_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TAN : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION TAN_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION TAN : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ASIN_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ASIN : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ASIN_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ASIN : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ACOS_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ACOS : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ACOS_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ACOS : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ATAN_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ATAN : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ATAN_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ATAN : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_REAL : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_LREAL : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_SINT : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_INT : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_DINT : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_LINT : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_USINT : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_UINT : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_UDINT : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_ULINT : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ADD : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION MUL_REAL : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_LREAL : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_SINT : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_INT : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_DINT : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_LINT : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_USINT : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_UINT : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_UDINT : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL_ULINT : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION SUB_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_SINT : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_INT : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_DINT : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_LINT : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_USINT : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_UINT : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_UDINT : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_ULINT : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SUB : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_REAL : REAL VAR_INPUT IN1 : REAL; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : REAL VAR_INPUT IN1 : REAL; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_LREAL : LREAL VAR_INPUT IN1 : LREAL; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : LREAL VAR_INPUT IN1 : LREAL; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_SINT : SINT VAR_INPUT IN1 : SINT; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : SINT VAR_INPUT IN1 : SINT; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_INT : INT VAR_INPUT IN1 : INT; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : INT VAR_INPUT IN1 : INT; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_DINT : DINT VAR_INPUT IN1 : DINT; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : DINT VAR_INPUT IN1 : DINT; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_LINT : LINT VAR_INPUT IN1 : LINT; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : LINT VAR_INPUT IN1 : LINT; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_USINT : USINT VAR_INPUT IN1 : USINT; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : USINT VAR_INPUT IN1 : USINT; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_UINT : UINT VAR_INPUT IN1 : UINT; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : UINT VAR_INPUT IN1 : UINT; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_UDINT : UDINT VAR_INPUT IN1 : UDINT; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : UDINT VAR_INPUT IN1 : UDINT; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV_ULINT : ULINT VAR_INPUT IN1 : ULINT; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : ULINT VAR_INPUT IN1 : ULINT; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_SINT : SINT VAR_INPUT IN1 : SINT; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : SINT VAR_INPUT IN1 : SINT; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_INT : INT VAR_INPUT IN1 : INT; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : INT VAR_INPUT IN1 : INT; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_DINT : DINT VAR_INPUT IN1 : DINT; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : DINT VAR_INPUT IN1 : DINT; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_LINT : LINT VAR_INPUT IN1 : LINT; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : LINT VAR_INPUT IN1 : LINT; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_USINT : USINT VAR_INPUT IN1 : USINT; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : USINT VAR_INPUT IN1 : USINT; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_UINT : UINT VAR_INPUT IN1 : UINT; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : UINT VAR_INPUT IN1 : UINT; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_UDINT : UDINT VAR_INPUT IN1 : UDINT; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : UDINT VAR_INPUT IN1 : UDINT; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD_ULINT : ULINT VAR_INPUT IN1 : ULINT; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOD : ULINT VAR_INPUT IN1 : ULINT; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : REAL VAR_INPUT IN1 : REAL; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION EXPT : LREAL VAR_INPUT IN1 : LREAL; IN2 : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + + +FUNCTION MOVE_REAL : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : REAL VAR_INPUT IN : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_LREAL : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : LREAL VAR_INPUT IN : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_SINT : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : SINT VAR_INPUT IN : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_INT : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : INT VAR_INPUT IN : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_DINT : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : DINT VAR_INPUT IN : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_LINT : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : LINT VAR_INPUT IN : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_USINT : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : USINT VAR_INPUT IN : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_UINT : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : UINT VAR_INPUT IN : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_UDINT : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : UDINT VAR_INPUT IN : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_ULINT : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : ULINT VAR_INPUT IN : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_TIME : TIME VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : TIME VAR_INPUT IN : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_BYTE : BYTE VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : BYTE VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_WORD : WORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : WORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_DWORD : DWORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : DWORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_LWORD : LWORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : LWORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_BOOL : BOOL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : BOOL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_STRING : STRING VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : STRING VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_DATE : DATE VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : DATE VAR_INPUT IN : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_TOD : TOD VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : TOD VAR_INPUT IN : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE_DT : DT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MOVE : DT VAR_INPUT IN : DT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BYTE VAR_INPUT IN : BYTE; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : WORD VAR_INPUT IN : WORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : DWORD VAR_INPUT IN : DWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : LWORD VAR_INPUT IN : LWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHL : BOOL VAR_INPUT IN : BOOL; N : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BYTE VAR_INPUT IN : BYTE; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : WORD VAR_INPUT IN : WORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : DWORD VAR_INPUT IN : DWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : LWORD VAR_INPUT IN : LWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SHR : BOOL VAR_INPUT IN : BOOL; N : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BYTE VAR_INPUT IN : BYTE; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : WORD VAR_INPUT IN : WORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : DWORD VAR_INPUT IN : DWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : LWORD VAR_INPUT IN : LWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROR : BOOL VAR_INPUT IN : BOOL; N : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : INT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BYTE VAR_INPUT IN : BYTE; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : WORD VAR_INPUT IN : WORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : DWORD VAR_INPUT IN : DWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : LWORD VAR_INPUT IN : LWORD; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION ROL : BOOL VAR_INPUT IN : BOOL; N : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION AND : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION AND_BYTE : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION AND : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION AND_WORD : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION AND : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION AND_DWORD : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION AND : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION AND_LWORD : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION AND : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION AND_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION OR : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION OR_BYTE : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION OR : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION OR_WORD : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION OR : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION OR_DWORD : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION OR : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION OR_LWORD : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION OR : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION OR_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION XOR : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION XOR_BYTE : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION XOR : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION XOR_WORD : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION XOR : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION XOR_DWORD : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION XOR : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION XOR_LWORD : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION XOR : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION XOR_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION NOT : BYTE VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION NOT_BYTE : BYTE VAR_INPUT IN : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION NOT : WORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION NOT_WORD : WORD VAR_INPUT IN : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION NOT : DWORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NOT_DWORD : DWORD VAR_INPUT IN : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NOT : LWORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NOT_LWORD : LWORD VAR_INPUT IN : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NOT : BOOL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION NOT_BOOL : BOOL VAR_INPUT IN : BOOL; END_VAR RETURN; END_FUNCTION + +FUNCTION SEL : REAL VAR_INPUT G : BOOL; IN0 : REAL; IN1 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_REAL : REAL VAR_INPUT G : BOOL; IN0 : REAL; IN1 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : LREAL VAR_INPUT G : BOOL; IN0 : LREAL; IN1 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_LREAL : LREAL VAR_INPUT G : BOOL; IN0 : LREAL; IN1 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : SINT VAR_INPUT G : BOOL; IN0 : SINT; IN1 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_SINT : SINT VAR_INPUT G : BOOL; IN0 : SINT; IN1 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : INT VAR_INPUT G : BOOL; IN0 : INT; IN1 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_INT : INT VAR_INPUT G : BOOL; IN0 : INT; IN1 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : DINT VAR_INPUT G : BOOL; IN0 : DINT; IN1 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_DINT : DINT VAR_INPUT G : BOOL; IN0 : DINT; IN1 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : LINT VAR_INPUT G : BOOL; IN0 : LINT; IN1 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_LINT : LINT VAR_INPUT G : BOOL; IN0 : LINT; IN1 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : USINT VAR_INPUT G : BOOL; IN0 : USINT; IN1 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_USINT : USINT VAR_INPUT G : BOOL; IN0 : USINT; IN1 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : UINT VAR_INPUT G : BOOL; IN0 : UINT; IN1 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_UINT : UINT VAR_INPUT G : BOOL; IN0 : UINT; IN1 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : UDINT VAR_INPUT G : BOOL; IN0 : UDINT; IN1 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_UDINT : UDINT VAR_INPUT G : BOOL; IN0 : UDINT; IN1 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : ULINT VAR_INPUT G : BOOL; IN0 : ULINT; IN1 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_ULINT : ULINT VAR_INPUT G : BOOL; IN0 : ULINT; IN1 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : TIME VAR_INPUT G : BOOL; IN0 : TIME; IN1 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_TIME : TIME VAR_INPUT G : BOOL; IN0 : TIME; IN1 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : BYTE VAR_INPUT G : BOOL; IN0 : BYTE; IN1 : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_BYTE : BYTE VAR_INPUT G : BOOL; IN0 : BYTE; IN1 : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : WORD VAR_INPUT G : BOOL; IN0 : WORD; IN1 : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_WORD : WORD VAR_INPUT G : BOOL; IN0 : WORD; IN1 : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : DWORD VAR_INPUT G : BOOL; IN0 : DWORD; IN1 : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_DWORD : DWORD VAR_INPUT G : BOOL; IN0 : DWORD; IN1 : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : LWORD VAR_INPUT G : BOOL; IN0 : LWORD; IN1 : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_LWORD : LWORD VAR_INPUT G : BOOL; IN0 : LWORD; IN1 : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : BOOL VAR_INPUT G : BOOL; IN0 : BOOL; IN1 : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_BOOL : BOOL VAR_INPUT G : BOOL; IN0 : BOOL; IN1 : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : STRING VAR_INPUT G : BOOL; IN0 : STRING; IN1 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_STRING : STRING VAR_INPUT G : BOOL; IN0 : STRING; IN1 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : DATE VAR_INPUT G : BOOL; IN0 : DATE; IN1 : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_DATE : DATE VAR_INPUT G : BOOL; IN0 : DATE; IN1 : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : TOD VAR_INPUT G : BOOL; IN0 : TOD; IN1 : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_TOD : TOD VAR_INPUT G : BOOL; IN0 : TOD; IN1 : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION SEL : DT VAR_INPUT G : BOOL; IN0 : DT; IN1 : DT; END_VAR RETURN; END_FUNCTION +FUNCTION SEL_DT : DT VAR_INPUT G : BOOL; IN0 : DT; IN1 : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_REAL : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_LREAL : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_SINT : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_INT : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_DINT : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_LINT : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_USINT : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_UINT : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_UDINT : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_ULINT : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : TIME VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_TIME : TIME VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_BYTE : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_WORD : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_DWORD : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_LWORD : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : STRING VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_STRING : STRING VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : DATE VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_DATE : DATE VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : TOD VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_TOD : TOD VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MAX : DT VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MAX_DT : DT VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_REAL : REAL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_LREAL : LREAL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_SINT : SINT VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_INT : INT VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_DINT : DINT VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_LINT : LINT VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_USINT : USINT VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_UINT : UINT VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_UDINT : UDINT VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_ULINT : ULINT VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : TIME VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_TIME : TIME VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_BYTE : BYTE VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_WORD : WORD VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_DWORD : DWORD VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_LWORD : LWORD VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : STRING VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_STRING : STRING VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : DATE VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_DATE : DATE VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : TOD VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_TOD : TOD VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MIN : DT VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MIN_DT : DT VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : REAL VAR_INPUT MN : REAL; IN : REAL; MX : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_REAL : REAL VAR_INPUT MN : REAL; IN : REAL; MX : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : LREAL VAR_INPUT MN : LREAL; IN : LREAL; MX : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_LREAL : LREAL VAR_INPUT MN : LREAL; IN : LREAL; MX : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : SINT VAR_INPUT MN : SINT; IN : SINT; MX : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_SINT : SINT VAR_INPUT MN : SINT; IN : SINT; MX : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : INT VAR_INPUT MN : INT; IN : INT; MX : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_INT : INT VAR_INPUT MN : INT; IN : INT; MX : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : DINT VAR_INPUT MN : DINT; IN : DINT; MX : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_DINT : DINT VAR_INPUT MN : DINT; IN : DINT; MX : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : LINT VAR_INPUT MN : LINT; IN : LINT; MX : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_LINT : LINT VAR_INPUT MN : LINT; IN : LINT; MX : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : USINT VAR_INPUT MN : USINT; IN : USINT; MX : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_USINT : USINT VAR_INPUT MN : USINT; IN : USINT; MX : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : UINT VAR_INPUT MN : UINT; IN : UINT; MX : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_UINT : UINT VAR_INPUT MN : UINT; IN : UINT; MX : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : UDINT VAR_INPUT MN : UDINT; IN : UDINT; MX : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_UDINT : UDINT VAR_INPUT MN : UDINT; IN : UDINT; MX : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : ULINT VAR_INPUT MN : ULINT; IN : ULINT; MX : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_ULINT : ULINT VAR_INPUT MN : ULINT; IN : ULINT; MX : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : TIME VAR_INPUT MN : TIME; IN : TIME; MX : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_TIME : TIME VAR_INPUT MN : TIME; IN : TIME; MX : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : BYTE VAR_INPUT MN : BYTE; IN : BYTE; MX : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_BYTE : BYTE VAR_INPUT MN : BYTE; IN : BYTE; MX : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : WORD VAR_INPUT MN : WORD; IN : WORD; MX : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_WORD : WORD VAR_INPUT MN : WORD; IN : WORD; MX : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : DWORD VAR_INPUT MN : DWORD; IN : DWORD; MX : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_DWORD : DWORD VAR_INPUT MN : DWORD; IN : DWORD; MX : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : LWORD VAR_INPUT MN : LWORD; IN : LWORD; MX : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_LWORD : LWORD VAR_INPUT MN : LWORD; IN : LWORD; MX : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : BOOL VAR_INPUT MN : BOOL; IN : BOOL; MX : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_BOOL : BOOL VAR_INPUT MN : BOOL; IN : BOOL; MX : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : STRING VAR_INPUT MN : STRING; IN : STRING; MX : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_STRING : STRING VAR_INPUT MN : STRING; IN : STRING; MX : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : DATE VAR_INPUT MN : DATE; IN : DATE; MX : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_DATE : DATE VAR_INPUT MN : DATE; IN : DATE; MX : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : TOD VAR_INPUT MN : TOD; IN : TOD; MX : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_TOD : TOD VAR_INPUT MN : TOD; IN : TOD; MX : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT : DT VAR_INPUT MN : DT; IN : DT; MX : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LIMIT_DT : DT VAR_INPUT MN : DT; IN : DT; MX : DT; END_VAR RETURN; END_FUNCTION + +FUNCTION MUX : REAL VAR_INPUT K : SINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_REAL : REAL VAR_INPUT K : SINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : INT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_REAL : REAL VAR_INPUT K : INT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : DINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_REAL : REAL VAR_INPUT K : DINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : LINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_REAL : REAL VAR_INPUT K : LINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : USINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_REAL : REAL VAR_INPUT K : USINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : UINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_REAL : REAL VAR_INPUT K : UINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : UDINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_REAL : REAL VAR_INPUT K : UDINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : REAL VAR_INPUT K : ULINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_REAL : REAL VAR_INPUT K : ULINT; IN 0 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : SINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_LREAL : LREAL VAR_INPUT K : SINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : INT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_LREAL : LREAL VAR_INPUT K : INT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : DINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_LREAL : LREAL VAR_INPUT K : DINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : LINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_LREAL : LREAL VAR_INPUT K : LINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : USINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_LREAL : LREAL VAR_INPUT K : USINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : UINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_LREAL : LREAL VAR_INPUT K : UINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : UDINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_LREAL : LREAL VAR_INPUT K : UDINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LREAL VAR_INPUT K : ULINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_LREAL : LREAL VAR_INPUT K : ULINT; IN 0 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : SINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_SINT : SINT VAR_INPUT K : SINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : INT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_SINT : SINT VAR_INPUT K : INT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : DINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_SINT : SINT VAR_INPUT K : DINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : LINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_SINT : SINT VAR_INPUT K : LINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : USINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_SINT : SINT VAR_INPUT K : USINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : UINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_SINT : SINT VAR_INPUT K : UINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : UDINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_SINT : SINT VAR_INPUT K : UDINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : SINT VAR_INPUT K : ULINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_SINT : SINT VAR_INPUT K : ULINT; IN 0 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : SINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_INT : INT VAR_INPUT K : SINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : INT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_INT : INT VAR_INPUT K : INT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : DINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_INT : INT VAR_INPUT K : DINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : LINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_INT : INT VAR_INPUT K : LINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : USINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_INT : INT VAR_INPUT K : USINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : UINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_INT : INT VAR_INPUT K : UINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : UDINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_INT : INT VAR_INPUT K : UDINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : INT VAR_INPUT K : ULINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_INT : INT VAR_INPUT K : ULINT; IN 0 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : SINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_DINT : DINT VAR_INPUT K : SINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : INT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_DINT : DINT VAR_INPUT K : INT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : DINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_DINT : DINT VAR_INPUT K : DINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : LINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_DINT : DINT VAR_INPUT K : LINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : USINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_DINT : DINT VAR_INPUT K : USINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : UINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_DINT : DINT VAR_INPUT K : UINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : UDINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_DINT : DINT VAR_INPUT K : UDINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DINT VAR_INPUT K : ULINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_DINT : DINT VAR_INPUT K : ULINT; IN 0 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : SINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_LINT : LINT VAR_INPUT K : SINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : INT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_LINT : LINT VAR_INPUT K : INT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : DINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_LINT : LINT VAR_INPUT K : DINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : LINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_LINT : LINT VAR_INPUT K : LINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : USINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_LINT : LINT VAR_INPUT K : USINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : UINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_LINT : LINT VAR_INPUT K : UINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : UDINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_LINT : LINT VAR_INPUT K : UDINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LINT VAR_INPUT K : ULINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_LINT : LINT VAR_INPUT K : ULINT; IN 0 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : SINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_USINT : USINT VAR_INPUT K : SINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : INT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_USINT : USINT VAR_INPUT K : INT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : DINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_USINT : USINT VAR_INPUT K : DINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : LINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_USINT : USINT VAR_INPUT K : LINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : USINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_USINT : USINT VAR_INPUT K : USINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : UINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_USINT : USINT VAR_INPUT K : UINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : UDINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_USINT : USINT VAR_INPUT K : UDINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : USINT VAR_INPUT K : ULINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_USINT : USINT VAR_INPUT K : ULINT; IN 0 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : SINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_UINT : UINT VAR_INPUT K : SINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : INT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_UINT : UINT VAR_INPUT K : INT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : DINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_UINT : UINT VAR_INPUT K : DINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : LINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_UINT : UINT VAR_INPUT K : LINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : USINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_UINT : UINT VAR_INPUT K : USINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : UINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_UINT : UINT VAR_INPUT K : UINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : UDINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_UINT : UINT VAR_INPUT K : UDINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UINT VAR_INPUT K : ULINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_UINT : UINT VAR_INPUT K : ULINT; IN 0 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : SINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_UDINT : UDINT VAR_INPUT K : SINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : INT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_UDINT : UDINT VAR_INPUT K : INT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : DINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_UDINT : UDINT VAR_INPUT K : DINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : LINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_UDINT : UDINT VAR_INPUT K : LINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : USINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_UDINT : UDINT VAR_INPUT K : USINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : UINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_UDINT : UDINT VAR_INPUT K : UINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : UDINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_UDINT : UDINT VAR_INPUT K : UDINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : UDINT VAR_INPUT K : ULINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_UDINT : UDINT VAR_INPUT K : ULINT; IN 0 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : SINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_ULINT : ULINT VAR_INPUT K : SINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : INT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_ULINT : ULINT VAR_INPUT K : INT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : DINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_ULINT : ULINT VAR_INPUT K : DINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : LINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_ULINT : ULINT VAR_INPUT K : LINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : USINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_ULINT : ULINT VAR_INPUT K : USINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : UINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_ULINT : ULINT VAR_INPUT K : UINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : UDINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_ULINT : ULINT VAR_INPUT K : UDINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : ULINT VAR_INPUT K : ULINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_ULINT : ULINT VAR_INPUT K : ULINT; IN 0 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : SINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_TIME : TIME VAR_INPUT K : SINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : INT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_TIME : TIME VAR_INPUT K : INT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : DINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_TIME : TIME VAR_INPUT K : DINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : LINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_TIME : TIME VAR_INPUT K : LINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : USINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_TIME : TIME VAR_INPUT K : USINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : UINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_TIME : TIME VAR_INPUT K : UINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : UDINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_TIME : TIME VAR_INPUT K : UDINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TIME VAR_INPUT K : ULINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_TIME : TIME VAR_INPUT K : ULINT; IN 0 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : SINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_BYTE : BYTE VAR_INPUT K : SINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : INT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_BYTE : BYTE VAR_INPUT K : INT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : DINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_BYTE : BYTE VAR_INPUT K : DINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : LINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_BYTE : BYTE VAR_INPUT K : LINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : USINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_BYTE : BYTE VAR_INPUT K : USINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : UINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_BYTE : BYTE VAR_INPUT K : UINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : UDINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_BYTE : BYTE VAR_INPUT K : UDINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BYTE VAR_INPUT K : ULINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_BYTE : BYTE VAR_INPUT K : ULINT; IN 0 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : SINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_WORD : WORD VAR_INPUT K : SINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : INT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_WORD : WORD VAR_INPUT K : INT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : DINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_WORD : WORD VAR_INPUT K : DINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : LINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_WORD : WORD VAR_INPUT K : LINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : USINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_WORD : WORD VAR_INPUT K : USINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : UINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_WORD : WORD VAR_INPUT K : UINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : UDINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_WORD : WORD VAR_INPUT K : UDINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : WORD VAR_INPUT K : ULINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_WORD : WORD VAR_INPUT K : ULINT; IN 0 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : SINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_DWORD : DWORD VAR_INPUT K : SINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : INT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_DWORD : DWORD VAR_INPUT K : INT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : DINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_DWORD : DWORD VAR_INPUT K : DINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : LINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_DWORD : DWORD VAR_INPUT K : LINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : USINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_DWORD : DWORD VAR_INPUT K : USINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : UINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_DWORD : DWORD VAR_INPUT K : UINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : UDINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_DWORD : DWORD VAR_INPUT K : UDINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DWORD VAR_INPUT K : ULINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_DWORD : DWORD VAR_INPUT K : ULINT; IN 0 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : SINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_LWORD : LWORD VAR_INPUT K : SINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : INT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_LWORD : LWORD VAR_INPUT K : INT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : DINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_LWORD : LWORD VAR_INPUT K : DINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : LINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_LWORD : LWORD VAR_INPUT K : LINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : USINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_LWORD : LWORD VAR_INPUT K : USINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : UINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_LWORD : LWORD VAR_INPUT K : UINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : UDINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_LWORD : LWORD VAR_INPUT K : UDINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : LWORD VAR_INPUT K : ULINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_LWORD : LWORD VAR_INPUT K : ULINT; IN 0 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : SINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_BOOL : BOOL VAR_INPUT K : SINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : INT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_BOOL : BOOL VAR_INPUT K : INT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : DINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_BOOL : BOOL VAR_INPUT K : DINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : LINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_BOOL : BOOL VAR_INPUT K : LINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : USINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_BOOL : BOOL VAR_INPUT K : USINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : UINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_BOOL : BOOL VAR_INPUT K : UINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : UDINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_BOOL : BOOL VAR_INPUT K : UDINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : BOOL VAR_INPUT K : ULINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_BOOL : BOOL VAR_INPUT K : ULINT; IN 0 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : SINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_STRING : STRING VAR_INPUT K : SINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : INT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_STRING : STRING VAR_INPUT K : INT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : DINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_STRING : STRING VAR_INPUT K : DINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : LINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_STRING : STRING VAR_INPUT K : LINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : USINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_STRING : STRING VAR_INPUT K : USINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : UINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_STRING : STRING VAR_INPUT K : UINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : UDINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_STRING : STRING VAR_INPUT K : UDINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : STRING VAR_INPUT K : ULINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_STRING : STRING VAR_INPUT K : ULINT; IN 0 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : SINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_DATE : DATE VAR_INPUT K : SINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : INT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_DATE : DATE VAR_INPUT K : INT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : DINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_DATE : DATE VAR_INPUT K : DINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : LINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_DATE : DATE VAR_INPUT K : LINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : USINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_DATE : DATE VAR_INPUT K : USINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : UINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_DATE : DATE VAR_INPUT K : UINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : UDINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_DATE : DATE VAR_INPUT K : UDINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DATE VAR_INPUT K : ULINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_DATE : DATE VAR_INPUT K : ULINT; IN 0 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : SINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_TOD : TOD VAR_INPUT K : SINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : INT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_TOD : TOD VAR_INPUT K : INT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : DINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_TOD : TOD VAR_INPUT K : DINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : LINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_TOD : TOD VAR_INPUT K : LINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : USINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_TOD : TOD VAR_INPUT K : USINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : UINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_TOD : TOD VAR_INPUT K : UINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : UDINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_TOD : TOD VAR_INPUT K : UDINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : TOD VAR_INPUT K : ULINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_TOD : TOD VAR_INPUT K : ULINT; IN 0 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : SINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_SINT_DT : DT VAR_INPUT K : SINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : INT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_INT_DT : DT VAR_INPUT K : INT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : DINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_DINT_DT : DT VAR_INPUT K : DINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : LINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_LINT_DT : DT VAR_INPUT K : LINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : USINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_USINT_DT : DT VAR_INPUT K : USINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : UINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UINT_DT : DT VAR_INPUT K : UINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : UDINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_UDINT_DT : DT VAR_INPUT K : UDINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX : DT VAR_INPUT K : ULINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION MUX_ULINT_DT : DT VAR_INPUT K : ULINT; IN 0 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION GT_REAL : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION GT_LREAL : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_SINT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_INT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_DINT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_LINT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_USINT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_UINT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_UDINT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_ULINT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION GT_TIME : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION GT_BYTE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION GT_WORD : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GT_DWORD : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GT_LWORD : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION GT_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION GT_STRING : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION GT_DATE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION GT_TOD : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION GT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION GT_DT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION GE_REAL : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION GE_LREAL : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_SINT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_INT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_DINT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_LINT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_USINT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_UINT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_UDINT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_ULINT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION GE_TIME : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION GE_BYTE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION GE_WORD : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GE_DWORD : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GE_LWORD : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION GE_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION GE_STRING : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION GE_DATE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION GE_TOD : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION GE : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION GE_DT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_REAL : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_LREAL : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_SINT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_INT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_DINT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_LINT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_USINT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_UINT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_UDINT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_ULINT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_TIME : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_BYTE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_WORD : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_DWORD : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_LWORD : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_STRING : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_DATE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_TOD : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION EQ : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION EQ_DT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LT_REAL : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LT_LREAL : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_SINT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_INT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_DINT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_LINT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_USINT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_UINT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_UDINT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_ULINT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION LT_TIME : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION LT_BYTE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION LT_WORD : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LT_DWORD : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LT_LWORD : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION LT_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LT_STRING : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION LT_DATE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION LT_TOD : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION LT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LT_DT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LE_REAL : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LE_LREAL : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_SINT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_INT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_DINT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_LINT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_USINT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_UINT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_UDINT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_ULINT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION LE_TIME : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION LE_BYTE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION LE_WORD : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LE_DWORD : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LE_LWORD : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION LE_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LE_STRING : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION LE_DATE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION LE_TOD : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION LE : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LE_DT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION NE_REAL : BOOL VAR_INPUT IN 1 .. : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION NE_LREAL : BOOL VAR_INPUT IN 1 .. : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_SINT : BOOL VAR_INPUT IN 1 .. : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_INT : BOOL VAR_INPUT IN 1 .. : INT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_DINT : BOOL VAR_INPUT IN 1 .. : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_LINT : BOOL VAR_INPUT IN 1 .. : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_USINT : BOOL VAR_INPUT IN 1 .. : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_UINT : BOOL VAR_INPUT IN 1 .. : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_UDINT : BOOL VAR_INPUT IN 1 .. : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_ULINT : BOOL VAR_INPUT IN 1 .. : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION NE_TIME : BOOL VAR_INPUT IN 1 .. : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION NE_BYTE : BOOL VAR_INPUT IN 1 .. : BYTE; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION NE_WORD : BOOL VAR_INPUT IN 1 .. : WORD; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NE_DWORD : BOOL VAR_INPUT IN 1 .. : DWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NE_LWORD : BOOL VAR_INPUT IN 1 .. : LWORD; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION NE_BOOL : BOOL VAR_INPUT IN 1 .. : BOOL; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION NE_STRING : BOOL VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION NE_DATE : BOOL VAR_INPUT IN 1 .. : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION NE_TOD : BOOL VAR_INPUT IN 1 .. : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION NE : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION NE_DT : BOOL VAR_INPUT IN 1 .. : DT; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : SINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : INT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : DINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : LINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : USINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : UINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : UDINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEN : ULINT VAR_INPUT IN : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : INT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION LEFT : STRING VAR_INPUT IN : STRING; L : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : INT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION RIGHT : STRING VAR_INPUT IN : STRING; L : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : SINT; P : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : INT; P : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : DINT; P : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : LINT; P : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : USINT; P : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : UINT; P : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : UDINT; P : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MID : STRING VAR_INPUT IN : STRING; L : ULINT; P : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION CONCAT : STRING VAR_INPUT IN 1 .. : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : INT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION INSERT : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; P : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : SINT; P : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : INT; P : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : DINT; P : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : LINT; P : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : USINT; P : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : UINT; P : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : UDINT; P : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION DELETE : STRING VAR_INPUT IN : STRING; L : ULINT; P : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : SINT; P : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : INT; P : INT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : DINT; P : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : LINT; P : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : USINT; P : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : UINT; P : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : UDINT; P : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION REPLACE : STRING VAR_INPUT IN1 : STRING; IN2 : STRING; L : ULINT; P : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : SINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : INT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : DINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : LINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : USINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : UINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : UDINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION FIND : ULINT VAR_INPUT IN1 : STRING; IN2 : STRING; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_TIME : TIME VAR_INPUT IN1 : TIME; IN2 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_TOD_TIME : TOD VAR_INPUT IN1 : TOD; IN2 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION ADD_DT_TIME : DT VAR_INPUT IN1 : DT; IN2 : TIME; END_VAR RETURN; END_FUNCTION + +FUNCTION SUB_TIME : TIME VAR_INPUT IN1 : TIME; IN2 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_DATE_DATE : TIME VAR_INPUT IN1 : DATE; IN2 : DATE; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_TOD_TIME : TOD VAR_INPUT IN1 : TOD; IN2 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_TOD_TOD : TIME VAR_INPUT IN1 : TOD; IN2 : TOD; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_DT_TIME : DT VAR_INPUT IN1 : DT; IN2 : TIME; END_VAR RETURN; END_FUNCTION +FUNCTION SUB_DT_DT : TIME VAR_INPUT IN1 : DT; IN2 : DT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION MULTIME_REAL : TIME VAR_INPUT IN1 : TIME; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_LREAL : TIME VAR_INPUT IN1 : TIME; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_SINT : TIME VAR_INPUT IN1 : TIME; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_INT : TIME VAR_INPUT IN1 : TIME; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_DINT : TIME VAR_INPUT IN1 : TIME; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_LINT : TIME VAR_INPUT IN1 : TIME; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_USINT : TIME VAR_INPUT IN1 : TIME; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_UINT : TIME VAR_INPUT IN1 : TIME; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_UDINT : TIME VAR_INPUT IN1 : TIME; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME_ULINT : TIME VAR_INPUT IN1 : TIME; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MULTIME : TIME VAR_INPUT IN1 : TIME; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION MUL : TIME VAR_INPUT IN1 : TIME; IN2 : ULINT; END_VAR RETURN; END_FUNCTION + + + + + + +FUNCTION DIVTIME_REAL : TIME VAR_INPUT IN1 : TIME; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_LREAL : TIME VAR_INPUT IN1 : TIME; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_SINT : TIME VAR_INPUT IN1 : TIME; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_INT : TIME VAR_INPUT IN1 : TIME; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_DINT : TIME VAR_INPUT IN1 : TIME; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_LINT : TIME VAR_INPUT IN1 : TIME; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_USINT : TIME VAR_INPUT IN1 : TIME; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_UINT : TIME VAR_INPUT IN1 : TIME; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_UDINT : TIME VAR_INPUT IN1 : TIME; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME_ULINT : TIME VAR_INPUT IN1 : TIME; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIVTIME : TIME VAR_INPUT IN1 : TIME; IN2 : ULINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : REAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : LREAL; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : SINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : INT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : DINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : LINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : USINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : UINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : UDINT; END_VAR RETURN; END_FUNCTION +FUNCTION DIV : TIME VAR_INPUT IN1 : TIME; IN2 : ULINT; END_VAR RETURN; END_FUNCTION + + + + +FUNCTION CONCAT_DATE_TOD : DT VAR_INPUT IN1 : DATE; IN2 : TOD; END_VAR RETURN; END_FUNCTION +{enable code generation} + diff -r b826f13c260e -r 7a11f9e9e703 main.cc --- a/main.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/main.cc Thu Sep 08 20:25:00 2011 +0200 @@ -75,16 +75,22 @@ /* A macro for printing out internal parser errors... */ #include // required for std::cerr -#define ERROR error_exit(__FILE__,__LINE__) + +#ifndef HGVERSION +#define HGVERSION "" +#endif + +#define ERROR error_exit(__FILE__,__LINE__) void error_exit(const char *file_name, int line_no) { - std::cerr << "\nInternal program error in file " << file_name - << " at line " << line_no << "\n\n\n"; + std::cerr << "\nInternal compiler error in file " << file_name + << " at line " << line_no << "\n"; +// if (msg != NULL) std::cerr << message << "\n\n"; exit(EXIT_FAILURE); } - +#include "config/config.h" #include "stage1_2/stage1_2.hh" #include "absyntax_utils/absyntax_utils.hh" @@ -93,9 +99,10 @@ static void printusage(const char *cmd) { - printf("syntax: %s [-h] [-f] [-s] [-I ] [-T ] \n", cmd); + printf("syntax: %s [-h] [-v] [-f] [-s] [-I ] [-T ] \n", cmd); printf(" h : show this help message\n"); - printf(" f : full token location on error messages\n"); + printf(" v : print version number\n"); + printf(" f : display full token location on error messages\n"); /******************************************************/ /* whether we are suporting safe extensions */ /* as defined in PLCopen - Technical Committee 5 */ @@ -107,7 +114,7 @@ printf("\n"); printf("%s - Copyright (C) 2003-2011 \n" "This program comes with ABSOLUTELY NO WARRANTY!\n" - "This is free software licensed under GPL v3, and you are welcome to redistribute it under the conditions specified by this license.\n", cmd); + "This is free software licensed under GPL v3, and you are welcome to redistribute it under the conditions specified by this license.\n", PACKAGE_NAME); } @@ -125,12 +132,15 @@ /******************************************/ /* Parse command line options... */ /******************************************/ - while ((optres = getopt(argc, argv, ":hfsI:T:")) != -1) { + while ((optres = getopt(argc, argv, ":hvfsI:T:")) != -1) { switch(optres) { case 'h': printusage(argv[0]); return 0; - break; + case 'v': + fprintf(stdout, "%s version %s\n" + "changeset id: %s\n", PACKAGE_NAME, PACKAGE_VERSION, HGVERSION); + return 0; case 'f': stage1_2_options.full_token_loc = true; break; @@ -169,6 +179,7 @@ } if (errflg) { + printf("\n"); printusage(argv[0]); return EXIT_FAILURE; } diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/Makefile --- a/stage1_2/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +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 . - -# include the system specific Makefile -include ../Makefile.$(shell uname) - - - -default: all - -all: iec.flex.o iec.y.o stage1_2.o - -clean: - echo > Makefile.depend - -rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output - -rm -f iec.noerrorcheck.y - -rm -f test_flex - -rm -f stage1_2.o - -rm -f iec.y.o - -rm -f iec.flex.o - -rm -f Makefile.depend - - -CFLAGS += -I. -I../* -I../../absyntax - -iec.flex.c: iec.flex - flex -oiec.flex.c iec.flex - -stage1_2.cc: iec.y.hh -stage1_2.o: stage1_2.cc - -iec.flex.o: iec.y.hh iec.flex.c - $(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS) - -iec.y.hh iec.y.cc: iec.y - bison -d -v -o iec.y.cc iec.y - -iec.y.o: iec.y.cc iec.y.hh - $(CXX) -c iec.y.cc $(CFLAGS) - -noerrorcheck: iec.y - sed '/ERROR_CHECK_BEGIN/,/ERROR_CHECK_END/ d' iec.y > iec.noerrorcheck.y - flex -oiec.flex.c iec.flex - $(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS) - bison -d -v -o iec.y.cc iec.noerrorcheck.y - $(CXX) -c iec.y.cc $(CFLAGS) - -#how to make things from other directories if they are missing -../% /%: - $(MAKE) -C $(@D) $(@F) - - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend - - diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage1_2/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,22 @@ +include ../common.mk + +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 \ + stage1_2.cc + +libstage1_2_a_CPPFLAGS = -DDEFAULT_LIBDIR='"lib"' -I../../absyntax + diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage1_2/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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__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-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) $(LFLAGS) $(AM_LFLAGS) +YLWRAP = $(top_srcdir)/config/ylwrap +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_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 \ + 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; + +$(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|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ + cd "$(DESTDIR)$(libdir)" && rm -f $$files + +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; \ + $(MAKE) $(AM_MAKEFLAGS) iec_bison.cc; \ + else :; fi +libstage1_2.a: $(libstage1_2_a_OBJECTS) $(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-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-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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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: diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/iec.flex --- a/stage1_2/iec.flex Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1719 +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) - * - * 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 . - * - * - * 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) - * - */ - -/* - * Stage 1 - * ======= - * - * This file contains the lexical tokens definitions, from which - * the flex utility will generate a lexical parser function. - */ - - - - -/*****************************/ -/* Lexical Parser Options... */ -/*****************************/ - -/* The lexical analyser will never work in interactive mode, - * i.e., it will only process programs saved to files, and never - * programs being written inter-actively by the user. - * This option saves the resulting parser from calling the - * isatty() function, that seems to be generating some compile - * errors under some (older?) versions of flex. - */ -%option never-interactive - -/* Have the lexical analyser use a 'char *yytext' instead of an - * array of char 'char yytext[??]' to store the lexical token. - */ -%pointer - - -/* Have the lexical analyser ignore the case of letters. - * This will occur for all the tokens and keywords, but - * the resulting text handed up to the syntax parser - * will not be changed, and keep the original case - * of the letters in the input file. - */ -%option case-insensitive - -/* Have the generated lexical analyser keep track of the - * line number it is currently analysing. - * This is used to pass up to the syntax parser - * the number of the line on which the current - * token was found. It will enable the syntax parser - * to generate more informatve error messages... - */ -%option yylineno - -/* required for the use of the yy_pop_state() and - * yy_push_state() functions - */ -%option stack - -/* The '%option stack' also requests the inclusion of - * the yy_top_state(), however this function is not - * currently being used. This means that the compiler - * is complaining about the existance of this function. - * The following option removes the yy_top_state() - * function from the resulting c code, so the compiler - * no longer complains. - */ -%option noyy_top_state - -/* We will not be using unput() in our flex code... */ -%option nounput - -/**************************************************/ -/* External Variable and Function declarations... */ -/**************************************************/ - - -%{ -/* Define TEST_MAIN to include a main() function. - * Useful for testing the parser generated by flex. - */ -/* -#define TEST_MAIN -*/ -/* If lexical parser is compiled by itself, we need to define the following - * constant to some string. Under normal circumstances LIBDIRECTORY is set - * in the syntax parser header file... - */ -#ifdef TEST_MAIN -#define DEFAULT_LIBDIR "just_testing" -#endif - - - -/* Required for strdup() */ -#include - -/* Required only for the declaration of abstract syntax classes - * (class symbol_c; class token_c; class list_c;) - * These will not be used in flex, but the token type union defined - * in iec.hh contains pointers to these classes, so we must include - * it here. - */ -#include "../absyntax/absyntax.hh" - - -/* generated by bison. - * Contains the definition of the token constants, and the - * token value type YYSTYPE (in our case, a 'const char *') - */ -#include "iec.y.hh" -#include "stage1_2_priv.hh" - - -/* Variable defined by the bison parser, - * where the value of the tokens will be stored - */ -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 *) - * directive... - */ -/* - NOTE: already defined in iec.y.hh -extern const char *current_filename; -*/ - - -/* We will not be using unput() in our flex code... */ -/* NOTE: it seems that this #define is no longer needed, It has been - * replaced by %option nounput. - * Should we simply delete it? - * For now leave it in, in case someone is using an old version of flex. - * In any case, the most harm that can result in a warning message - * when compiling iec.flex.c: - * warning: ‘void yyunput(int, char*)’ defined but not used - */ -#define YY_NO_UNPUT - -/* Variable defined by the bison parser. - * It must be initialised with the location - * of the token being parsed. - * This is only needed if we want to keep - * track of the locations, in order to give - * more meaningful error messages! - */ -extern YYLTYPE yylloc; - -#define YY_INPUT(buf,result,max_size) {\ - result = GetNextChar(buf, max_size);\ - if ( result <= 0 )\ - result = YY_NULL;\ - } - - -/* A counter to track the order by which each token is processed. - * NOTE: This counter is not exactly linear (i.e., it does not get incremented by 1 for each token). - * i.e.. it may get incremented by more than one between two consecutive tokens. - * This is due to the fact that the counter gets incremented every 'user action' in flex, - * however not every user action will result in a token being passed to bison. - * Nevertheless this is still OK, as we are only interested in the relative - * ordering of tokens... - */ -static long int current_order = 0; - - -/* Macro that is executed for every action. - * We use it to pass the location of the token - * back to the bison parser... - */ -#define YY_USER_ACTION {\ - yylloc.first_line = current_tracking->lineNumber; \ - yylloc.first_column = current_tracking->currentTokenStart; \ - yylloc.first_file = current_filename; \ - yylloc.first_order = current_order; \ - yylloc.last_line = current_tracking->lineNumber; \ - yylloc.last_column = current_tracking->currentChar - 1; \ - yylloc.last_file = current_filename; \ - yylloc.last_order = current_order; \ - current_tracking->currentTokenStart = current_tracking->currentChar; \ - current_order++; \ - } - - -/* Since this lexical parser we defined only works in ASCII based - * systems, we might as well make sure it is being compiled on - * one... - * Lets check a few random characters... - */ -#if (('a' != 0x61) || ('A' != 0x41) || ('z' != 0x7A) || ('Z' != 0x5A) || \ - ('0' != 0x30) || ('9' != 0x39) || ('(' != 0x28) || ('[' != 0x5B)) -#error This lexical analyser is not portable to a non ASCII based system. -#endif - - -/* Function only called from within flex, but defined - * in iec.y! - * We declare it here... - * - * Search for a symbol in either of the two symbol tables - * and return the token id of the first symbol found. - * Searches first in the variables, and only if not found - * does it continue searching in the library elements - */ -//token_id_t get_identifier_token(const char *identifier_str); -int get_identifier_token(const char *identifier_str); -%} - - -/***************************************************/ -/* Forward Declaration of functions defined later. */ -/***************************************************/ - -%{ -/* return all the text in the current token back to the input stream. */ -void unput_text(unsigned int n); -%} - - - -/****************************/ -/* Lexical Parser States... */ -/****************************/ - -/* NOTE: Our psrser can parse st or il code, intermixed - * within the same file. - * With IL we come across the issue of the EOL (end of line) token. - * ST, and the declaration parts of IL do not use this token! - * If the lexical analyser were to issue this token during ST - * language parsing, or during the declaration of data types, - * function headers, etc. in IL, the syntax parser would crash. - * - * We can solve this issue using one of three methods: - * (1) Augment all the syntax that does not accept the EOL - * token to simply ignore it. This makes the syntax - * definition (in iec.y) very cluttered! - * (2) Let the lexical parser figure out which language - * it is parsing, and decide whether or not to issue - * the EOL token. This requires the lexical parser - * to have knowledge of the syntax!, making for a poor - * overall organisation of the code. It would also make it - * very difficult to understand the lexical parser as it - * would use several states, and a state machine to transition - * between the states. The state transitions would be - * intermingled with the lexical parser defintion! - * (3) Use a mixture of (1) and (2). The lexical analyser - * merely distinguishes between function headers and function - * bodies, but no longer makes a distinction between il and - * st language bodies. When parsing a body, it will return - * the EOL token. In other states '\n' will be ignored as - * whitespace. - * The ST language syntax has been augmented in the syntax - * parser configuration to ignore any EOL tokens that it may - * come across! - * This option has both drawbacks of option (1) and (2), but - * much less intensely. - * The syntax that gets cluttered is limited to the ST statements - * (which is rather limited, compared to the function headers and - * data type declarations, etc...), while the state machine in - * the lexical parser becomes very simple. All state transitions - * can be handled within the lexical parser by itself, and can be - * easily identified. Thus knowledge of the syntax required by - * the lexical parser is very limited! - * - * Amazingly enough, I (Mario) got to implement option (3) - * at first, requiring two basic states, decl and body. - * The lexical parser will enter the body state when - * it is parsing the body of a function/program/function block. The - * state transition is done when we find a VAR_END that is not followed - * by a VAR! This is the syntax knowledge that gets included in the - * lexical analyser with this option! - * Unfortunately, getting the st syntax parser to ignore EOL anywhere - * where they might appear leads to conflicts. This is due to the fact - * that the syntax parser uses the single look-ahead token to remove - * possible conflicts. When we insert a possible EOL, the single - * look ahead token becomes the EOL, which means the potential conflicts - * could no longer be resolved. - * Removing these conflicts would make the st syntax parser very convoluted, - * and adding the extraneous EOL would make it very cluttered. - * This option was therefore dropped in favour of another! - * - * I ended up implementing (2). Unfortunately the lexical analyser can - * not easily distinguish between il and st code, since function - * calls in il are very similar to function block calls in st. - * We therefore use an extra 'body' state. When the lexical parser - * finds that last END_VAR, it enters the body state. This state - * must figure out what language is being parsed from the first few - * tokens, and switch to the correct state (st, il or sfc) according to the - * language. This means that we insert quite a bit of knowledge of the - * syntax of the languages into the lexical parser. This is ugly, but it - * works, and at least it is possible to keep all the state changes together - * to make it easier to remove them later on if need be. - * Once the language being parsed has been identified, - * the body state returns any matched text back to the buffer with unput(), - * to be later matched correctly by the apropriate language parser (st, il or sfc). - * - * Aditionally, in sfc state it may further recursively enter the body state - * once again. This is because an sfc body may contain ACTIONS, which are then - * written in one of the three languages (ST, IL or SFC), so once again we need - * to figure out which language the ACTION in the SFC was written in. We already - * ahve all that done in the body state, so we recursively transition to the body - * state once again. - * Note that in this case, when coming out of the st/il state (whichever language - * the action was written in) the sfc state will become active again. This is done by - * pushing and poping the previously active state! - * - * The sfc_qualifier_state is required because when parsing actions within an - * sfc, we will be expecting action qualifiers (N, P, R, S, DS, SD, ...). In order - * to bison to work correctly, these qualifiers must be returned as tokens. However, - * these tokens are not reserved keywords, which means it should be possible to - * define variables/functions/FBs with any of these names (including - * S and R which are special because they are also IL operators). So, when we are not - * expecting any action qualifiers, flex does not return these tokens, and is free - * to interpret them as previously defined variables/functions/... as the case may be. - * - * The state machine has 7 possible states (INITIAL, config, decl, body, st, il, sfc) - * Possible state changes are: - * INITIAL -> goto(decl_state) - * (when a FUNCTION, FUNCTION_BLOCK, or PROGRAM is found, - * and followed by a VAR declaration) - * INITIAL -> goto(body_state) - * (when a FUNCTION, FUNCTION_BLOCK, or PROGRAM is found, - * and _not_ followed by a VAR declaration) - * (This transition is actually commented out, since the syntax - * does not allow the declaration of functions, FBs, or programs - * without any VAR declaration!) - * INITIAL -> goto(config_state) - * (when a CONFIGURATION is found) - * decl_state -> push(decl_state); goto(body_state) - * (when the last END_VAR is found, i.e. the function body starts) - * decl_state -> push(decl_state); goto(sfc_state) - * (when it figures out it is parsing sfc language) - * body_state -> goto(st_state) - * (when it figures out it is parsing st language) - * body_state -> goto(il_state) - * (when it figures out it is parsing il language) - * st_state -> pop() - * (when a END_FUNCTION, END_FUNCTION_BLOCK, END_PROGRAM, - * END_ACTION or END_TRANSITION is found) - * il_state -> pop() - * (when a END_FUNCTION, END_FUNCTION_BLOCK, END_PROGRAM, - * END_ACTION or END_TRANSITION is found) - * decl_state -> goto(INITIAL) - * (when a END_FUNCTION, END_FUNCTION_BLOCK, or END_PROGRAM is found) - * sfc_state -> goto(INITIAL) - * (when a END_FUNCTION, END_FUNCTION_BLOCK, or END_PROGRAM is found) - * config_state -> goto(INITIAL) - * (when a END_CONFIGURATION is found) - * sfc_state -> push(sfc_state); goto(body_state) - * (when parsing an action. This transition is requested by bison) - * sfc_state -> push(sfc_state); goto(sfc_qualifier_state) - * (when expecting an action qualifier. This transition is requested by bison) - * sfc_qualifier_state -> pop() - * (when no longer expecting an action qualifier. This transition is requested by bison) - * config_state -> push(config_state); goto(task_init_state) - * (when parsing a task initialisation. This transition is requested by bison) - * task_init_state -> pop() - * (when no longer parsing task initialisation parameters. This transition is requested by bison) - * - */ - - -/* we are parsing a configuration. */ -%s config_state - -/* Inside a configuration, we are parsing a task initialisation parameters */ -/* This means that PRIORITY, SINGLE and INTERVAL must be handled as - * tokens, and not as possible identifiers. Note that the above words - * are not keywords. - */ -%s task_init_state - -/* 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 */ -%x body_state - -/* we are parsing il code -> flex must return the EOL tokens! */ -%s il_state - -/* we are parsing st code -> flex must not return the EOL tokens! */ -%s st_state - -/* we are parsing sfc code -> flex must not return the EOL tokens! */ -%s sfc_state - -/* we are parsing sfc code, and expecting an action qualifier. */ -%s sfc_qualifier_state - -/* we are parsing sfc code, and expecting the priority token. */ -%s sfc_priority_state - - - - -/*******************/ -/* File #include's */ -/*******************/ - -/* We extend the IEC 61131-3 standard syntax to allow inclusion - * of other files, using the IEC 61131-3 pragma directive... - * The accepted syntax is: - * {#include ""} - */ - -/* the "include" states are used for picking up the name of an include file */ -%x include_beg -%x include_filename -%x include_end - - -file_include_pragma_filename [^\"]* -file_include_pragma_beg "{#include"{st_whitespace_only}\" -file_include_pragma_end \"{st_whitespace_only}"}" -file_include_pragma {file_include_pragma_beg}{file_include_pragma_filename}{file_include_pragma_end} - - -%{ -#define MAX_INCLUDE_DEPTH 16 - -typedef struct { - YY_BUFFER_STATE buffer_state; - tracking_t* env; - const char *filename; - } include_stack_t; - -tracking_t* current_tracking; -include_stack_t include_stack[MAX_INCLUDE_DEPTH]; -int include_stack_ptr = 0; - -const char *INCLUDE_DIRECTORIES[] = { - DEFAULT_LIBDIR, - ".", - "/lib", - "/usr/lib", - "/usr/lib/iec", - NULL /* must end with NULL!! */ - }; - -%} - - - -/*****************************/ -/* Prelimenary constructs... */ -/*****************************/ - -/* In order to allow the declaration of POU prototypes (Function, FB, Program, ...), - * especially the prototypes of Functions and FBs defined in the standard - * (i.e. standard functions and FBs), we extend the IEC 61131-3 standard syntax - * with two pragmas to indicate that the code is to be parsed (going through the - * lexical, syntactical, and semantic analysers), but no code is to be generated. - * - * The accepted syntax is: - * {no_code_generation begin} - * ... prototypes ... - * {no_code_generation end} - * - * When parsing these prototypes the abstract syntax tree will be populated as usual, - * allowing the semantic analyser to correctly analyse the semantics of calls to these - * functions/FBs. However, stage4 will simply ignore all IEC61131-3 code - * between the above two pragmas. - */ - -disable_code_generation_pragma "{disable code generation}" -enable_code_generation_pragma "{enable code generation}" - - -/* Any other pragma... */ - -pragma "{"[^}]*"}" - -/* NOTE: this seemingly unnecessary complex definition is required - * to be able to eat up comments such as: - * '(* Testing... ! ***** ******)' - * without using the trailing context command in flex (/{context}) - * since {comment} itself will later be used with - * trailing context ({comment}/{context}) - */ -not_asterisk [^*] -not_close_parenthesis_nor_asterisk [^*)] -asterisk "*" -comment_text {not_asterisk}|(({asterisk}+){not_close_parenthesis_nor_asterisk}) - -comment "(*"({comment_text}*)({asterisk}+)")" - - -/* -3.1 Whitespace - (NOTE: Whitespace IS clearly defined, to include newline!!! See section 2.1.4!!!) - No definition of whitespace is given, in other words, the characters that may be used to seperate language tokens are not pecisely defined. One may nevertheless make an inteligent guess of using the space (' '), and other characters also commonly considered whitespace in other programming languages (horizontal tab, vertical tab, form feed, etc.). - The main question is whether the newline character should be considered whitespace. IL language statements use an EOL token (End Of Line) to distinguish between some language constructs. The EOL token itself is openly defined as "normally consist[ing] of the 'paragraph separator' ", leaving the final choice open to each implemention. If we choose the newline character to represent the EOL token, it may then not be considered whitespace. - On the other hand, some examples that come in a non-normative annex of the specification allow function declarations to span multiple3.1 Whitespace - (NOTE: Whitespace IS clearly defined, to include newline!!! See section 2.1.4!!!) - No definition of whitespace is given, in other words, the characters that may be used to seperate language tokens are not pecisely defined. One may nevertheless make an inteligent guess of using the space (' '), and other characters also commonly considered whitespace in other programming languages (horizontal tab, vertical tab, form feed, etc.). - The main question is whether the newline character should be considered whitespace. IL language statements use an EOL token (End Of Line) to distinguish between some language constructs. The EOL token itself is openly defined as "normally consist[ing] of the 'paragraph separator' ", leaving the final choice open to each implemention. If we choose the newline character to represent the EOL token, it may then not be considered whitespace. - On the other hand, some examples that come in a non-normative annex of the specification allow function declarations to span multiple lines, which means that the newline character is being considered as whitespace. - Our implementation works around this issue by including the new line character in the whitespace while parsing function declarations and the ST language, and parsing it as the EOL token only while parsing IL language statements. This requires the use of a state machine in the lexical parser that needs at least some knowledge of the syntax itself. -*/ -/* NOTE: Our definition of whitespace will only work in ASCII! - * - * Since the IL language needs to know the location of newline - * (token EOL -> '\n' ), we need one definition of whitespace - * for each language... - */ -/* - * NOTE: we cannot use - * st_whitespace [:space:]* - * since we use {st_whitespace} as trailing context. In our case - * this would not constitute "dangerous trailing context", but the - * lexical generator (i.e. flex) does not know this (since it does - * not know which characters belong to the set [:space:]), and will - * generate a "dangerous trailing context" warning! - * We use this alternative just to stop the flex utility from - * generating the invalid (in this case) warning... - */ - -st_whitespace_only [ \f\n\r\t\v]* -il_whitespace_only [ \f\r\t\v]* - -st_whitespace_text {st_whitespace_only}|{comment}|{pragma} -il_whitespace_text {il_whitespace_only}|{comment}|{pragma} - -st_whitespace {st_whitespace_text}* -il_whitespace {il_whitespace_text}* - -st_whitespace_text_no_pragma {st_whitespace_only}|{comment} -il_whitespace_text_no_pragma {il_whitespace_only}|{comment} - -st_whitespace_no_pragma {st_whitespace_text_no_pragma}* -il_whitespace_no_pragma {il_whitespace_text_no_pragma}* - -qualified_identifier {identifier}(\.{identifier})* - - - -/*****************************************/ -/* B.1.1 Letters, digits and identifiers */ -/*****************************************/ -/* NOTE: The following definitions only work if the host computer - * is using the ASCII maping. For e.g., with EBCDIC [A-Z] - * contains non-alphabetic characters! - * The correct way of doing it would be to use - * the [:upper:] etc... definitions. - * - * Unfortunately, further on we need all printable - * characters (i.e. [:print:]), but excluding '$'. - * Flex does not allow sets to be composed by excluding - * elements. Sets may only be constructed by adding new - * elements, which means that we have to revert to - * [\x20\x21\x23\x25\x26\x28-x7E] for the definition - * of the printable characters with the required exceptions. - * The above also implies the use of ASCII, but now we have - * no way to work around it| - * - * The conclusion is that our parser is limited to ASCII - * based host computers!! - */ -letter [A-Za-z] -digit [0-9] -octal_digit [0-7] -hex_digit {digit}|[A-F] -identifier ({letter}|(_({letter}|{digit})))((_?({letter}|{digit}))*) - -/*******************/ -/* B.1.2 Constants */ -/*******************/ - -/******************************/ -/* B.1.2.1 Numeric literals */ -/******************************/ -integer {digit}((_?{digit})*) -binary_integer 2#{bit}((_?{bit})*) -bit [0-1] -octal_integer 8#{octal_digit}((_?{octal_digit})*) -hex_integer 16#{hex_digit}((_?{hex_digit})*) -exponent [Ee]([+-]?){integer} -/* The correct definition for real would be: - * real {integer}\.{integer}({exponent}?) - * - * Unfortunately, the spec also defines fixed_point (B 1.2.3.1) as: - * fixed_point {integer}\.{integer} - * - * This means that {integer}\.{integer} could be interpreted - * as either a fixed_point or a real. - * I have opted to interpret {integer}\.{integer} as a fixed_point. - * In order to do this, the definition of real has been changed to: - * real {integer}\.{integer}{exponent} - * - * This means that the syntax parser now needs to define a real to be - * either a real_token or a fixed_point_token! - */ -real {integer}\.{integer}{exponent} - - -/*******************************/ -/* B.1.2.2 Character Strings */ -/*******************************/ -/* -common_character_representation := - -|'$$' -|'$L'|'$N'|'$P'|'$R'|'$T' -|'$l'|'$n'|'$p'|'$r'|'$t' - -NOTE: $ = 0x24 - " = 0x22 - ' = 0x27 - - printable chars in ASCII: 0x20-0x7E -*/ - -esc_char_u $L|$N|$P|$R|$T -esc_char_l $l|$n|$p|$r|$t -esc_char $$|{esc_char_u}|{esc_char_l} -double_byte_char (${hex_digit}{hex_digit}{hex_digit}{hex_digit}) -single_byte_char (${hex_digit}{hex_digit}) - -/* WARNING: - * This definition is only valid in ASCII... - * - * Flex includes the function print_char() that defines - * all printable characters portably (i.e. whatever character - * encoding is currently being used , ASCII, EBCDIC, etc...) - * Unfortunately, we cannot generate the definition of - * common_character_representation portably, since flex - * does not allow definition of sets by subtracting - * elements in one set from another set. - * This means we must build up the defintion of - * common_character_representation using only set addition, - * which leaves us with the only choice of defining the - * characters non-portably... - */ -common_character_representation [\x20\x21\x23\x25\x26\x28-\x7E]|{esc_char} -double_byte_character_representation $\"|'|{double_byte_char}|{common_character_representation} -single_byte_character_representation $'|\"|{single_byte_char}|{common_character_representation} - - -double_byte_character_string \"({double_byte_character_representation}*)\" -single_byte_character_string '({single_byte_character_representation}*)' - - -/************************/ -/* B 1.2.3.1 - Duration */ -/************************/ -fixed_point {integer}\.{integer} - -fixed_point_d {fixed_point}d -integer_d {integer}d - -fixed_point_h {fixed_point}h -integer_h {integer}h - -fixed_point_m {fixed_point}m -integer_m {integer}m - -fixed_point_s {fixed_point}s -integer_s {integer}s - -fixed_point_ms {fixed_point}ms -integer_ms {integer}ms - - -/********************************************/ -/* B.1.4.1 Directly Represented Variables */ -/********************************************/ -/* The correct definition, if the standard were to be followed... */ - -location_prefix [IQM] -size_prefix [XBWDL] -direct_variable_standard %{location_prefix}({size_prefix}?){integer}((.{integer})*) - - -/* For the MatPLC, we will accept % - * as a direct variable, this being mapped onto the MatPLC point - * named - */ -/* TODO: we should not restrict it to only the accepted syntax - * of as specified by the standard. MatPLC point names - * have a more permissive syntax. - * - * e.g. "P__234" - * Is a valid MatPLC point name, but not a valid !! - * The same happens with names such as "333", "349+23", etc... - * How can we handle these more expressive names in our case? - * Remember that some direct variable may remain anonymous, with - * declarations such as: - * VAR - * AT %I3 : BYTE := 255; - * END_VAR - * in which case we are currently using "%I3" as the variable - * name. - */ -direct_variable_matplc %{identifier} - -direct_variable {direct_variable_standard}|{direct_variable_matplc} - -/******************************************/ -/* B 1.4.3 - Declaration & Initialisation */ -/******************************************/ -incompl_location %[IQM]\* - - - - -%% - /* fprintf(stderr, "flex: state %d\n", YY_START); */ - - /*****************************************************/ - /*****************************************************/ - /*****************************************************/ - /***** *****/ - /***** *****/ - /***** F I R S T T H I N G S F I R S T *****/ - /***** *****/ - /***** *****/ - /*****************************************************/ - /*****************************************************/ - /*****************************************************/ - - /***********************************************************/ - /* Handle requests sent by bison for flex to change state. */ - /***********************************************************/ - if (get_goto_body_state()) { - yy_push_state(body_state); - rst_goto_body_state(); - } - - if (get_goto_sfc_qualifier_state()) { - yy_push_state(sfc_qualifier_state); - rst_goto_sfc_qualifier_state(); - } - - if (get_goto_sfc_priority_state()) { - yy_push_state(sfc_priority_state); - rst_goto_sfc_priority_state(); - } - - if (get_goto_task_init_state()) { - yy_push_state(task_init_state); - rst_goto_task_init_state(); - } - - if (get_pop_state()) { - yy_pop_state(); - rst_pop_state(); - } - - /***************************/ - /* Handle the pragmas! */ - /***************************/ - - /* We start off by searching for the pragmas we handle in the lexical parser. */ -{file_include_pragma} unput_text(0); yy_push_state(include_beg); - - /* Pragmas sent to syntax analyser (bison) */ -{disable_code_generation_pragma} return disable_code_generation_pragma_token; -{enable_code_generation_pragma} return enable_code_generation_pragma_token; -{disable_code_generation_pragma} return disable_code_generation_pragma_token; -{enable_code_generation_pragma} return enable_code_generation_pragma_token; - - /* Any other pragma we find, we just pass it up to the syntax parser... */ - /* Note that the state is exclusive, so we have to include it here too. */ -{pragma} {/* return the pragmma without the enclosing '{' and '}' */ - yytext[strlen(yytext)-1] = '\0'; - yylval.ID=strdup(yytext+1); - return pragma_token; - } -{pragma} {/* return the pragmma without the enclosing '{' and '}' */ - yytext[strlen(yytext)-1] = '\0'; - yylval.ID=strdup(yytext+1); - return pragma_token; - } - - - /*********************************/ - /* Handle the file includes! */ - /*********************************/ -{file_include_pragma_beg} BEGIN(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)); - /* switch to whatever state was active before the include file */ - yy_pop_state(); - /* now process the new file... */ - } - - -<> { /* 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!) - */ - free(current_tracking); - if (include_stack_ptr == 0) { - /* yyterminate() terminates the scanner and returns a 0 to the - * scanner's caller, indicating "all done". - * - * Our syntax parser (written with bison) has the token - * END_OF_INPUT associated to the value 0, so even though - * we don't explicitly return the token END_OF_INPUT - * calling yyterminate() is equivalent to doing that. - */ - yyterminate(); - } - else { - --include_stack_ptr; - yy_delete_buffer(YY_CURRENT_BUFFER); - yy_switch_to_buffer((include_stack[include_stack_ptr]).buffer_state); - current_tracking = include_stack[include_stack_ptr].env; - /* removing constness of char *. This is safe actually, - * since the only real const char * that is stored on the stack is - * the first one (i.e. the one that gets stored in include_stack[0], - * which is never free'd! - */ - /* NOTE: We do __NOT__ free the malloc()'d memory since - * pointers to this filename will be kept by many objects - * in the abstract syntax tree. - * This will later be used to provide correct error - * messages during semantic analysis (stage 3) - */ - /* free((char *)current_filename); */ - current_filename = include_stack[include_stack_ptr].filename; - yy_push_state(include_end); - } - } - -{file_include_pragma_end} yy_pop_state(); - - - /*********************************/ - /* Handle all the state changes! */ - /*********************************/ - - /* INITIAL -> decl_state */ -{ - /* NOTE: how about functions that do not declare variables, and go directly to the body_state??? - * - According to Section 2.5.1.3 (Function Declaration), item 2 in the list, a FUNCTION - * must have at least one input argument, so a correct declaration will have at least - * one VAR_INPUT ... VAR_END construct! - * - According to Section 2.5.2.2 (Function Block Declaration), a FUNCTION_BLOCK - * must have at least one input argument, so a correct declaration will have at least - * one VAR_INPUT ... VAR_END construct! - * - According to Section 2.5.3 (Programs), a PROGRAM must have at least one input - * argument, so a correct declaration will have at least one VAR_INPUT ... VAR_END - * construct! - * - * All the above means that we needn't worry about PROGRAMs, FUNCTIONs or - * FUNCTION_BLOCKs that do not have at least one VAR_END before the body_state. - * If the code has an error, and no VAR_END before the body, we will simply - * continue in the state, untill the end of the FUNCTION, FUNCTION_BLOCK - * or PROGAM. - */ -FUNCTION BEGIN(decl_state); return FUNCTION; -FUNCTION_BLOCK BEGIN(decl_state); return FUNCTION_BLOCK; -PROGRAM BEGIN(decl_state); return PROGRAM; -CONFIGURATION BEGIN(config_state); return CONFIGURATION; -} - - /* INITIAL -> body_state */ - /* required if the function, program, etc.. has no VAR block! */ - /* We comment it out since the standard does not allow this. */ - /* NOTE: Even if we were to include the following code, it */ - /* would have no effect whatsoever since the above */ - /* rules will take precendence! */ - /* -{ -FUNCTION BEGIN(body_state); return FUNCTION; -FUNCTION_BLOCK BEGIN(body_state); return FUNCTION_BLOCK; -PROGRAM BEGIN(body_state); return PROGRAM; -} - */ - - /* decl_state -> (body_state | sfc_state) */ -{ -END_VAR{st_whitespace}VAR {unput_text(strlen("END_VAR")); - return END_VAR; - } -END_VAR{st_whitespace}INITIAL_STEP {unput_text(strlen("END_VAR")); - yy_push_state(sfc_state); - return END_VAR; - } -END_VAR{st_whitespace} {unput_text(strlen("END_VAR")); - cmd_goto_body_state(); - return END_VAR; - } -} - - /* body_state -> (il_state | st_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}"[" 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); -WHILE 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); - - /* Hopefully, the above rules (along with the last one), - * used to distinguish ST from IL, are - * enough to handle all ocurrences. However, if - * there is some situation where the compiler is getting confused, - * we add the following rule to detect 'label:' in IL code. This will - * allow the user to insert a label right at the beginning (which - * will probably not be used further by his code) simply as a way - * to force the compiler to interpret his code as IL code. - */ -{identifier}{st_whitespace}":"{st_whitespace} unput_text(0); BEGIN(il_state); - -{identifier} {int token = get_identifier_token(yytext); - if (token == prev_declared_fb_name_token) { - /* the code has a call to a function block */ - /* NOTE: if we ever decide to allow the user to use IL operator tokens - * (LD, ST, ...) as identifiers for variable names (including - * function block instances), then the above inference/conclusion - * may be incorrect, and this condition may have to be changed! - */ - BEGIN(st_state); - } else { - BEGIN(il_state); - } - unput_text(0); - } - -. unput_text(0); BEGIN(il_state); -} /* end of body_state lexical parser */ - - /* (il_state | st_state) -> $previous_state (decl_state or sfc_state) */ -{ -END_FUNCTION yy_pop_state(); unput_text(0); -END_FUNCTION_BLOCK yy_pop_state(); unput_text(0); -END_PROGRAM yy_pop_state(); unput_text(0); -END_TRANSITION yy_pop_state(); unput_text(0); -END_ACTION yy_pop_state(); unput_text(0); -} - - /* sfc_state -> INITIAL */ -{ -END_FUNCTION yy_pop_state(); unput_text(0); -END_FUNCTION_BLOCK yy_pop_state(); unput_text(0); -END_PROGRAM yy_pop_state(); unput_text(0); -} - - /* decl_state -> INITIAL */ -{ -END_FUNCTION BEGIN(INITIAL); return END_FUNCTION; -END_FUNCTION_BLOCK BEGIN(INITIAL); return END_FUNCTION_BLOCK; -END_PROGRAM BEGIN(INITIAL); return END_PROGRAM; -} - /* config -> INITIAL */ -END_CONFIGURATION BEGIN(INITIAL); return END_CONFIGURATION; - - - - /***************************************/ - /* Next is to to remove all whitespace */ - /***************************************/ - /* NOTE: pragmas are handled right at the beginning... */ - -{st_whitespace_no_pragma} /* Eat any whitespace */ -{il_whitespace_no_pragma} /* Eat any whitespace */ - - - - /*****************************************/ - /* B.1.1 Letters, digits and identifiers */ - /*****************************************/ - /* NOTE: 'R1', 'IN', etc... are IL operators, and therefore tokens - * On the other hand, the spec does not define them as keywords, - * which means they may be re-used for variable names, etc...! - * The syntax parser already caters for the possibility of these - * tokens being used for variable names in their declarations. - * When they are declared, they will be added to the variable symbol table! - * Further appearances of these tokens must no longer be parsed - * as R1_tokens etc..., but rather as variable_name_tokens! - * - * That is why the first thing we do with identifiers, even before - * checking whether they may be a 'keyword', is to check whether - * they have been previously declared as a variable name, - * - * However, we have a dilema! Should we here also check for - * prev_declared_derived_function_name_token? - * If we do, then the 'MOD' default library function (defined in - * the standard) will always be returned as a function name, and - * it will therefore not be possible to use it as an operator as - * in the following ST expression 'X := Y MOD Z;' ! - * If we don't, then even it will not be possible to use 'MOD' - * as a funtion as in 'X := MOD(Y, Z);' - * We solve this by NOT testing for function names here, and - * handling this function and keyword clash in bison! - */ - /* -{identifier} {int token = get_identifier_token(yytext); - // fprintf(stderr, "flex: analysing identifier '%s'...", yytext); - if ((token == prev_declared_variable_name_token) || -// (token == prev_declared_derived_function_name_token) || // DO NOT add this condition! - (token == prev_declared_fb_name_token)) { - // if (token != identifier_token) - // * NOTE: if we replace the above uncommented conditions with - * the simple test of (token != identifier_token), then - * 'MOD' et al must be removed from the - * library_symbol_table as a default function name! - * // - yylval.ID=strdup(yytext); - // fprintf(stderr, "returning token %d\n", token); - return token; - } - // otherwise, leave it for the other lexical parser rules... - // fprintf(stderr, "rejecting\n"); - REJECT; - } - */ - - /******************************************************/ - /******************************************************/ - /******************************************************/ - /***** *****/ - /***** *****/ - /***** N O W D O T H E K E Y W O R D S *****/ - /***** *****/ - /***** *****/ - /******************************************************/ - /******************************************************/ - /******************************************************/ - - -EN return EN; /* Keyword */ -ENO return ENO; /* Keyword */ - - - /******************************/ - /* B 1.2.1 - Numeric Literals */ - /******************************/ -TRUE return TRUE; /* Keyword */ -BOOL#1 return boolean_true_literal_token; -BOOL#TRUE return boolean_true_literal_token; -SAFEBOOL#1 {if (get_opt_safe_extensions()) {return safeboolean_true_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ -SAFEBOOL#TRUE {if (get_opt_safe_extensions()) {return safeboolean_true_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ - -FALSE return FALSE; /* Keyword */ -BOOL#0 return boolean_false_literal_token; -BOOL#FALSE return boolean_false_literal_token; -SAFEBOOL#0 {if (get_opt_safe_extensions()) {return safeboolean_false_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ -SAFEBOOL#FALSE {if (get_opt_safe_extensions()) {return safeboolean_false_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ - - - /************************/ - /* B 1.2.3.1 - Duration */ - /************************/ -t# return T_SHARP; /* Delimiter */ -T# return T_SHARP; /* Delimiter */ -TIME return TIME; /* Keyword (Data Type) */ - - - /************************************/ - /* B 1.2.3.2 - Time of day and Date */ - /************************************/ -TIME_OF_DAY return TIME_OF_DAY; /* Keyword (Data Type) */ -TOD return TIME_OF_DAY; /* Keyword (Data Type) */ -DATE return DATE; /* Keyword (Data Type) */ -d# return D_SHARP; /* Delimiter */ -D# return D_SHARP; /* Delimiter */ -DATE_AND_TIME return DATE_AND_TIME; /* Keyword (Data Type) */ -DT return DATE_AND_TIME; /* Keyword (Data Type) */ - - - /***********************************/ - /* B 1.3.1 - Elementary Data Types */ - /***********************************/ -BOOL return BOOL; /* Keyword (Data Type) */ - -BYTE return BYTE; /* Keyword (Data Type) */ -WORD return WORD; /* Keyword (Data Type) */ -DWORD return DWORD; /* Keyword (Data Type) */ -LWORD return LWORD; /* Keyword (Data Type) */ - -SINT return SINT; /* Keyword (Data Type) */ -INT return INT; /* Keyword (Data Type) */ -DINT return DINT; /* Keyword (Data Type) */ -LINT return LINT; /* Keyword (Data Type) */ - -USINT return USINT; /* Keyword (Data Type) */ -UINT return UINT; /* Keyword (Data Type) */ -UDINT return UDINT; /* Keyword (Data Type) */ -ULINT return ULINT; /* Keyword (Data Type) */ - -REAL return REAL; /* Keyword (Data Type) */ -LREAL return LREAL; /* Keyword (Data Type) */ - -WSTRING return WSTRING; /* Keyword (Data Type) */ -STRING return STRING; /* Keyword (Data Type) */ - -TIME return TIME; /* Keyword (Data Type) */ -DATE return DATE; /* Keyword (Data Type) */ -DT return DT; /* Keyword (Data Type) */ -TOD return TOD; /* Keyword (Data Type) */ -DATE_AND_TIME return DATE_AND_TIME; /* Keyword (Data Type) */ -TIME_OF_DAY return TIME_OF_DAY; /* Keyword (Data Type) */ - - /*****************************************************************/ - /* Keywords defined in "Safety Software Technical Specification" */ - /*****************************************************************/ - /* - * NOTE: The following keywords are define in - * "Safety Software Technical Specification, - * Part 1: Concepts and Function Blocks, - * Version 1.0 – Official Release" - * written by PLCopen - Technical Committee 5 - * - * We only support these extensions and keywords - * if the apropriate command line option is given. - */ -SAFEBOOL {if (get_opt_safe_extensions()) {return SAFEBOOL;} else {REJECT;}} - -SAFEBYTE {if (get_opt_safe_extensions()) {return SAFEBYTE;} else {REJECT;}} -SAFEWORD {if (get_opt_safe_extensions()) {return SAFEWORD;} else {REJECT;}} -SAFEDWORD {if (get_opt_safe_extensions()) {return SAFEDWORD;} else{REJECT;}} -SAFELWORD {if (get_opt_safe_extensions()) {return SAFELWORD;} else{REJECT;}} - -SAFEREAL {if (get_opt_safe_extensions()) {return SAFESINT;} else{REJECT;}} -SAFELREAL {if (get_opt_safe_extensions()) {return SAFELREAL;} else{REJECT;}} - -SAFESINT {if (get_opt_safe_extensions()) {return SAFESINT;} else{REJECT;}} -SAFEINT {if (get_opt_safe_extensions()) {return SAFEINT;} else{REJECT;}} -SAFEDINT {if (get_opt_safe_extensions()) {return SAFEDINT;} else{REJECT;}} -SAFELINT {if (get_opt_safe_extensions()) {return SAFELINT;} else{REJECT;}} - -SAFEUSINT {if (get_opt_safe_extensions()) {return SAFEUSINT;} else{REJECT;}} -SAFEUINT {if (get_opt_safe_extensions()) {return SAFEUINT;} else{REJECT;}} -SAFEUDINT {if (get_opt_safe_extensions()) {return SAFEUDINT;} else{REJECT;}} -SAFEULINT {if (get_opt_safe_extensions()) {return SAFEULINT;} else{REJECT;}} - - /* SAFESTRING and SAFEWSTRING are not yet supported, i.e. checked correctly, in the semantic analyser (stage 3) */ - /* so it is best not to support them at all... */ - /* -SAFEWSTRING {if (get_opt_safe_extensions()) {return SAFEWSTRING;} else{REJECT;}} -SAFESTRING {if (get_opt_safe_extensions()) {return SAFESTRING;} else{REJECT;}} - */ - -SAFETIME {if (get_opt_safe_extensions()) {return SAFETIME;} else{REJECT;}} -SAFEDATE {if (get_opt_safe_extensions()) {return SAFEDATE;} else{REJECT;}} -SAFEDT {if (get_opt_safe_extensions()) {return SAFEDT;} else{REJECT;}} -SAFETOD {if (get_opt_safe_extensions()) {return SAFETOD;} else{REJECT;}} -SAFEDATE_AND_TIME {if (get_opt_safe_extensions()) {return SAFEDATE_AND_TIME;} else{REJECT;}} -SAFETIME_OF_DAY {if (get_opt_safe_extensions()) {return SAFETIME_OF_DAY;} else{REJECT;}} - - /********************************/ - /* B 1.3.2 - Generic data types */ - /********************************/ - /* Strangely, the following symbols do not seem to be required! */ - /* But we include them so they become reserved words, and do not - * get passed up to bison as an identifier... - */ -ANY return ANY; /* Keyword (Data Type) */ -ANY_DERIVED return ANY_DERIVED; /* Keyword (Data Type) */ -ANY_ELEMENTARY return ANY_ELEMENTARY; /* Keyword (Data Type) */ -ANY_MAGNITUDE return ANY_MAGNITUDE; /* Keyword (Data Type) */ -ANY_NUM return ANY_NUM; /* Keyword (Data Type) */ -ANY_REAL return ANY_REAL; /* Keyword (Data Type) */ -ANY_INT return ANY_INT; /* Keyword (Data Type) */ -ANY_BIT return ANY_BIT; /* Keyword (Data Type) */ -ANY_STRING return ANY_STRING; /* Keyword (Data Type) */ -ANY_DATE return ANY_DATE; /* Keyword (Data Type) */ - - - /********************************/ - /* B 1.3.3 - Derived data types */ - /********************************/ -":=" return ASSIGN; /* Delimiter */ -".." return DOTDOT; /* Delimiter */ -TYPE return TYPE; /* Keyword */ -END_TYPE return END_TYPE; /* Keyword */ -ARRAY return ARRAY; /* Keyword */ -OF return OF; /* Keyword */ -STRUCT return STRUCT; /* Keyword */ -END_STRUCT return END_STRUCT; /* Keyword */ - - - /*********************/ - /* B 1.4 - Variables */ - /*********************/ - - /******************************************/ - /* B 1.4.3 - Declaration & Initialisation */ - /******************************************/ -VAR_INPUT return VAR_INPUT; /* Keyword */ -VAR_OUTPUT return VAR_OUTPUT; /* Keyword */ -VAR_IN_OUT return VAR_IN_OUT; /* Keyword */ -VAR_EXTERNAL return VAR_EXTERNAL; /* Keyword */ -VAR_GLOBAL return VAR_GLOBAL; /* Keyword */ -END_VAR return END_VAR; /* Keyword */ -RETAIN return RETAIN; /* Keyword */ -NON_RETAIN return NON_RETAIN; /* Keyword */ -R_EDGE return R_EDGE; /* Keyword */ -F_EDGE return F_EDGE; /* Keyword */ -AT return AT; /* Keyword */ - - - /***********************/ - /* B 1.5.1 - Functions */ - /***********************/ -FUNCTION return FUNCTION; /* Keyword */ -END_FUNCTION return END_FUNCTION; /* Keyword */ -VAR return VAR; /* Keyword */ -CONSTANT return CONSTANT; /* Keyword */ - - - /*****************************/ - /* B 1.5.2 - Function Blocks */ - /*****************************/ -FUNCTION_BLOCK return FUNCTION_BLOCK; /* Keyword */ -END_FUNCTION_BLOCK return END_FUNCTION_BLOCK; /* Keyword */ -VAR_TEMP return VAR_TEMP; /* Keyword */ -VAR return VAR; /* Keyword */ -NON_RETAIN return NON_RETAIN; /* Keyword */ -END_VAR return END_VAR; /* Keyword */ - - - /**********************/ - /* B 1.5.3 - Programs */ - /**********************/ -PROGRAM return PROGRAM; /* Keyword */ -END_PROGRAM return END_PROGRAM; /* Keyword */ - - - /********************************************/ - /* B 1.6 Sequential Function Chart elements */ - /********************************************/ - /* NOTE: the following identifiers/tokens clash with the R and S IL operators, as well - .* as other identifiers that may be used as variable names inside IL and ST programs. - * They will have to be handled when we include parsing of SFC... For now, simply - * ignore them! - */ - -ACTION return ACTION; /* Keyword */ -END_ACTION return END_ACTION; /* Keyword */ - -TRANSITION return TRANSITION; /* Keyword */ -END_TRANSITION return END_TRANSITION; /* Keyword */ -FROM return FROM; /* Keyword */ -TO return TO; /* Keyword */ - -INITIAL_STEP return INITIAL_STEP; /* Keyword */ -STEP return STEP; /* Keyword */ -END_STEP return END_STEP; /* Keyword */ - - /* PRIORITY is not a keyword, so we only return it when - * it is explicitly required and we are not expecting any identifiers - * that could also use the same letter sequence (i.e. an identifier: piority) - */ -PRIORITY return PRIORITY; - -{ -L return L; -D return D; -SD return SD; -DS return DS; -SL return SL; -N return N; -P return P; -R return R; -S return S; -} - - - /********************************/ - /* B 1.7 Configuration elements */ - /********************************/ -CONFIGURATION return CONFIGURATION; /* Keyword */ -END_CONFIGURATION return END_CONFIGURATION; /* Keyword */ -TASK return TASK; /* Keyword */ -RESOURCE return RESOURCE; /* Keyword */ -ON return ON; /* Keyword */ -END_RESOURCE return END_RESOURCE; /* Keyword */ -VAR_CONFIG return VAR_CONFIG; /* Keyword */ -VAR_ACCESS return VAR_ACCESS; /* Keyword */ -END_VAR return END_VAR; /* Keyword */ -WITH return WITH; /* Keyword */ -PROGRAM return PROGRAM; /* Keyword */ -RETAIN return RETAIN; /* Keyword */ -NON_RETAIN return NON_RETAIN; /* Keyword */ -READ_WRITE return READ_WRITE; /* Keyword */ -READ_ONLY return READ_ONLY; /* Keyword */ - - /* PRIORITY, SINGLE and INTERVAL are not a keywords, so we only return them when - * it is explicitly required and we are not expecting any identifiers - * that could also use the same letter sequence (i.e. an identifier: piority, ...) - */ -{ -PRIORITY return PRIORITY; -SINGLE return SINGLE; -INTERVAL return INTERVAL; -} - - /***********************************/ - /* B 2.1 Instructions and Operands */ - /***********************************/ -\n return EOL; - - - /*******************/ - /* B 2.2 Operators */ - /*******************/ - /* NOTE: we can't have flex return the same token for - * ANDN and &N, neither for AND and &, since - * AND and ANDN are considered valid variable - * function or functionblock type names! - * This means that the parser may decide that the - * AND or ANDN strings found in the source code - * are being used as variable names - * and not as operators, and will therefore transform - * these tokens into indentifier tokens! - * We can't have the parser thinking that the source - * code contained the string AND (which may be interpreted - * as a vairable name) when in reality the source code - * merely contained the character &, so we use two - * different tokens for & and AND (and similarly - * ANDN and &N)! - */ - /* The following tokens clash with ST expression operators and Standard Functions */ - /* They are also keywords! */ -AND return AND; /* Keyword */ -MOD return MOD; /* Keyword */ -OR return OR; /* Keyword */ -XOR return XOR; /* Keyword */ -NOT return NOT; /* Keyword */ - - /* The following tokens clash with Standard Functions */ - /* They are keywords because they are a function name */ -{ -ADD return ADD; /* Keyword (Standard Function) */ -DIV return DIV; /* Keyword (Standard Function) */ -EQ return EQ; /* Keyword (Standard Function) */ -GE return GE; /* Keyword (Standard Function) */ -GT return GT; /* Keyword (Standard Function) */ -LE return LE; /* Keyword (Standard Function) */ -LT return LT; /* Keyword (Standard Function) */ -MUL return MUL; /* Keyword (Standard Function) */ -NE return NE; /* Keyword (Standard Function) */ -SUB return SUB; /* Keyword (Standard Function) */ -} - - /* The following tokens clash with SFC action qualifiers */ - /* They are not keywords! */ -{ -S return S; -R return R; -} - - /* The following tokens clash with ST expression operators */ -& return AND2; /* NOT a Delimiter! */ - - /* The following tokens have no clashes */ - /* They are not keywords! */ -{ -LD return LD; -LDN return LDN; -ST return ST; -STN return STN; -S1 return S1; -R1 return R1; -CLK return CLK; -CU return CU; -CD return CD; -PV return PV; -IN return IN; -PT return PT; -ANDN return ANDN; -&N return ANDN2; -ORN return ORN; -XORN return XORN; -CAL return CAL; -CALC return CALC; -CALCN return CALCN; -RET return RET; -RETC return RETC; -RETCN return RETCN; -JMP return JMP; -JMPC return JMPC; -JMPCN return JMPCN; -} - - /***********************/ - /* B 3.1 - Expressions */ - /***********************/ -"**" return OPER_EXP; /* NOT a Delimiter! */ -"<>" return OPER_NE; /* NOT a Delimiter! */ -">=" return OPER_GE; /* NOT a Delimiter! */ -"<=" return OPER_LE; /* NOT a Delimiter! */ -& return AND2; /* NOT a Delimiter! */ -AND return AND; /* Keyword */ -XOR return XOR; /* Keyword */ -OR return OR; /* Keyword */ -NOT return NOT; /* Keyword */ -MOD return MOD; /* Keyword */ - - - /*****************************************/ - /* B 3.2.2 Subprogram Control Statements */ - /*****************************************/ -:= return ASSIGN; /* Delimiter */ -=> return SENDTO; /* Delimiter */ -RETURN return RETURN; /* Keyword */ - - - /********************************/ - /* B 3.2.3 Selection Statements */ - /********************************/ -IF return IF; /* Keyword */ -THEN return THEN; /* Keyword */ -ELSIF return ELSIF; /* Keyword */ -ELSE return ELSE; /* Keyword */ -END_IF return END_IF; /* Keyword */ - -CASE return CASE; /* Keyword */ -OF return OF; /* Keyword */ -ELSE return ELSE; /* Keyword */ -END_CASE return END_CASE; /* Keyword */ - - - /********************************/ - /* B 3.2.4 Iteration Statements */ - /********************************/ -FOR return FOR; /* Keyword */ -TO return TO; /* Keyword */ -BY return BY; /* Keyword */ -DO return DO; /* Keyword */ -END_FOR return END_FOR; /* Keyword */ - -WHILE return WHILE; /* Keyword */ -DO return DO; /* Keyword */ -END_WHILE return END_WHILE; /* Keyword */ - -REPEAT return REPEAT; /* Keyword */ -UNTIL return UNTIL; /* Keyword */ -END_REPEAT return END_REPEAT; /* Keyword */ - -EXIT return EXIT; /* Keyword */ - - - - - - - /********************************************************/ - /********************************************************/ - /********************************************************/ - /***** *****/ - /***** *****/ - /***** N O W W O R K W I T H V A L U E S *****/ - /***** *****/ - /***** *****/ - /********************************************************/ - /********************************************************/ - /********************************************************/ - - - /********************************************/ - /* B.1.4.1 Directly Represented Variables */ - /********************************************/ -{direct_variable} {yylval.ID=strdup(yytext); return get_direct_variable_token(yytext);} - - - /******************************************/ - /* B 1.4.3 - Declaration & Initialisation */ - /******************************************/ -{incompl_location} {yylval.ID=strdup(yytext); return incompl_location_token;} - - - /************************/ - /* B 1.2.3.1 - Duration */ - /************************/ -{fixed_point} {yylval.ID=strdup(yytext); return fixed_point_token;} - -{fixed_point_d} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_d_token;} -{integer_d} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_d_token;} - -{fixed_point_h} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_h_token;} -{integer_h} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_h_token;} - -{fixed_point_m} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_m_token;} -{integer_m} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_m_token;} - -{fixed_point_s} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_s_token;} -{integer_s} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_s_token;} - -{fixed_point_ms} {yylval.ID=strdup(yytext); yylval.ID[yyleng-2] = '\0'; return fixed_point_ms_token;} -{integer_ms} {yylval.ID=strdup(yytext); yylval.ID[yyleng-2] = '\0'; return integer_ms_token;} - - - /*******************************/ - /* B.1.2.2 Character Strings */ - /*******************************/ -{double_byte_character_string} {yylval.ID=strdup(yytext); return double_byte_character_string_token;} -{single_byte_character_string} {yylval.ID=strdup(yytext); return single_byte_character_string_token;} - - - /******************************/ - /* B.1.2.1 Numeric literals */ - /******************************/ -{integer} {yylval.ID=strdup(yytext); return integer_token;} -{real} {yylval.ID=strdup(yytext); return real_token;} -{binary_integer} {yylval.ID=strdup(yytext); return binary_integer_token;} -{octal_integer} {yylval.ID=strdup(yytext); return octal_integer_token;} -{hex_integer} {yylval.ID=strdup(yytext); return hex_integer_token;} - - - /*****************************************/ - /* B.1.1 Letters, digits and identifiers */ - /*****************************************/ -{identifier}/({st_whitespace})"=>" {yylval.ID=strdup(yytext); return sendto_identifier_token;} -{identifier}/({il_whitespace})"=>" {yylval.ID=strdup(yytext); return sendto_identifier_token;} -{identifier} {yylval.ID=strdup(yytext); - // printf("returning identifier...: %s, %d\n", yytext, get_identifier_token(yytext)); - return get_identifier_token(yytext);} - - - - - - - /************************************************/ - /************************************************/ - /************************************************/ - /***** *****/ - /***** *****/ - /***** T H E L E F T O V E R S . . . *****/ - /***** *****/ - /***** *****/ - /************************************************/ - /************************************************/ - /************************************************/ - - /* do the single character tokens... - * - * e.g.: ':' '(' ')' '+' '*' ... - */ -. {return yytext[0];} - - -%% - - -/***********************************/ -/* Utility function definitions... */ -/***********************************/ - -/* print the include file stack to stderr... */ -void print_include_stack(void) { - int i; - - if ((include_stack_ptr - 1) >= 0) - fprintf (stderr, "in file "); - for (i = include_stack_ptr - 1; i >= 0; i--) - fprintf (stderr, "included from file %s:%d\n", include_stack[i].filename, include_stack[i].env->lineNumber); -} - - -/* 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 - * if we return newlines back to the input stream. These newlines will be re-counted - * a second time when they are processed again by flex. - * We therefore determine how many newlines are in the text we are returning, - * and decrement the line counter acordingly... - */ - /*unsigned int i; - - for (i = n; i < strlen(yytext); i++) - if (yytext[i] == '\n') - current_tracking->lineNumber--;*/ - - /* now return all the text back to the input stream... */ - yyless(n); -} - - -/* Called by flex when it reaches the end-of-file */ -int yywrap(void) -{ - /* We reached the end of the input file... */ - - /* Should we continue with another file? */ - /* If so: - * open the new file... - * return 0; - */ - - /* to we stop processing... - * - * return 1; - */ - - - return 1; /* Stop scanning at end of input file. */ -} - - - -/*************************************/ -/* Include a main() function to test */ -/* the token parsing by flex.... */ -/*************************************/ -#ifdef TEST_MAIN - -#include "../util/symtable.hh" - -yystype yylval; -YYLTYPE yylloc; - -const char *current_filename; - - - -int get_identifier_token(const char *identifier_str) {return 0;} -int get_direct_variable_token(const char *direct_variable_str) {return 0;} - - -int main(int argc, char **argv) { - - FILE *in_file; - int res; - - if (argc == 1) { - /* Work as an interactive (command line) parser... */ - while((res=yylex())) - fprintf(stderr, "(line %d)token: %d\n", yylineno, res); - } else { - /* Work as non-interactive (file) parser... */ - if((in_file = fopen(argv[1], "r")) == NULL) { - char *errmsg = strdup2("Error opening main file ", argv[1]); - perror(errmsg); - free(errmsg); - return -1; - } - - /* parse the file... */ - yyin = in_file; - current_filename = argv[1]; - while(1) { - res=yylex(); - fprintf(stderr, "(line %d)token: %d (%s)\n", yylineno, res, yylval.ID); - } - } - - return 0; - -} -#endif diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/iec.y --- a/stage1_2/iec.y Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8219 +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 . - * - * - * 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) - * - */ - -/* - * Stage 2 - * ======= - * - * This file contains the syntax definition of the textual - * languages IL and ST, as well as the textual version of SFC. - * The syntax parser, comprising the 2nd stage of the overall - * compiler, is generated by runing bison on this file. - */ - - - - -/**********************************************************************/ -/**********************************************************************/ -/**********************************************************************/ -/**********************************************************************/ -/******* *******/ -/******* The following syntax does not have any conflicts. *******/ -/******* *******/ -/******* P L E A S E K E E P I T T H A T W A Y ! *******/ -/******* =================================================== *******/ -/******* *******/ -/**********************************************************************/ -/**********************************************************************/ -/**********************************************************************/ -/**********************************************************************/ - - - - -%{ -#include /* required for strdup() */ - - -/* declare the token parser generated by flex... */ -int yylex(void); - -/* declare the error handler defined at the end of this file */ -void yyerror (const char *error_msg); - -/* produce a more verbose parsing error message */ -#define YYERROR_VERBOSE - -/* Include debuging code. - * Printing of debug info must then be activated by setting - * the variable yydebug to 1. - */ -#define YYDEBUG 0 - - -/* file with declaration of absyntax classes... */ -#include "../absyntax/absyntax.hh" - -/* file with declaration of token constants. Generated by bison! */ -#include "iec.y.hh" - -/* The interface through which bison and flex interact. */ -#include "stage1_2_priv.hh" - - -#include "../absyntax_utils/add_en_eno_param_decl.hh" /* required for add_en_eno_param_decl_c */ - -/* an ugly hack!! - * We will probably not need it when we decide - * to cut down the abstract syntax down to size. - * We keep it as it is until we get to write - * stages 3 and 4 of the compiler. Who knows, - * we might just find out that we really do need - * the abstract syntax tree to stay as it is - * afterall! - */ -/* for each element in list_c * - * execute the code - */ -#define FOR_EACH_ELEMENT(elem, list, code) { \ - symbol_c *elem; \ - for(int i = 0; i < list->n; i++) { \ - elem = list->elements[i]; \ - code; \ - } \ -} - - - -/* Macros used to pass the line and column locations when - * creating a new object for the abstract syntax tree. - */ -#define locloc(foo) foo.first_line, foo.first_column, foo.first_file, foo.first_order, foo.last_line, foo.last_column, foo.last_file, foo.last_order -#define locf(foo) foo.first_line, foo.first_column, foo.first_file, foo.first_order -#define locl(foo) foo.last_line, foo.last_column, foo.last_file, foo.last_order - -/* Redefine the default action to take for each rule, so that the filenames are correctly processed... */ -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ - (Current).first_file = YYRHSLOC(Rhs, 1).first_file; \ - (Current).first_order = YYRHSLOC(Rhs, 1).first_order; \ - (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ - (Current).last_file = YYRHSLOC(Rhs, 1).last_file; \ - (Current).last_order = YYRHSLOC(Rhs, 1).last_order; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC(Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC(Rhs, 0).last_column; \ - (Current).first_file = (Current).last_file = \ - YYRHSLOC(Rhs, 0).last_file; \ - (Current).first_order = (Current).last_order = \ - YYRHSLOC(Rhs, 0).last_order; \ - } \ - while (0) - - -/* A macro for printing out internal parser errors... */ -#define ERROR error_exit(__FILE__,__LINE__) -/* function defined in main.cc */ -extern void error_exit(const char *file_name, int line_no); - - - -/*************************/ -/* global variables... */ -/*************************/ -/* NOTE: For some strange reason bison ver 2.3 is including these declarations - * in the iec.y.hh file, which is in turn included by flex. - * We cannot therefore define any variables over here, but merely declare - * their existance (otherwise we get errors when linking the code, since we - * would get a new variable defined each time iec.y.hh is included!). - * Even though the variables are declared 'extern' over here, they will in - * fact be defined towards the end of this same file (i.e. in the prologue) - */ - - -/* NOTE: These variable are really parameters we would like the stage2__ function to pass - * to the yyparse() function. However, the yyparse() function is created automatically - * by bison, so we cannot add parameters to this function. The only other - * option is to use global variables! yuck! - */ - -/* A global flag used to tell the parser if overloaded funtions should be allowed. - * The IEC 61131-3 standard allows overloaded funtions in the standard library, - * but disallows them in user code... - */ -extern bool allow_function_overloading; - -/* A global flag used to tell the parser whether to include the full variable location - * when printing out error messages... - */ -extern bool full_token_loc; - -/* A pointer to the root of the parsing tree that will be generated - * by bison. - */ -extern symbol_c *tree_root; - - - -/************************/ -/* forward declarations */ -/************************/ -/* The functions declared here are defined at the end of this file... */ - -/* Convert an il_operator_c into an identifier_c */ -symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator); - -/* return if current token is a syntax element */ -/* ERROR_CHECK_BEGIN */ -bool is_current_syntax_token(); -/* ERROR_CHECK_END */ - -/* print an error message */ -void print_err_msg(int first_line, - int first_column, - const char *first_filename, - long int first_order, - int last_line, - int last_column, - const char *last_filename, - long int last_order, - const char *additional_error_msg); -%} - - - - -// %glr-parser -// %expect-rr 1 - - -/* The following definitions need to be inside a '%code requires' - * so that they are also included in the header files. If this were not the case, - * YYLTYPE would be delcared as something in the iec.cc file, and another thing - * (actually the default value of YYLTYPE) in the iec.y.hh heder file. - */ -%code requires { -/* define a new data type to store the locations, so we can also store - * the filename in which the token is expressed. - */ -/* NOTE: since this code will be placed in the iec.y.hh header file, - * as well as the iec.cc file that also includes the iec.y.hh header file, - * declaring the typedef struct yyltype__local here would result in a - * compilation error when compiling iec.cc, as this struct would be - * declared twice. - * We therefore use the #if !defined YYLTYPE ... - * to make sure only the first declaration is parsed by the C++ compiler. - * - * At first glance it seems that what we really should do is delcare the - * YYLTYPE directly as an anonymous struct, thus: - * #define YYLTYPE struct{ ...} - * however, this also results in compilation errors. - * - * I (Mario) think this is kind of a hack. If you know how to - * do this re-declaration of YYLTYPE properly, please let me know! - */ -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED - typedef struct { - int first_line; - int first_column; - const char *first_file; - long int first_order; - int last_line; - int last_column; - const char *last_file; - long int last_order; - } yyltype__local; - #define YYLTYPE yyltype__local -#endif -} - - - -%union { - symbol_c *leaf; - list_c *list; - char *ID; /* token value */ -} - -/* - TODO: DO we need to define a destructor do free - memory when recovering from errors, or do the - class destructors already handle this? - Following is example on how to define - detructors, using the syntax: - %destructor { CODE } SYMBOLS -%union - { - char *string; - } - %token STRING - %type string - %destructor { free ($$); } STRING string -*/ - - - - -/*************************************/ -/* Prelimenary helpful constructs... */ -/*************************************/ -/* A token used to identify the very end of the input file - * after all includes have already been processed. - * - * Flex automatically returns the token with value 0 - * at the end of the file. We therefore specify here - * a token with that exact same value here, so we can use it - * to detect the very end of the input files. - */ -%token END_OF_INPUT 0 - -/* A bogus token that, in principle, flex MUST NEVER generate */ -/* USE 1: - * ====== - * This token is currently also being used as the default - * initialisation value of the token_id member in - * the symbol_c base class. - * - * USE 2 - * ===== - * This token may also be used in the future to remove - * mysterious reduce/reduce conflicts due to the fact - * that our grammar may not be LALR(1) but merely LR(1). - * This means that bison cannot handle it without some - * caoxing from ourselves. We will then need this token - * to do the coaxing... - */ -%token BOGUS_TOKEN_ID - -%type start - -%type any_identifier - -%token prev_declared_variable_name_token -%token prev_declared_direct_variable_token -%token prev_declared_fb_name_token -%type prev_declared_variable_name -%type prev_declared_direct_variable -%type prev_declared_fb_name - -%token prev_declared_simple_type_name_token -%token prev_declared_subrange_type_name_token -%token prev_declared_enumerated_type_name_token -%token prev_declared_array_type_name_token -%token prev_declared_structure_type_name_token -%token prev_declared_string_type_name_token - -%type prev_declared_simple_type_name -%type prev_declared_subrange_type_name -%type prev_declared_enumerated_type_name -%type prev_declared_array_type_name -%type prev_declared_structure_type_name -%type prev_declared_string_type_name - -%token prev_declared_derived_function_name_token -%token prev_declared_derived_function_block_name_token -%token prev_declared_program_type_name_token -%type prev_declared_derived_function_name -%type prev_declared_derived_function_block_name -%type prev_declared_program_type_name - - - - -/**********************************************************************************/ -/* B XXX - Things that are missing from the standard, but should have been there! */ -/**********************************************************************************/ - -/* Pragmas that our compiler will accept. - * See the comment in iec.flex for why these pragmas exist. - */ -%token disable_code_generation_pragma_token -%token enable_code_generation_pragma_token -%type disable_code_generation_pragma -%type enable_code_generation_pragma - - -/* All other pragmas that we do not support... */ -/* In most stage 4, the text inside the pragmas will simply be copied to the output file. - * This allows us to insert C code (if using stage 4 generating C code) - * inside/interningled with the IEC 61131-3 code! - */ -%token pragma_token -%type pragma - -/* The joining of all previous pragmas, i.e. any possible pragma */ -%type any_pragma - - -/* Where do these tokens belong?? They are missing from the standard! */ -/* NOTE: There are other tokens related to these 'EN' ENO', that are also - * missing from the standard. However, their location in the annex B is - * relatively obvious, so they have been inserted in what seems to us their - * correct place in order to ease understanding of the parser... - * - * please read the comment above the definition of 'variable' in section B1.4 for details. - */ -%token EN -%token ENO -%type en_identifier -%type eno_identifier - - - - -/***************************/ -/* B 0 - Programming Model */ -/***************************/ -%type library -%type library_element_declaration - - -/*******************************************/ -/* B 1.1 - Letters, digits and identifiers */ -/*******************************************/ -/* Done totally within flex... - letter - digit - octal_digit - hex_digit -*/ -%token identifier_token -%type identifier - -/*********************/ -/* B 1.2 - Constants */ -/*********************/ -%type constant -%type non_negative_constant - -/******************************/ -/* B 1.2.1 - Numeric Literals */ -/******************************/ -/* Done totally within flex... - bit -*/ -%type numeric_literal -%type integer_literal -%type signed_integer -%token integer_token -%type integer -%token binary_integer_token -%type binary_integer -%token octal_integer_token -%type octal_integer -%token hex_integer_token -%type hex_integer -%token real_token -%type real -%type signed_real -%type real_literal -// %type exponent -%type bit_string_literal -%type boolean_literal - -%token safeboolean_true_literal_token -%token safeboolean_false_literal_token -%token boolean_true_literal_token -%token boolean_false_literal_token - -%token FALSE -%token TRUE - - -/*******************************/ -/* B 1.2.2 - Character Strings */ -/*******************************/ -%token single_byte_character_string_token -%token double_byte_character_string_token - -%type character_string -%type single_byte_character_string -%type double_byte_character_string - - -/***************************/ -/* B 1.2.3 - Time Literals */ -/***************************/ -%type time_literal - - -/************************/ -/* B 1.2.3.1 - Duration */ -/************************/ -%type duration -%type interval -%type days -%type fixed_point -%type hours -%type minutes -%type seconds -%type milliseconds - -%type integer_d -%type integer_h -%type integer_m -%type integer_s -%type integer_ms -%type fixed_point_d -%type fixed_point_h -%type fixed_point_m -%type fixed_point_s -%type fixed_point_ms - -%token fixed_point_token -%token fixed_point_d_token -%token integer_d_token -%token fixed_point_h_token -%token integer_h_token -%token fixed_point_m_token -%token integer_m_token -%token fixed_point_s_token -%token integer_s_token -%token fixed_point_ms_token -%token integer_ms_token - -// %token TIME -%token T_SHARP - - -/************************************/ -/* B 1.2.3.2 - Time of day and Date */ -/************************************/ -%type time_of_day -%type daytime -%type day_hour -%type day_minute -%type day_second -%type date -%type date_literal -%type year -%type month -%type day -%type date_and_time - -// %token TIME_OF_DAY -// %token DATE -%token D_SHARP -// %token DATE_AND_TIME - - -/**********************/ -/* B 1.3 - Data Types */ -/**********************/ -/* Strangely, the following symbol does seem to be required! */ -// %type data_type_name -%type non_generic_type_name - - -/***********************************/ -/* B 1.3.1 - Elementary Data Types */ -/***********************************/ -/* NOTES: - * - * - To make the definition of bit_string_literal more - * concise, it is useful to use an extra non-terminal - * symbol (i.e. a grouping or construct) that groups the - * following elements (BYTE, WORD, DWORD, LWORD). - * Note that the definition of bit_string_type_name - * (according to the spec) includes the above elements - * and an extra BOOL. - * We could use an extra construct with the first four - * elements to be used solely in the definition of - * bit_string_literal, but with the objective of not - * having to replicate the actions (if we ever need - * to change them, they would need to be changed in both - * bit_string_type_name and the extra grouping), we - * have re-defined bit_string_type_name as only including - * the first four elements. - * In order to have our parser implement the specification - * correctly we have augmented every occurence of - * bit_string_type_name in other rules with the BOOL - * token. Since bit_string_type_name only appears in - * the rule for elementary_type_name, this does not - * seem to be a big concession to make! - * - * - We have added a helper symbol to concentrate the - * instantiation of STRING and WSTRING into a single - * location (elementary_string_type_name). - * These two elements show up in several other rules, - * but we want to create the equivalent abstract syntax - * in a single location of this file, in order to make - * possible future changes easier to edit... - */ -%type elementary_type_name -%type numeric_type_name -%type integer_type_name -%type signed_integer_type_name -%type unsigned_integer_type_name -%type real_type_name -%type date_type_name -%type bit_string_type_name -/* helper symbol to concentrate the instantiation - * of STRING and WSTRING into a single location - */ -%type elementary_string_type_name - -%token BYTE -%token WORD -%token DWORD -%token LWORD - -%token LREAL -%token REAL - -%token SINT -%token INT -%token DINT -%token LINT - -%token USINT -%token UINT -%token UDINT -%token ULINT - -%token WSTRING -%token STRING -%token BOOL - -%token TIME -%token DATE -%token DATE_AND_TIME -%token DT -%token TIME_OF_DAY -%token TOD - -/******************************************************/ -/* Symbols 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 */ -/******************************************************/ - -%token SAFEBYTE -%token SAFEWORD -%token SAFEDWORD -%token SAFELWORD - -%token SAFELREAL -%token SAFEREAL - -%token SAFESINT -%token SAFEINT -%token SAFEDINT -%token SAFELINT - -%token SAFEUSINT -%token SAFEUINT -%token SAFEUDINT -%token SAFEULINT - -%token SAFEWSTRING -%token SAFESTRING -%token SAFEBOOL - -%token SAFETIME -%token SAFEDATE -%token SAFEDATE_AND_TIME -%token SAFEDT -%token SAFETIME_OF_DAY -%token SAFETOD - -/********************************/ -/* B 1.3.2 - Generic data types */ -/********************************/ -/* Strangely, the following symbol does seem to be required! */ -// %type generic_type_name - -/* The following tokens do not seem to be used either - * but we declare them so they become reserved words... - */ -%token ANY -%token ANY_DERIVED -%token ANY_ELEMENTARY -%token ANY_MAGNITUDE -%token ANY_NUM -%token ANY_REAL -%token ANY_INT -%token ANY_BIT -%token ANY_STRING -%token ANY_DATE - - -/********************************/ -/* B 1.3.3 - Derived data types */ -/********************************/ -%type derived_type_name -%type single_element_type_name -// %type simple_type_name -// %type subrange_type_name -// %type enumerated_type_name -// %type array_type_name -// %type structure_type_name - -%type data_type_declaration -/* helper symbol for data_type_declaration */ -%type type_declaration_list -%type type_declaration -%type single_element_type_declaration - -%type simple_type_declaration -%type simple_spec_init -%type simple_specification - -%type subrange_type_declaration -%type subrange_spec_init -%type subrange_specification -%type subrange - -%type enumerated_type_declaration -%type enumerated_spec_init -%type enumerated_specification -/* helper symbol for enumerated_value */ -%type enumerated_value_list -%type enumerated_value -//%type enumerated_value_without_identifier - -%type array_type_declaration -%type array_spec_init -%type array_specification -/* helper symbol for array_specification */ -%type array_subrange_list -%type array_initialization -/* helper symbol for array_initialization */ -%type array_initial_elements_list -%type array_initial_elements -%type array_initial_element - -%type structure_type_declaration -%type structure_specification -%type initialized_structure -%type structure_declaration -/* helper symbol for structure_declaration */ -%type structure_element_declaration_list -%type structure_element_declaration -%type structure_element_name -%type structure_initialization -/* helper symbol for structure_initialization */ -%type structure_element_initialization_list -%type structure_element_initialization - -//%type string_type_name -%type string_type_declaration -/* helper symbol for string_type_declaration */ -%type string_type_declaration_size -/* helper symbol for string_type_declaration */ -%type string_type_declaration_init - -%token ASSIGN -%token DOTDOT /* ".." */ -%token TYPE -%token END_TYPE -%token ARRAY -%token OF -%token STRUCT -%token END_STRUCT - - - -/*********************/ -/* B 1.4 - Variables */ -/*********************/ -%type variable -%type symbolic_variable -/* helper symbol for prog_cnxn */ -%type any_symbolic_variable -%type variable_name - - - - -/********************************************/ -/* B.1.4.1 Directly Represented Variables */ -/********************************************/ -/* Done totally within flex... - location_prefix - size_prefix -*/ -%token direct_variable_token -//%type direct_variable - - -/*************************************/ -/* B.1.4.2 Multi-element Variables */ -/*************************************/ -%type multi_element_variable -/* helper symbol for any_symbolic_variable */ -%type any_multi_element_variable -%type array_variable -/* helper symbol for any_symbolic_variable */ -%type any_array_variable -%type subscripted_variable -/* helper symbol for any_symbolic_variable */ -%type any_subscripted_variable -%type subscript_list -%type subscript -%type structured_variable -/* helper symbol for any_symbolic_variable */ -%type any_structured_variable -%type record_variable -/* helper symbol for any_symbolic_variable */ -%type any_record_variable -%type field_selector - - -/******************************************/ -/* B 1.4.3 - Declaration & Initialisation */ -/******************************************/ -%type input_declarations -/* helper symbol for input_declarations */ -%type input_declaration_list -%type input_declaration -%type edge_declaration -/* en_param_declaration is not in the standard, but should be! */ -%type en_param_declaration -%type var_init_decl -%type var1_init_decl -%type var1_list -%type array_var_init_decl -%type structured_var_init_decl -%type fb_name_decl -/* helper symbol for fb_name_decl */ -%type fb_name_list_with_colon -/* helper symbol for fb_name_list_with_colon */ -%type var1_list_with_colon -// %type fb_name_list -// %type fb_name -%type output_declarations -%type var_output_init_decl -%type var_output_init_decl_list -/* eno_param_declaration is not in the standard, but should be! */ -%type eno_param_declaration -%type input_output_declarations -/* helper symbol for input_output_declarations */ -%type var_declaration_list -%type var_declaration -%type temp_var_decl -%type var1_declaration -%type array_var_declaration -%type structured_var_declaration -%type var_declarations -%type retentive_var_declarations -%type located_var_declarations -/* helper symbol for located_var_declarations */ -%type located_var_decl_list -%type located_var_decl -%type external_var_declarations -/* helper symbol for external_var_declarations */ -%type external_declaration_list -%type external_declaration -%type global_var_name -%type global_var_declarations -/* helper symbol for global_var_declarations */ -%type global_var_decl_list -%type global_var_decl -%type global_var_spec -%type located_var_spec_init -%type location -%type global_var_list -%type string_var_declaration -%type single_byte_string_var_declaration -%type single_byte_string_spec -%type double_byte_string_var_declaration -%type double_byte_string_spec -%type incompl_located_var_declarations -/* helper symbol for incompl_located_var_declarations */ -%type incompl_located_var_decl_list -%type incompl_located_var_decl -%type incompl_location -%type var_spec -/* helper symbol for var_spec */ -%type string_spec -/* intermediate helper symbol for: - * - non_retentive_var_decls - * - var_declarations - */ -%type var_init_decl_list - -%token incompl_location_token - -%token VAR_INPUT -%token VAR_OUTPUT -%token VAR_IN_OUT -%token VAR_EXTERNAL -%token VAR_GLOBAL -%token END_VAR -%token RETAIN -%token NON_RETAIN -%token R_EDGE -%token F_EDGE -%token AT - - -/***********************/ -/* B 1.5.1 - Functions */ -/***********************/ -// %type function_name -/* helper symbol for IL language */ -%type function_name_no_clashes -%type function_name_simpleop_clashes -//%type function_name_expression_clashes -/* helper symbols for ST language */ -//%type function_name_NOT_clashes -%type function_name_no_NOT_clashes - -//%type standard_function_name -/* helper symbols for IL language */ -%type standard_function_name_no_clashes -%type standard_function_name_simpleop_clashes -%type standard_function_name_expression_clashes -/* helper symbols for ST language */ -%type standard_function_name_NOT_clashes -%type standard_function_name_no_NOT_clashes - -%type derived_function_name -%type function_declaration -/* helper symbol for function_declaration */ -%type function_name_declaration -%type io_var_declarations -%type function_var_decls -%type function_body -%type var2_init_decl -/* intermediate helper symbol for function_declaration */ -%type io_OR_function_var_declarations_list -/* intermediate helper symbol for function_var_decls */ -%type var2_init_decl_list - -%token standard_function_name_token - -%token FUNCTION -%token END_FUNCTION -%token CONSTANT - - -/*****************************/ -/* B 1.5.2 - Function Blocks */ -/*****************************/ -%type function_block_type_name -%type standard_function_block_name -%type derived_function_block_name -%type function_block_declaration -%type other_var_declarations -%type temp_var_decls -%type non_retentive_var_decls -%type function_block_body -/* intermediate helper symbol for function_declaration */ -%type io_OR_other_var_declarations_list -/* intermediate helper symbol for temp_var_decls */ -%type temp_var_decls_list - -%token standard_function_block_name_token - -%token FUNCTION_BLOCK -%token END_FUNCTION_BLOCK -%token VAR_TEMP -// %token END_VAR -%token VAR -// %token NON_RETAIN -// %token END_VAR - - -/**********************/ -/* B 1.5.3 - Programs */ -/**********************/ -%type program_type_name -%type program_declaration -/* helper symbol for program_declaration */ -%type program_var_declarations_list - -%token PROGRAM -%token END_PROGRAM - - -/********************************************/ -/* B 1.6 Sequential Function Chart elements */ -/********************************************/ - -%type sequential_function_chart -%type sfc_network -%type initial_step -%type step -%type action_association_list -%type step_name -%type action_association -/* helper symbol for action_association */ -%type indicator_name_list -%type action_name -%type action_qualifier -%type qualifier -%type timed_qualifier -%type action_time -%type indicator_name -%type transition -%type steps -%type step_name_list -%type transition_priority -%type transition_condition -%type action -%type action_body -%type transition_name - - -// %token ASSIGN -%token ACTION -%token END_ACTION - -%token TRANSITION -%token END_TRANSITION -%token FROM -%token TO -%token PRIORITY - -%token INITIAL_STEP -%token STEP -%token END_STEP - -%token L -%token D -%token SD -%token DS -%token SL - -%token N -%token P -/* NOTE: the following two clash with the R and S IL operators. - * It will have to be handled when we include parsing of SFC... - */ -/* -%token R -%token S -*/ - - -/********************************/ -/* B 1.7 Configuration elements */ -/********************************/ -%type configuration_name -%type resource_type_name -%type configuration_declaration -// helper symbol for -// - configuration_declaration -// - resource_declaration -// -%type optional_global_var_declarations -// helper symbol for configuration_declaration -%type optional_access_declarations -// helper symbol for configuration_declaration -%type optional_instance_specific_initializations -// helper symbol for configuration_declaration -%type resource_declaration_list -%type resource_declaration -%type single_resource_declaration -// helper symbol for single_resource_declaration -%type task_configuration_list -// helper symbol for single_resource_declaration -%type program_configuration_list -%type resource_name -// %type access_declarations -// helper symbol for access_declarations -// %type access_declaration_list -// %type access_declaration -// %type access_path -// helper symbol for access_path -%type any_fb_name_list -%type global_var_reference -// %type access_name -%type program_output_reference -%type program_name -// %type direction -%type task_configuration -%type task_name -%type task_initialization -// 3 helper symbols for task_initialization -%type task_initialization_single -%type task_initialization_interval -%type task_initialization_priority - -%type data_source -%type program_configuration -// helper symbol for program_configuration -%type optional_task_name -// helper symbol for program_configuration -%type optional_prog_conf_elements -%type prog_conf_elements -%type prog_conf_element -%type fb_task -%type prog_cnxn -%type prog_data_source -%type data_sink -%type instance_specific_initializations -// helper symbol for instance_specific_initializations -%type instance_specific_init_list -%type instance_specific_init -// helper symbol for instance_specific_init -%type fb_initialization - -%type prev_declared_global_var_name -%token prev_declared_global_var_name_token - -%type prev_declared_program_name -%token prev_declared_program_name_token - -%type prev_declared_resource_name -%token prev_declared_resource_name_token - -%token prev_declared_configuration_name_token - -// %type prev_declared_task_name -// %token prev_declared_task_name_token - -%token CONFIGURATION -%token END_CONFIGURATION -%token TASK -%token RESOURCE -%token ON -%token END_RESOURCE -%token VAR_CONFIG -%token VAR_ACCESS -// %token END_VAR -%token WITH -// %token PROGRAM -// %token RETAIN -// %token NON_RETAIN -// %token PRIORITY -%token SINGLE -%token INTERVAL -%token READ_WRITE -%token READ_ONLY - - -/***********************************/ -/* B 2.1 Instructions and Operands */ -/***********************************/ -%type instruction_list -%type il_instruction -%type il_incomplete_instruction -%type label -%type il_simple_operation -// helper symbol for il_simple_operation -//%type il_simple_operator_clash_il_operand -%type il_expression -%type il_jump_operation -%type il_fb_call -%type il_formal_funct_call -// helper symbol for il_formal_funct_call -%type il_expr_operator_clash_eol_list -%type il_operand -%type il_operand_list -// helper symbol for il_simple_operation -%type il_operand_list2 -%type simple_instr_list -%type il_simple_instruction -%type il_param_list -%type il_param_instruction_list -%type il_param_instruction -%type il_param_last_instruction -%type il_param_assignment -%type il_param_out_assignment - -%token EOL - - -/*******************/ -/* B 2.2 Operators */ -/*******************/ -%token sendto_identifier_token -%type sendto_identifier - -%type LD_operator -%type LDN_operator -%type ST_operator -%type STN_operator -%type NOT_operator -%type S_operator -%type R_operator -%type S1_operator -%type R1_operator -%type CLK_operator -%type CU_operator -%type CD_operator -%type PV_operator -%type IN_operator -%type PT_operator -%type AND_operator -%type AND2_operator -%type OR_operator -%type XOR_operator -%type ANDN_operator -%type ANDN2_operator -%type ORN_operator -%type XORN_operator -%type ADD_operator -%type SUB_operator -%type MUL_operator -%type DIV_operator -%type MOD_operator -%type GT_operator -%type GE_operator -%type EQ_operator -%type LT_operator -%type LE_operator -%type NE_operator -%type CAL_operator -%type CALC_operator -%type CALCN_operator -%type RET_operator -%type RETC_operator -%type RETCN_operator -%type JMP_operator -%type JMPC_operator -%type JMPCN_operator - -%type il_simple_operator -%type il_simple_operator_clash -%type il_simple_operator_clash1 -%type il_simple_operator_clash2 -%type il_simple_operator_noclash - -//%type il_expr_operator -%type il_expr_operator_clash -%type il_expr_operator_noclash - -%type il_assign_operator -%type il_assign_out_operator -%type il_call_operator -%type il_return_operator -%type il_jump_operator - - -%token LD -%token LDN -%token ST -%token STN -%token NOT -%token S -%token R -%token S1 -%token R1 -%token CLK -%token CU -%token CD -%token PV -%token IN -%token PT -%token AND -%token AND2 /* character '&' in the source code*/ -%token OR -%token XOR -%token ANDN -%token ANDN2 /* characters '&N' in the source code */ -%token ORN -%token XORN -%token ADD -%token SUB -%token MUL -%token DIV -%token MOD -%token GT -%token GE -%token EQ -%token LT -%token LE -%token NE -%token CAL -%token CALC -%token CALCN -%token RET -%token RETC -%token RETCN -%token JMP -%token JMPC -%token JMPCN - -%token SENDTO /* "=>" */ - - -/***********************/ -/* B 3.1 - Expressions */ -/***********************/ -/* NOTE: - * - * - unary_operator, multiply_operator, - * add_operator and comparison_operator - * are not required. Their values are integrated - * directly into other rules... - */ -%type expression -%type xor_expression -%type and_expression -%type comparison -%type equ_expression -// %type comparison_operator -%type add_expression -// %type add_operator -%type term -// %type multiply_operator -%type power_expression -%type unary_expression -// %type unary_operator -%type primary_expression -%type non_negative_primary_expression -/* intermediate helper symbol for primary_expression */ -%type function_invocation - -// %token AND -// %token XOR -// %token OR -// %token MOD -// %token NOT -%token OPER_NE -%token OPER_GE -%token OPER_LE -%token OPER_EXP - - -/********************/ -/* B 3.2 Statements */ -/********************/ -%type statement_list -%type statement - - - -/*********************************/ -/* B 3.2.1 Assignment Statements */ -/*********************************/ -%type assignment_statement -// %token ASSIGN /* ":=" */ - - -/*****************************************/ -/* B 3.2.2 Subprogram Control Statements */ -/*****************************************/ -%type subprogram_control_statement -%type return_statement -%type fb_invocation -// %type param_assignment -%type param_assignment_formal -%type param_assignment_nonformal -/* helper symbols for fb_invocation */ -%type param_assignment_formal_list -%type param_assignment_nonformal_list - -// %token ASSIGN -// %token SENDTO /* "=>" */ -%token RETURN - - -/********************************/ -/* B 3.2.3 Selection Statements */ -/********************************/ -%type selection_statement -%type if_statement -%type case_statement -%type case_element -%type case_list -%type case_list_element -/* helper symbol for if_statement */ -%type elseif_statement_list -/* helper symbol for elseif_statement_list */ -%type elseif_statement -/* helper symbol for case_statement */ -%type case_element_list - -%token IF -%token THEN -%token ELSIF -%token ELSE -%token END_IF - -%token CASE -// %token OF -// %token ELSE -%token END_CASE - - - -/********************************/ -/* B 3.2.4 Iteration Statements */ -/********************************/ -%type iteration_statement -%type for_statement -%type control_variable -%type while_statement -%type repeat_statement -%type exit_statement -/* Integrated directly into for_statement */ -// %type for_list - -%token FOR -// %token ASSIGN -// %token TO -%token BY -%token DO -%token END_FOR - -%token WHILE -// %token DO -%token END_WHILE - -%token REPEAT -%token UNTIL -%token END_REPEAT - -%token EXIT - - -%% - - - - -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ -/********************************************************/ - - -start: - library {$$ = $1;} -; - - -/**********************************************************************************/ -/* B XXX - Things that are missing from the standard, but should have been there! */ -/**********************************************************************************/ - - -/* the pragmas... */ - - -disable_code_generation_pragma: - disable_code_generation_pragma_token {$$ = new disable_code_generation_pragma_c(locloc(@$));} - -enable_code_generation_pragma: - enable_code_generation_pragma_token {$$ = new enable_code_generation_pragma_c(locloc(@$));} - -pragma: - pragma_token {$$ = new pragma_c($1, locloc(@$));} - -any_pragma: - disable_code_generation_pragma -| enable_code_generation_pragma -| pragma -; - - -/* EN/ENO */ -/* Tese tokens are essentially used as variable names, so we handle them - * similarly to these... - */ -en_identifier: - EN {$$ = new identifier_c("EN", locloc(@$));} -; - -eno_identifier: - ENO {$$ = new identifier_c("ENO", locloc(@$));} -; - - - -/*************************************/ -/* Prelimenary helpful constructs... */ -/*************************************/ - -/* NOTE: - * short version: - * identifier is used for previously undeclared identifiers - * any_identifier is used when any identifier, previously - * declared or not, is required in the syntax. - * - * long version: - * When flex comes across an identifier, it first - * searches through the currently declared variables, - * functions, types, etc... to determine if it has - * been previously declared. - * Only if the identifier has not yet been declared - * will it return an identifier_token (later turned into - * an identifier symbol by the bison generated syntax parser). - * - * Some constructs in the syntax, such as when calling - * a function 'F(var1 := 1; var2 := 2);', will accept _any_ - * identifier in 'var1', even if it has been previously - * declared in the current scope, since var1 belongs to - * another scope (the variables declared in function F). - * - * For the above reason, we need to define the symbol - * any_identifier. All the symbols that may become an - * any_identifier are expected to be stored in the - * abstract syntax as a identifier_c - */ -/* NOTE: - * Type names, function names, function block type names and - * program type names are considerd keywords once they are defined, - * so may no longer be used for variable names! - * BUT the spec is confusing on this issue, as it is not clear when - * a function name should be considered as defined. If it is to be - * considered defined only from the location from where it is declared - * and onwards, it means that before it is declared its name may be - * used for variable names! - * This means that we must allow names previously used for functions - * (et. al.) to also constitue an any_identifier! - */ -any_identifier: - identifier -| prev_declared_fb_name -| prev_declared_variable_name -/**/ -| prev_declared_enumerated_type_name -| prev_declared_simple_type_name -| prev_declared_subrange_type_name -| prev_declared_array_type_name -| prev_declared_structure_type_name -| prev_declared_string_type_name -| prev_declared_derived_function_name -| prev_declared_derived_function_block_name -| prev_declared_program_type_name -/**/ -| prev_declared_resource_name -| prev_declared_program_name -| prev_declared_global_var_name -; - - -prev_declared_variable_name: prev_declared_variable_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_fb_name: prev_declared_fb_name_token {$$ = new identifier_c($1, locloc(@$));}; - -prev_declared_simple_type_name: prev_declared_simple_type_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_subrange_type_name: prev_declared_subrange_type_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_enumerated_type_name: prev_declared_enumerated_type_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_array_type_name: prev_declared_array_type_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_structure_type_name: prev_declared_structure_type_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_string_type_name: prev_declared_string_type_name_token {$$ = new identifier_c($1, locloc(@$));}; - -prev_declared_derived_function_name: prev_declared_derived_function_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_derived_function_block_name: prev_declared_derived_function_block_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_program_type_name: prev_declared_program_type_name_token {$$ = new identifier_c($1, locloc(@$));}; - - - -/***************************/ -/* B 0 - Programming Model */ -/***************************/ -library: - /* empty */ - {if (tree_root == NULL) - tree_root = new library_c(); - $$ = (list_c *)tree_root; - } -| library library_element_declaration - {$$ = $1; $$->add_element($2);} -| library any_pragma - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| library error library_element_declaration - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unknown syntax error."); yyerrok;} -| library error END_OF_INPUT - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unknown syntax error."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -library_element_declaration: - data_type_declaration -| function_declaration -| function_block_declaration -| program_declaration -| configuration_declaration -; - - - -/*******************************************/ -/* B 1.1 - Letters, digits and identifiers */ -/*******************************************/ -/* NOTE: the spec defines identifier as: - * identifier ::= (letter|('_' (letter|digit))) {['_'] (letter|digit)} - * In essence, any sequence of letters or digits, starting with a letter - * or '_'. - * - * On section 2.1.3 (pg 26) , the spec states - * "The keywords listed in annex C shall not be used for any other purpose, - * e.g., variable names or extensions as defined in 1.5.1." - * (NOTE: the spec itself does not follow this rule, as it defines standard - * functions with names identidal to keywords, e.g. 'MOD', 'NOT' !!. This is - * another issue altogether, and is worked around somewhere else...) - * - * This means that we must re-define indentifier so as to exclude - * any keywords defined in annex C. - * - * Note also that the list includes - * - Data type names - * - Function names - * - Function Block names - * This means that any named used for a function name, data type name - * or function block name, essentially becomes a keyword, and may therefore - * no longer be re-used for any other use! (see NOTE 2) - * - * In our case, excluding the keywords is achieved in the lexical parser, - * by two mechanisms: - * (1) giving higher priority to the keywords (tokens) than to identifiers, - * so when the lexical parser finds a keyword it will be parsed as a - * token before being parsed as an identifier. - * (2) when an identifier is found that is not a keyword, the lexical parser - * then looks in the global symbol table, and will not return an identifier - * if the name has been previously used as a data type name, function name, - * or function block name! (In these cases it will return a - * prev_declared_function_name_token, etc...). - * - * Unfortunately, the language (especially IL) uses tokens that are - * not defined as keywords in the spec (e.g. 'IN', 'R1', 'S1', 'PT', etc...)! - * This means that it is valid to name a function 'IN', a variable 'PT', etc... - * In order to solve this potential ambiguity, flex only parses the above - * identifiers as keywords / tokens if we are currently parsing IL code. - * When parsing all code other than IL code, the above identifiers are treated - * just like any other identifier. - * - * - * - * - * NOTE 2: - * I (Mario) find it strange that the writers of the spec really want - * names previously used for function names, data type names or function - * block names, to become full fledged keywords. I understand that they - * do not want these names being used as variable names, but how about - * enumeration values? How about structure element names? - * If we interpret the spec literally, these would not be accepted, - * which would probably burden the programmer quite a bit, in making sure - * all these name don't clash! - * - * - * - * NOTE 3: The keywords, as specified in Annex C are... - * - * - Data type names - * - Function names - * - Function Block names - * - ACTION...END_ACTION - * - ARRAY...OF - * - AT - * - CASE...OF...ELSE...END_CASE - * - CONFIGURATION...END_CONFIGURATION - * - CONSTANT - * - EN, ENO - * - EXIT - * - FALSE - * - F_EDGE - * - FOR...TO...BY...DO...END_FOR - * - FUNCTION...END_FUNCTION - * - FUNCTION_BLOCK...END_FUNCTION_BLOCK - * - IF...THEN...ELSIF...ELSE...END_IF - * - INITIAL_STEP...END_STEP - * - NOT, MOD, AND, XOR, OR - * - PROGRAM...WITH... - * - PROGRAM...END_PROGRAM - * - R_EDGE - * - READ_ONLY, READ_WRITE - * - REPEAT...UNTIL...END_REPEAT - * - RESOURCE...ON...END_RESOURCE - * - RETAIN, NON_RETAIN - * - RETURN - * - STEP...END_STEP - * - STRUCT...END_STRUCT - * - TASK - * - TRANSITION...FROM...TO...END_TRANSITION - * - TRUE - * - TYPE...END_TYPE - * - VAR...END_VAR - * - VAR_INPUT...END_VAR - * - VAR_OUTPUT...END_VAR - * - VAR_IN_OUT...END_VAR - * - VAR_TEMP...END_VAR - * - VAR_EXTERNAL...END_VAR - * - VAR_ACCESS...END_VAR - * - VAR_CONFIG...END_VAR - * - VAR_GLOBAL...END_VAR - * - WHILE...DO...END_WHILE - * - WITH - */ - -identifier: - identifier_token {$$ = new identifier_c($1, locloc(@$));} -; - - - -/*********************/ -/* B 1.2 - Constants */ -/*********************/ -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 -/* 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 */ /* NOTE: already included as a signed integer! */ -| signed_integer -| binary_integer -| octal_integer -| hex_integer -; - - -/* 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!) - */ -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 -; - - -/******************************/ -/* B 1.2.1 - Numeric Literals */ -/******************************/ -/* NOTES: - * - * - integer is parsed by flex, but signed_integer - * is parsed by bison. Flex cannot parse a signed - * integer correctly! For example: '123+456' - * would be parsed by flex as an {integer} {signed_integer} - * instead of {integer} '+' {integer} - * - * - Neither flex nor bison can parse a real_literal - * completely (and correctly). - * Note that we cannot use the definition of real in bison as - * real: signed_integer '.' integer [exponent] - * exponent: {'E'|'e'} ['+'|'-'] integer - * because 123e45 would be parsed by flex as - * integer (123) identifier (e45). - * I.e., flex never hands over an 'e' directly to - * bison, but rather interprets it as an identifier. - * I guess we could jump through hoops and get it - * working in bison, but the following alternative - * seems more straight forward... - * - * We therefore had to break up the definition of - * real_literal in discrete parts: - * real_literal: [real_type_name '#'] singned_real - * signed_real: ['+'|'-'] real - * Flex handles real, while bison handles signed_real - * and real_literal. - * - * - According to the spec, integer '.' integer - * may be reduced to either a real or a fixed_point. - * It is nevertheless possible to figure out from the - * context which of the two rules should be used in - * the reduction. - * Unfortunately, due to the issue described above - * regarding the exponent of a real, the syntax - * integer '.' integer - * must be parsed by flex as a single token (i.e. - * fixed_point_token). This means we must add fixed_point - * to the definition of real! - * - * - The syntax also uses a construct - * fixed_point: integer ['.' integer] - * Notice that real is not defined based on fixed point, - * but rather off integer thus: - * real: integer '.' integer [exponent] - * This means that a real may not be composed of a single - * integer, unlike the construct fixed_point! - * This also means that a - * integer '.' integer - * could be reduced to either a real or a fixed_point - * construct. It is probably possible to decide by looking - * at the context, BUT: - * Unfortunatley, due to the reasons explained way above, - * a real (with an exponent) has to be handled by flex as a - * whole. This means that we cannot leave to bison (the syntax - * parser) the decision of how to reduce an - * integer '.' integer - * (either to real or to fixed_point) - * The decision on how to reduce it would need to be done by - * ther lexical analyser (i.e. flex). But flex cannot do this - * sort of thing. - * The solution I (Mario) adopted is to have flex return - * a real_token on (notice that exponent is no longer optional) - * integer '.' integer exponent - * and to return a fixed_point_token when it finds - * integer '.' integer - * We now redefine real and fixed_point to be - * fixed_point: fixed_point_token | integer - * real: real_token | fixed_point_token - */ -real: - real_token {$$ = new real_c($1, locloc(@$));} -| fixed_point_token {$$ = new real_c($1, locloc(@$));} -; - -integer: integer_token {$$ = new integer_c($1, locloc(@$));}; -binary_integer: binary_integer_token {$$ = new binary_integer_c($1, locloc(@$));}; -octal_integer: octal_integer_token {$$ = new octal_integer_c($1, locloc(@$));}; -hex_integer: hex_integer_token {$$ = new hex_integer_c($1, locloc(@$));}; - -numeric_literal: - integer_literal -| real_literal -; - - -integer_literal: - integer_type_name '#' signed_integer - {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} -| integer_type_name '#' binary_integer - {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} -| integer_type_name '#' octal_integer - {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} -| integer_type_name '#' hex_integer - {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} -/* NOTE: see note in the definition of constant for reason - * why signed_integer, binary_integer, octal_integer - * and hex_integer are missing here! - */ -/* 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++;} -| integer_type_name binary_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;} -| integer_type_name octal_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;} -| integer_type_name hex_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;} -| integer_type_name '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for integer literal.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for integer literal."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -signed_integer: - integer -| '+' integer {$$ = $2;} -| '-' integer {$$ = new neg_integer_c($2, locloc(@$));} -; - - -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 - {$$ = new real_literal_c($1, $3, locf(@1), locl(@3));} -/* ERROR_CHECK_BEGIN */ -| real_type_name signed_real - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between real type name and value in real literal."); yynerrs++;} -| real_type_name '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for real literal.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for real literal."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -signed_real: - real -| '+' real {$$ = $2;} -| '-' real {$$ = new neg_real_c($2, locloc(@2));} -; - - - -bit_string_literal: - bit_string_type_name '#' integer /* i.e. unsigned_integer */ - {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} -| bit_string_type_name '#' binary_integer - {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} -| bit_string_type_name '#' octal_integer - {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} -| bit_string_type_name '#' hex_integer - {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} -/* NOTE: see note in the definition of constant for reason - * why unsigned_integer, binary_integer, octal_integer - * and hex_integer are missing here! - */ -/* NOTE: see note under the B 1.2.1 section of token - * and grouping type definition for reason why the use of - * bit_string_type_name, although seemingly incorrect, is - * really correct here! - */ -/* ERROR_CHECK_BEGIN */ -| bit_string_type_name integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} -| bit_string_type_name binary_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} -| bit_string_type_name octal_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} -| bit_string_type_name hex_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} -| bit_string_type_name '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for bit string literal.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for bit string literal."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -boolean_literal: - boolean_true_literal_token - {$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)), - new boolean_true_c(locloc(@$)), - locloc(@$)); - } -| boolean_false_literal_token - {$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)), - new boolean_false_c(locloc(@$)), - locloc(@$)); - } -| safeboolean_true_literal_token - {$$ = new boolean_literal_c(new safebool_type_name_c(locloc(@$)), - new boolean_true_c(locloc(@$)), - locloc(@$)); - } -| safeboolean_false_literal_token - {$$ = new boolean_literal_c(new safebool_type_name_c(locloc(@$)), - new boolean_false_c(locloc(@$)), - locloc(@$)); - } -| FALSE - {$$ = new boolean_literal_c(NULL, - new boolean_false_c(locloc(@$)), - locloc(@$)); - } -| TRUE - {$$ = new boolean_literal_c(NULL, - new boolean_true_c(locloc(@$)), - locloc(@$)); - } -/* -| BOOL '#' '1' {} -| BOOL '#' '0' {} -*/ -/* NOTE: the rules - * BOOL '#' '1' - * and - * BOOL '#' '0' - * do not work as expected... - * Consider that we are using 'BOOL' and '#' as tokens - * that flex hands over to bison (yacc). Because flex would - * then parse the single '1' or '0' as an integer, - * the rule in bison would have to be - * BOOL '#' integer, followed by verifying of the - * integer has the correct value! - * - * We therefore have flex return TRUE whenever it - * comes across 'TRUE' or 'BOOL#1', and FALSE whenever - * it comes across 'FALSE' or 'BOOL#0'. - * Note that this means that flex will parse "BOOL#01" - * as FALSE followed by an integer ('1'). - * Bison should detect this as an error, so we should - * be OK. - * - * Another option would be to change the rules to accept - * BOOL '#' integer - * but then check whether the integer has a correct - * value! At the moment I feel that the first option - * is more straight forward. - */ -; - - - -/*******************************/ -/* B 1.2.2 - Character Strings */ -/*******************************/ -/* Transform the tokens given us by flex into leafs */ -single_byte_character_string: single_byte_character_string_token - {$$ = new single_byte_character_string_c($1, locloc(@$));}; - -double_byte_character_string: double_byte_character_string_token - {$$ = new double_byte_character_string_c($1, locloc(@$));}; - - -character_string: - single_byte_character_string -| double_byte_character_string -; - - - - - -/***************************/ -/* B 1.2.3 - Time Literals */ -/***************************/ -time_literal: - time_of_day -| date -| date_and_time -| duration -; - - -/************************/ -/* B 1.2.3.1 - Duration */ -/************************/ -duration: -/* (T | TIME) '#' ['-'] interval */ -/* NOTE: since TIME is also a data type, it is a keyword - * and may therefore be handled by a token. - * - * Unfortunately T is not a data type, and therefore - * not a keyword. This means that we may have variables named T! - * Flex cannot return the token TIME when it comes across a single T! - * - * We therefore have flex returning the token T_SHARP - * when it comes across 'T#' - */ - TIME '#' interval - {$$ = new duration_c(new time_type_name_c(locloc(@1)), NULL, $3, locloc(@$));} -| TIME '#' '-' interval - {$$ = new duration_c(new time_type_name_c(locloc(@1)), new neg_time_c(locloc(@$)), $4, locloc(@$));} -| T_SHARP interval - {$$ = new duration_c(new time_type_name_c(locloc(@1)), NULL, $2, locloc(@$));} -| T_SHARP '-' interval - {$$ = new duration_c(new time_type_name_c(locloc(@1)), new neg_time_c(locloc(@$)), $3, locloc(@$));} -| SAFETIME '#' interval - {$$ = new duration_c(new safetime_type_name_c(locloc(@1)), NULL, $3, locloc(@$));} -| SAFETIME '#' '-' interval - {$$ = new duration_c(new safetime_type_name_c(locloc(@1)), new neg_time_c(locloc(@$)), $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| TIME interval - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} -| TIME '-' interval - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} -| TIME '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for duration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yyclearin;} - yyerrok; - } -| T_SHARP error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for duration.");} - else {print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -interval: - days -| hours -| minutes -| seconds -| milliseconds -; - -integer_d: integer_d_token {$$ = new integer_c($1, locloc(@$));}; -integer_h: integer_h_token {$$ = new integer_c($1, locloc(@$));}; -integer_m: integer_m_token {$$ = new integer_c($1, locloc(@$));}; -integer_s: integer_s_token {$$ = new integer_c($1, locloc(@$));}; -integer_ms: integer_ms_token {$$ = new integer_c($1, locloc(@$));}; - -fixed_point_d: - fixed_point_d_token - {$$ = new fixed_point_c($1, locloc(@$));} -| integer_d -; - -fixed_point_h: - fixed_point_h_token - {$$ = new fixed_point_c($1, locloc(@$));} -| integer_h -; - -fixed_point_m: - fixed_point_m_token - {$$ = new fixed_point_c($1, locloc(@$));} -| integer_m -; - -fixed_point_s: - fixed_point_s_token - {$$ = new fixed_point_c($1, locloc(@$));} -| integer_s -; - -fixed_point_ms: - fixed_point_ms_token - {$$ = new fixed_point_c($1, locloc(@$));} -| integer_ms -; - - -fixed_point: - fixed_point_token - {$$ = new fixed_point_c($1, locloc(@$));} -| integer -; - - -days: -/* fixed_point ('d') */ - fixed_point_d - {$$ = new days_c($1, NULL, locloc(@$));} -/*| integer ('d') ['_'] hours */ -| integer_d hours - {$$ = new days_c($1, $2, locloc(@$));} -| integer_d '_' hours - {$$ = new days_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| integer_d '_' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for hours in duration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for hours in duration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -hours: -/* fixed_point ('h') */ - fixed_point_h - {$$ = new hours_c($1, NULL, locloc(@$));} -/*| integer ('h') ['_'] minutes */ -| integer_h minutes - {$$ = new hours_c($1, $2, locloc(@$));} -| integer_h '_' minutes - {$$ = new hours_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| integer_h '_' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for minutes in duration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for minutes in duration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ - -; - -minutes: -/* fixed_point ('m') */ - fixed_point_m - {$$ = new minutes_c($1, NULL, locloc(@$));} -/*| integer ('m') ['_'] seconds */ -| integer_m seconds - {$$ = new minutes_c($1, $2, locloc(@$));} -| integer_m '_' seconds - {$$ = new minutes_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| integer_m '_' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for seconds in duration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for seconds in duration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -seconds: -/* fixed_point ('s') */ - fixed_point_s - {$$ = new seconds_c($1, NULL, locloc(@$));} -/*| integer ('s') ['_'] milliseconds */ -| integer_s milliseconds - {$$ = new seconds_c($1, $2, locloc(@$));} -| integer_s '_' milliseconds - {$$ = new seconds_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| integer_s '_' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for milliseconds in duration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for milliseconds in duration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -milliseconds: -/* fixed_point ('ms') */ - fixed_point_ms - {$$ = new milliseconds_c($1, locloc(@$));} -; - - - -/************************************/ -/* B 1.2.3.2 - Time of day and Date */ -/************************************/ -time_of_day: - TIME_OF_DAY '#' daytime - {$$ = new time_of_day_c(new tod_type_name_c(locloc(@1)), $3, locloc(@$));} -| SAFETIME_OF_DAY '#' daytime - {$$ = new time_of_day_c(new safetod_type_name_c(locloc(@1)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| TIME_OF_DAY daytime - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME_OF_DAY' and daytime in time of day."); yynerrs++;} -| TIME_OF_DAY '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for time of day.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for time of day."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -daytime: - day_hour ':' day_minute ':' day_second - {$$ = new daytime_c($1, $3, $5, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| ':' day_minute ':' day_second - {$$ = NULL; print_err_msg(locf(@1), locl(@4), "no value defined for hours in daytime."); yynerrs++;} -| error ':' day_minute ':' day_second - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid value defined for hours in daytime."); yyerrok;} -| day_hour day_minute ':' day_second - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between hours and minutes in daytime."); yynerrs++;} -| day_hour ':' ':' day_second - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for minutes in daytime."); yynerrs++;} -| day_hour ':' error ':' day_second - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value defined for minutes in daytime."); yyerrok;} -| day_hour ':' day_minute day_second - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "':' missing between minutes and seconds in daytime."); yynerrs++;} -| day_hour ':' day_minute ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for seconds in daytime.");} - else {print_err_msg(locf(@5), locl(@5), "invalid value for seconds in daytime."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -day_hour: integer; -day_minute: integer; -day_second: fixed_point; - - -date: - DATE '#' date_literal - {$$ = new date_c(new date_type_name_c(locloc(@1)), $3, locloc(@$));} -| D_SHARP date_literal - {$$ = new date_c(new date_type_name_c(locloc(@1)), $2, locloc(@$));} -| SAFEDATE '#' date_literal - {$$ = new date_c(new safedate_type_name_c(locloc(@1)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| DATE date_literal - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'DATE' and date literal in date."); yynerrs++;} -| DATE '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for date.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for date."); yyclearin;} - yyerrok; - } -| D_SHARP error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for date.");} - else {print_err_msg(locf(@2), locl(@2), "invalid value for date."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -date_literal: - year '-' month '-' day - {$$ = new date_literal_c($1, $3, $5, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| '-' month '-' day - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no value defined for year in date literal."); yynerrs++;} -| year month '-' day - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'-' missing between year and month in date literal."); yynerrs++;} -| year '-' '-' day - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for month in date literal."); yynerrs++;} -| year '-' error '-' day - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value defined for month in date literal."); yyerrok;} -| year '-' month day - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "'-' missing between month and day in date literal."); yynerrs++;} -| year '-' month '-' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for day in date literal.");} - else {print_err_msg(locf(@5), locl(@5), "invalid value for day in date literal."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -year: integer; -month: integer; -day: integer; - - -date_and_time: - DATE_AND_TIME '#' date_literal '-' daytime - {$$ = new date_and_time_c(new dt_type_name_c(locloc(@1)), $3, $5, locloc(@$));} -| SAFEDATE_AND_TIME '#' date_literal '-' daytime - {$$ = new date_and_time_c(new safedt_type_name_c(locloc(@1)), $3, $5, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| DATE_AND_TIME date_literal '-' daytime - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'DATE_AND_TIME' and date literal in date and time."); yynerrs++;} -| DATE_AND_TIME '#' '-' daytime - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for date literal in date and time."); yynerrs++;} -| DATE_AND_TIME '#' error '-' daytime - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for date literal in date and time."); yyerrok;} -| DATE_AND_TIME '#' date_literal daytime - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "'-' missing between date literal and daytime in date and time."); yynerrs++;} -| DATE_AND_TIME '#' date_literal '-' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for daytime in date and time.");} - else {print_err_msg(locf(@5), locl(@5), "invalid value for daytime in date and time."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - - - - -/**********************/ -/* B 1.3 - Data Types */ -/**********************/ -/* Strangely, the following symbol does seem to be required! */ -/* -data_type_name: - non_generic_type_name -| generic_type_name -; -*/ - -non_generic_type_name: - elementary_type_name -| derived_type_name -; - - - -/***********************************/ -/* B 1.3.1 - Elementary Data Types */ -/***********************************/ - /******************************************************/ - /* SAFExxxx Symbols 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 */ - /******************************************************/ - -elementary_type_name: - numeric_type_name -| date_type_name -| bit_string_type_name -| elementary_string_type_name -| TIME {$$ = new time_type_name_c(locloc(@$));} -| BOOL {$$ = new bool_type_name_c(locloc(@$));} -/* NOTE: see note under the B 1.2.1 section of token - * and grouping type definition for reason why BOOL - * was added to this definition. - */ -| SAFETIME {$$ = new safetime_type_name_c(locloc(@$));} -| SAFEBOOL {$$ = new safebool_type_name_c(locloc(@$));} -; - -numeric_type_name: - integer_type_name -| real_type_name -; - -integer_type_name: - signed_integer_type_name -| unsigned_integer_type_name -; - -signed_integer_type_name: - SINT {$$ = new sint_type_name_c(locloc(@$));} -| INT {$$ = new int_type_name_c(locloc(@$));} -| DINT {$$ = new dint_type_name_c(locloc(@$));} -| LINT {$$ = new lint_type_name_c(locloc(@$));} -| SAFESINT {$$ = new safesint_type_name_c(locloc(@$));} -| SAFEINT {$$ = new safeint_type_name_c(locloc(@$));} -| SAFEDINT {$$ = new safedint_type_name_c(locloc(@$));} -| SAFELINT {$$ = new safelint_type_name_c(locloc(@$));} -; - -unsigned_integer_type_name: - USINT {$$ = new usint_type_name_c(locloc(@$));} -| UINT {$$ = new uint_type_name_c(locloc(@$));} -| UDINT {$$ = new udint_type_name_c(locloc(@$));} -| ULINT {$$ = new ulint_type_name_c(locloc(@$));} -| SAFEUSINT {$$ = new safeusint_type_name_c(locloc(@$));} -| SAFEUINT {$$ = new safeuint_type_name_c(locloc(@$));} -| SAFEUDINT {$$ = new safeudint_type_name_c(locloc(@$));} -| SAFEULINT {$$ = new safeulint_type_name_c(locloc(@$));} -; - -real_type_name: - REAL {$$ = new real_type_name_c(locloc(@$));} -| LREAL {$$ = new lreal_type_name_c(locloc(@$));} -| SAFEREAL {$$ = new safereal_type_name_c(locloc(@$));} -| SAFELREAL {$$ = new safelreal_type_name_c(locloc(@$));} -; - -date_type_name: - DATE {$$ = new date_type_name_c(locloc(@$));} -| TIME_OF_DAY {$$ = new tod_type_name_c(locloc(@$));} -| TOD {$$ = new tod_type_name_c(locloc(@$));} -| DATE_AND_TIME {$$ = new dt_type_name_c(locloc(@$));} -| DT {$$ = new dt_type_name_c(locloc(@$));} -| SAFEDATE {$$ = new safedate_type_name_c(locloc(@$));} -| SAFETIME_OF_DAY {$$ = new safetod_type_name_c(locloc(@$));} -| SAFETOD {$$ = new safetod_type_name_c(locloc(@$));} -| SAFEDATE_AND_TIME {$$ = new safedt_type_name_c(locloc(@$));} -| SAFEDT {$$ = new safedt_type_name_c(locloc(@$));} -; - - -bit_string_type_name: - BYTE {$$ = new byte_type_name_c(locloc(@$));} -| WORD {$$ = new word_type_name_c(locloc(@$));} -| DWORD {$$ = new dword_type_name_c(locloc(@$));} -| LWORD {$$ = new lword_type_name_c(locloc(@$));} -| SAFEBYTE {$$ = new safebyte_type_name_c(locloc(@$));} -| SAFEWORD {$$ = new safeword_type_name_c(locloc(@$));} -| SAFEDWORD {$$ = new safedword_type_name_c(locloc(@$));} -| SAFELWORD {$$ = new safelword_type_name_c(locloc(@$));} -/* NOTE: see note under the B 1.2.1 section of token - * and grouping type definition for reason why the BOOL - * was omitted from this definition. - */ -; - - -/* Helper symbol to concentrate the instantiation - * of STRING and WSTRING into a single location. - * - * These two elements show up in several other rules, - * but we want to create the equivalent abstract syntax - * in a single location of this file, in order to make - * possible future changes easier to edit... - */ -elementary_string_type_name: - STRING {$$ = new string_type_name_c(locloc(@$));} -| WSTRING {$$ = new wstring_type_name_c(locloc(@$));} -| SAFESTRING {$$ = new safestring_type_name_c(locloc(@$));} -| SAFEWSTRING {$$ = new safewstring_type_name_c(locloc(@$));} -; - - - -/********************************/ -/* B 1.3.2 - Generic data types */ -/********************************/ -/* Strangely, the following symbol does not seem to be required! */ -/* -generic_type_name: - ANY -| ANY_DERIVED -| ANY_ELEMENTARY -| ANY_MAGNITUDE -| ANY_NUM -| ANY_REAL -| ANY_INT -| ANY_BIT -| ANY_STRING -| ANY_DATE -; -*/ - - -/********************************/ -/* B 1.3.3 - Derived data types */ -/********************************/ - -derived_type_name: - single_element_type_name -| prev_declared_array_type_name -| prev_declared_structure_type_name -| prev_declared_string_type_name -; - -single_element_type_name: - prev_declared_simple_type_name -/* Include the following if arrays of function blocks are to be allowed! - * Since the standard does not allow them, - * we leave it commented out for the time being... - */ -//| prev_declared_derived_function_block_name -| prev_declared_subrange_type_name -| prev_declared_enumerated_type_name -; - -/* NOTE: in order to remove a reduce/reduce conflict, - * all occurences of simple_type_name, etc... - * have been replaced with identifier! - */ -/* -simple_type_name: identifier; -subrange_type_name: identifier; -enumerated_type_name: identifier; -array_type_name: identifier; -structure_type_name: identifier; -*/ - -data_type_declaration: - TYPE type_declaration_list END_TYPE - {$$ = new data_type_declaration_c($2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| TYPE END_TYPE - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no data type declared in data type(s) declaration."); yynerrs++;} -| TYPE error type_declaration_list END_TYPE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'TYPE' in data type(s) declaration."); yyerrok;} -| TYPE type_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed data type(s) declaration."); yyerrok;} -| TYPE error END_TYPE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in data type(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for data_type_declaration */ -type_declaration_list: - type_declaration ';' - {$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);} -| type_declaration_list type_declaration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new type_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid data type declaration."); yyerrok;} -| type_declaration error - {$$ = new type_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of data type declaration."); yyerrok;} -| type_declaration_list type_declaration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of data type declaration."); yyerrok;} -| type_declaration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid data type declaration."); yyerrok;} -| type_declaration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after data type declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -type_declaration: - single_element_type_declaration -| array_type_declaration -| structure_type_declaration -| string_type_declaration -; - -single_element_type_declaration: - simple_type_declaration -| subrange_type_declaration -| enumerated_type_declaration -; - -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); - } -/* ERROR_CHECK_BEGIN */ -| error ':' simple_spec_init - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for data type declaration.");yyerrok;} -| identifier simple_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in simple type declaration."); yynerrs++;} -| identifier ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in data type declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in data type declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -simple_spec_init: - simple_specification - /* The following commented line was changed to the - * next two lines so that we wouldn't - * have the first element of a simple_spec_init_c() - * pointing to another simple_spec_init_c! - */ -/* -| simple_specification ASSIGN constant - {$$ = new simple_spec_init_c($1, $3);} -*/ -| elementary_type_name ASSIGN constant - {$$ = new simple_spec_init_c($1, $3, locloc(@$));} -| prev_declared_simple_type_name ASSIGN constant - {$$ = new simple_spec_init_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| elementary_type_name constant - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in specification with initialization."); yynerrs++;} -| prev_declared_simple_type_name constant - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in specification with initialization."); yynerrs++;} -| elementary_type_name ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in specification with initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid initial value in specification with initialization."); yyclearin;} - yyerrok; - } -| prev_declared_simple_type_name ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in specification with initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid initial value in specification with initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* When converting to C/C++, we need to know whether - * the elementary_type_name is being used in a variable - * declaration or elsewhere (ex. declaration of a derived - * type), so the abstract syntax has the elementary_type_name - * wrapped inside a simple_spec_init_c. - * The exact same thing occurs with prev_declared_simple_type_name. - * - * This is why in the definition of simple_spec_init, - * simple_specification was brocken up into its - * constituent components... - */ -simple_specification: -// elementary_type_name | simple_type_name - elementary_type_name - {$$ = new simple_spec_init_c($1, NULL, locloc(@$));} -| prev_declared_simple_type_name - {$$ = new simple_spec_init_c($1, NULL, locloc(@$));} -; - - -subrange_type_declaration: -/* subrange_type_name ':' subrange_spec_init */ - identifier ':' subrange_spec_init - {$$ = new subrange_type_declaration_c($1, $3, locloc(@$)); - library_element_symtable.insert($1, prev_declared_subrange_type_name_token); - } -/* ERROR_CHECK_BEGIN */ -| error ':' subrange_spec_init - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for subrange type declaration."); yyerrok;} -| identifier subrange_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in subrange type declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -subrange_spec_init: - subrange_specification - {$$ = new subrange_spec_init_c($1, NULL, locloc(@$));} -| subrange_specification ASSIGN signed_integer - {$$ = new subrange_spec_init_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| subrange_specification signed_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in subrange specification with initialization."); yynerrs++;} -| subrange_specification ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in subrange specification with initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid initial value in subrange specification with initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -subrange_specification: - integer_type_name '(' subrange ')' - {$$ = new subrange_specification_c($1, $3, locloc(@$));} -| prev_declared_subrange_type_name - {$$ = new subrange_specification_c($1, NULL, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| integer_type_name '(' ')' - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no subrange defined in subrange specification."); yynerrs++;} -| integer_type_name '(' error ')' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid subrange defined in subrange specification."); yyerrok;} -| integer_type_name '(' subrange error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after subrange defined in subrange specification."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -subrange: - signed_integer DOTDOT signed_integer - {$$ = new subrange_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| signed_integer signed_integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'..' missing between bounds in subrange definition."); yynerrs++;} -| signed_integer DOTDOT error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for upper bound in subrange definition.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for upper bound in subrange definition."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -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); - } -/* ERROR_CHECK_BEGIN */ -| error ':' enumerated_spec_init - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for enumerated type declaration."); yyerrok;} -| identifier enumerated_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in enumerated type declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -enumerated_spec_init: - enumerated_specification - {$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));} -| enumerated_specification ASSIGN enumerated_value - {$$ = new enumerated_spec_init_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| enumerated_specification enumerated_value - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in enumerated specification with initialization."); yynerrs++;} -| enumerated_specification ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in enumerated specification with initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value in enumerated specification with initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -enumerated_specification: - '(' enumerated_value_list ')' - {$$ = $2;} -| prev_declared_enumerated_type_name -/* ERROR_CHECK_BEGIN */ -| '(' ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no enumerated value list defined in enumerated specification."); yynerrs++;} -| '(' error ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid enumerated value list defined in enumerated specification.");yyerrok;} -| '(' enumerated_value_list error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of enumerated specification."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for enumerated_specification */ -enumerated_value_list: - enumerated_value - {$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);} -| enumerated_value_list ',' enumerated_value - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| enumerated_value_list enumerated_value - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in enumerated value list.");} -| enumerated_value_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in enumerated value list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value in enumerated value list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -enumerated_value: - identifier - {$$ = new enumerated_value_c(NULL, $1, locloc(@$));} -| prev_declared_enumerated_type_name '#' any_identifier - {$$ = new enumerated_value_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| prev_declared_enumerated_type_name any_identifier - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between enumerated type name and value in enumerated literal."); yynerrs++;} -| prev_declared_enumerated_type_name '#' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for enumerated literal.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for enumerated literal."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -/* -enumerated_value_without_identifier: - prev_declared_enumerated_type_name '#' any_identifier - {$$ = new enumerated_value_c($1, $3, locloc(@$));} -; -*/ - - -array_type_declaration: -/* array_type_name ':' array_spec_init */ - identifier ':' array_spec_init - {$$ = new array_type_declaration_c($1, $3, locloc(@$)); - library_element_symtable.insert($1, prev_declared_array_type_name_token); - } -/* ERROR_CHECK_BEGIN */ -| identifier array_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in array type declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -array_spec_init: - array_specification - {$$ = new array_spec_init_c($1, NULL, locloc(@$));} -| array_specification ASSIGN array_initialization - {$$ = new array_spec_init_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| array_specification array_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in array specification with initialization."); yynerrs++;} -| array_specification ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in array specification with initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid initial value in array specification with initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -array_specification: - prev_declared_array_type_name -| ARRAY '[' array_subrange_list ']' OF non_generic_type_name - {$$ = new array_specification_c($3, $6, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| ARRAY array_subrange_list ']' OF non_generic_type_name - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'[' missing before subrange list in array specification."); yynerrs++;} -| ARRAY '[' ']' OF non_generic_type_name - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no subrange list defined in array specification."); yynerrs++;} -| ARRAY '[' error ']' OF non_generic_type_name - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid subrange list defined in array specification."); yyerrok;} -| ARRAY OF non_generic_type_name - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no subrange list defined in array specification."); yynerrs++;} -| ARRAY error OF non_generic_type_name - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid subrange list defined in array specification."); yyerrok;} -| ARRAY '[' array_subrange_list OF non_generic_type_name - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "']' missing after subrange list in array specification."); yynerrs++;} -| ARRAY '[' array_subrange_list ']' non_generic_type_name - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "'OF' missing between subrange list and item type name in array specification."); yynerrs++;} -| ARRAY '[' array_subrange_list ']' OF error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no item data type defined in array specification.");} - else {print_err_msg(locf(@3), locl(@3), "invalid item data type in array specification."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* helper symbol for array_specification */ -array_subrange_list: - subrange - {$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);} -| array_subrange_list ',' subrange - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| array_subrange_list subrange - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in subrange list."); yynerrs++;} -| array_subrange_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no subrange defined in subrange list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid subrange in subrange list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -array_initialization: - '[' array_initial_elements_list ']' - {$$ = $2;} -/* ERROR_CHECK_BEGIN */ -| '[' ']' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no initial values list defined in array initialization."); yynerrs++;} -| '[' error ']' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid initial values list defined in array initialization."); yyerrok;} -| '[' array_initial_elements_list error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "']' missing at the end of array initialization."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for array_initialization */ -array_initial_elements_list: - array_initial_elements - {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} -| array_initial_elements_list ',' array_initial_elements - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN -| array_initial_elements_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -array_initial_elements: - array_initial_element -| integer '(' ')' -| integer '(' array_initial_element ')' - {$$ = new array_initial_elements_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| integer '(' error ')' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyerrok;} -| integer '(' array_initial_element error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of array initial value in array initial values list."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -array_initial_element: - constant -| enumerated_value -| structure_initialization -| array_initialization -; - - - -structure_type_declaration: -/* structure_type_name ':' structure_specification */ - identifier ':' structure_specification - {$$ = new structure_type_declaration_c($1, $3, locloc(@$)); - library_element_symtable.insert($1, prev_declared_structure_type_name_token); - } -/* ERROR_CHECK_BEGIN */ -| identifier structure_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in structure type declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -structure_specification: - structure_declaration -| initialized_structure -; - - -initialized_structure: - prev_declared_structure_type_name - {$$ = new initialized_structure_c($1, NULL, locloc(@$));} -| prev_declared_structure_type_name ASSIGN structure_initialization - {$$ = new initialized_structure_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| prev_declared_structure_type_name structure_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structure specification with initialization."); yynerrs++;} -| prev_declared_structure_type_name ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in structure specification with initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value in structure specification with initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -structure_declaration: - STRUCT structure_element_declaration_list END_STRUCT - {$$ = $2;} -/* ERROR_CHECK_BEGIN */ -| STRUCT END_STRUCT - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no structure element declared in structure type declaration."); yynerrs++;} -| STRUCT error structure_element_declaration_list END_STRUCT - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'STRUCT' in structure type declaration."); yyerrok;} -| STRUCT structure_element_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed structure type declaration."); yyerrok;} -| STRUCT error END_STRUCT - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in structure type declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for structure_declaration */ -structure_element_declaration_list: - structure_element_declaration ';' - {$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);} -| structure_element_declaration_list structure_element_declaration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new structure_element_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid structure element declaration."); yyerrok;} -| structure_element_declaration error - {$$ = new structure_element_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of structure element declaration."); yyerrok;} -| structure_element_declaration_list structure_element_declaration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of structure element declaration."); yyerrok;} -| structure_element_declaration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid structure element declaration."); yyerrok;} -| structure_element_declaration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after structure element declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -structure_element_declaration: - structure_element_name ':' simple_spec_init - {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} -| structure_element_name ':' subrange_spec_init - {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} -| structure_element_name ':' enumerated_spec_init - {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} -| structure_element_name ':' array_spec_init - {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} -| structure_element_name ':' initialized_structure - {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| structure_element_name simple_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and simple specification."); yynerrs++;} -| structure_element_name subrange_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and subrange specification."); yynerrs++;} -| structure_element_name enumerated_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and enumerated specification."); yynerrs++;} -| structure_element_name array_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and array specification."); yynerrs++;} -| structure_element_name initialized_structure - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and structure specification."); yynerrs++;} -| structure_element_name ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in structure element declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in structure element declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -structure_element_name: any_identifier; - - -structure_initialization: - '(' structure_element_initialization_list ')' - {$$ = $2;} -/* ERROR_CHECK_BEGIN */ -| '(' error ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid structure element initialization list in structure initialization."); yyerrok;} -| '(' structure_element_initialization_list error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ')' at the end of structure element initialization list in structure initialization."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for structure_initialization */ -structure_element_initialization_list: - structure_element_initialization - {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} -| structure_element_initialization_list ',' structure_element_initialization - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN -| structure_element_initialization_list structure_element_initialization - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;} -| structure_element_initialization_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -structure_element_initialization: - structure_element_name ASSIGN constant - {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} -| structure_element_name ASSIGN enumerated_value - {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} -| structure_element_name ASSIGN array_initialization - {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} -| structure_element_name ASSIGN structure_initialization - {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| structure_element_name constant - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structure element initialization."); yynerrs++;} -| structure_element_name enumerated_value - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in enumerated structure element initialization."); yynerrs++;} -| structure_element_name array_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in array structure element initialization."); yynerrs++;} -| structure_element_name structure_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structured structure element initialization."); yynerrs++;} -| structure_element_name ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in structured structure element initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid initial value in structured structure element initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* NOTE: in order to remove a reduce/reduce conflict, - * all occurences of string_type_name - * have been replaced with identifier! - */ -/* -string_type_name: identifier; -*/ - -string_type_declaration: -/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */ - identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init - {$$ = new string_type_declaration_c($1, $3, $4, $5, locloc(@$)); - library_element_symtable.insert($1, prev_declared_string_type_name_token); - } -; - - -/* helper symbol for string_type_declaration */ -string_type_declaration_size: - '[' integer ']' - {$$ = $2;} -/* REMOVED !! */ -//| /* empty */ -// {$$ = NULL;} -; -/* The syntax contains a reduce/reduce conflict. - * The optional '[' ']' - * has been changed to become mandatory to remove the conflict. - * - * The conflict arises because - * new_str_type : STRING := "hello!" - * may be reduced to a string_type_declaration OR - * a simple_type_declaration. - * - * Our change forces it to be reduced to a - * simple_type_declaration! - * We chose this option because changing the definition - * of simple_spec_init would force us to change all the other - * rules in which it appears. The change we made has no - * side-effects! - */ - -/* helper symbol for string_type_declaration */ -string_type_declaration_init: - /* empty */ - {$$ = NULL;} -| ASSIGN character_string - {$$ = $2;} -; - - - -/*********************/ -/* B 1.4 - Variables */ -/*********************/ -/* NOTE: The standard is erroneous in it's definition of 'variable' because: - * - The standard considers 'ENO' as a keyword... - * - ...=> which means that it may never be parsed as an 'identifier'... - * - ...=> and therefore may never be used as the name of a variable inside an expression. - * - However, a function/FB must be able to assign the ENO parameter - * it's value, doing it in an assignment statement, and therefore using the 'ENO' - * character sequence as an identifier! - * The obvious solution is to also allow the ENO keyword to be - * used as the name of a variable. Note that this variable may be used - * even though it is not explicitly declared as a function/FB variable, - * as the standard requires us to define it implicitly in this case! - * There are three ways of achieving this: - * (i) simply not define EN and ENO as keywords in flex (lexical analyser) - * and let them be considered 'identifiers'. Aditionally, add some code - * so that if they are not explicitly declared, we add them automatically to - * the declaration of each Functions and FB, where they would then be parsed - * as a previously_declared_variable. - * This approach has the advantage the EN and ENO would automatically be valid - * in every location where it needs to be valid, namely in the explicit declaration - * of these same variables, or when they are used within expressions. - * However, this approach has the drawback that - * EN and ENO could then also be used anywhere a standard identifier is allowed, - * including in the naming of Functions, FBs, Programs, Configurations, Resources, - * SFC Actions, SFC Steps, etc... - * This would mean that we would then have to add a lexical analysis check - * within the bison code (syntax analyser) to all the above constructs to make sure - * that the identifier being used is not EN or ENO. - * (ii) The other approach is to define EN and ENO as keywords / tokens in flex - * (lexical analyser) and then change the syntax in bison to acomodate - * these tokens wherever they could correctly appear. - * This has the drawback that we need to do some changes to the synax defintion. - * (iii) Yet a another option is to mix the above two methods. - * Define EN and ENO as tokens in flex, but change (only) the syntax for - * variable declaration to allow these tokens to also be used in declaring variables. - * From this point onwards these tokens are then considered a previously_declared_variable, - * since flex will first check for this before even checking for tokens. - * - * I (Mario) cuurretnly (2011) believe the cleanest method of achieving this goal - * is to use option (iii) - * However, considering that: - * - I have already previously implemented option (ii); - * - option (iii) requires that flex parse the previously_declared_variable - * before parsing any token. We already support this (remeber that this is - * used mainly to allow some IL operators as well as PRIORITY, etc. tokens - * to be used as identifiers, since the standard does not define them as keywords), - * but this part of the code in flex is often commented out as usually people do not expect - * us to follow the standard in the strict sense, but rather consider those - * tokens as keywords; - * considering the above, we currently carry on using option (ii). - */ -variable: - symbolic_variable -| prev_declared_direct_variable -| eno_identifier - {$$ = new symbolic_variable_c($1, locloc(@$));} -; - - -symbolic_variable: -/* NOTE: To be entirely correct, variable_name must be replacemed by - * prev_declared_variable_name | prev_declared_fb_name | prev_declared_global_var_name - */ - prev_declared_fb_name - {$$ = new symbolic_variable_c($1, locloc(@$));} -| prev_declared_global_var_name - {$$ = new symbolic_variable_c($1, locloc(@$));} -| prev_declared_variable_name - {$$ = new symbolic_variable_c($1, locloc(@$));} -| multi_element_variable -/* -| identifier - {$$ = new symbolic_variable_c($1, locloc(@$));} -*/ -; - - -/* NOTE: in section B 1.7, when configuring a program, symbolic_variable - * is used. Nevertheless, during the parsing of a configuration, - * the variables in question are out of scope, so we should - * be allowing any_identifier instead of prev_declared_variable_name! - * - * We therefore need a new any_symbolic_variable construct that - * allows the use of any_identifier instead of previously declared - * variables, function blocks, etc... - */ -any_symbolic_variable: -// variable_name -> replaced by any_identifier - any_identifier - {$$ = new symbolic_variable_c($1, locloc(@$));} -| any_multi_element_variable -; - - -/* for yet undeclared variable names ! */ -variable_name: identifier; - - - - - -/********************************************/ -/* B.1.4.1 Directly Represented Variables */ -/********************************************/ -prev_declared_direct_variable: prev_declared_direct_variable_token {$$ = new direct_variable_c($1, locloc(@$));}; - - - - -/*************************************/ -/* B.1.4.2 Multi-element Variables */ -/*************************************/ -multi_element_variable: - array_variable -| structured_variable -; - -/* please see note above any_symbolic_variable */ -any_multi_element_variable: - any_array_variable -| any_structured_variable -; - - -array_variable: - subscripted_variable '[' subscript_list ']' - {$$ = new array_variable_c($1, $3, locloc(@$));} -; - -/* please see note above any_symbolic_variable */ -any_array_variable: - any_subscripted_variable '[' subscript_list ']' - {$$ = new array_variable_c($1, $3, locloc(@$));} -; - - -subscripted_variable: - symbolic_variable -; - - -/* please see note above any_symbolic_variable */ -any_subscripted_variable: - any_symbolic_variable -; - - -subscript_list: - subscript - {$$ = new subscript_list_c(locloc(@$)); $$->add_element($1);} -| subscript_list ',' subscript - {$$ = $1; $$->add_element($3);} -; - - -subscript: expression; - - -structured_variable: - record_variable '.' field_selector - {$$ = new structured_variable_c($1, $3, locloc(@$));} -; - - -/* please see note above any_symbolic_variable */ -any_structured_variable: - any_record_variable '.' field_selector - {$$ = new structured_variable_c($1, $3, locloc(@$));} -; - - - -record_variable: - symbolic_variable -; - - -/* please see note above any_symbolic_variable */ -any_record_variable: - any_symbolic_variable -; - - -field_selector: - any_identifier -| eno_identifier -; - - - - - - -/******************************************/ -/* B 1.4.3 - Declaration & Initialisation */ -/******************************************/ -input_declarations: - VAR_INPUT input_declaration_list END_VAR - {$$ = new input_declarations_c(NULL, $2, new explicit_definition_c(), locloc(@$));} -| VAR_INPUT RETAIN input_declaration_list END_VAR - {$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} -| VAR_INPUT NON_RETAIN input_declaration_list END_VAR - {$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_INPUT END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in input variable(s) declaration."); yynerrs++;} -| VAR_INPUT RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive input variable(s) declaration."); yynerrs++;} -| VAR_INPUT NON_RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive input variable(s) declaration."); yynerrs++;} -| VAR_INPUT error input_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_INPUT' in input variable(s) declaration."); yyerrok;} -| VAR_INPUT RETAIN error input_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive input variable(s) declaration."); yyerrok;} -| VAR_INPUT NON_RETAIN error input_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive input variable(s) declaration."); yyerrok;} -| VAR_INPUT input_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed input variable(s) declaration."); yyerrok;} -| VAR_INPUT RETAIN input_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive input variable(s) declaration."); yyerrok;} -| VAR_INPUT NON_RETAIN input_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive input variable(s) declaration."); yyerrok;} -| VAR_INPUT error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in input variable(s) declaration."); yyerrok;} -| VAR_INPUT RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive input variable(s) declaration."); yyerrok;} -| VAR_INPUT NON_RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non-retentive input variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for input_declarations */ -input_declaration_list: - input_declaration ';' - {$$ = new input_declaration_list_c(locloc(@$)); $$->add_element($1);} -| input_declaration_list input_declaration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new input_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid input variable(s) declaration."); yyerrok;} -| input_declaration error - {$$ = new input_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of input variable(s) declaration."); yyerrok;} -| input_declaration_list input_declaration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of input variable(s) declaration."); yyerrok;} -| input_declaration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid input variable(s) declaration."); yyerrok;} -| input_declaration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after input variable(s) declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: The formal definition of 'input_declaration' as defined in the standard is erroneous, - * as it does not allow a user defined 'EN' input parameter. However, - * The semantic description of the languages clearly states that this is allowed. - * We have added the 'en_param_declaration' clause to cover for this. - */ -input_declaration: - var_init_decl -| edge_declaration -| en_param_declaration -; - - -edge_declaration: - var1_list ':' BOOL R_EDGE - {$$ = new edge_declaration_c(new raising_edge_option_c(locloc(@3)), $1, locloc(@$));} -| var1_list ':' BOOL F_EDGE - {$$ = new edge_declaration_c(new falling_edge_option_c(locloc(@3)), $1, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list BOOL R_EDGE - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in edge declaration."); yynerrs++;} -| var1_list BOOL F_EDGE - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in edge declaration."); yynerrs++;} -| var1_list ':' BOOL R_EDGE F_EDGE - {$$ = NULL; print_err_msg(locl(@5), locf(@5), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration."); yynerrs++;} -| var1_list ':' BOOL F_EDGE R_EDGE - {$$ = NULL; print_err_msg(locl(@5), locf(@5), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration."); yynerrs++;} -| var1_list ':' R_EDGE - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in edge declaration."); yynerrs++;} -| var1_list ':' F_EDGE - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in edge declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: The formal definition of the standard is erroneous, as it simply does not - * consider the EN and ENO keywords! - * The semantic description of the languages clearly states that these may be - * used in several ways. One of them is to declare an EN input parameter. - * We have added the 'en_param_declaration' clause to cover for this. - * - * Please read the comment above the definition of 'variable' in section B1.4 for details. - */ -en_param_declaration: - en_identifier ':' BOOL ASSIGN boolean_literal - {$$ = new en_param_declaration_c($1, new bool_type_name_c(locloc(@$)), $5, new explicit_definition_c(), locloc(@$));} -| en_identifier ':' BOOL ASSIGN integer - {$$ = new en_param_declaration_c($1, new bool_type_name_c(locloc(@$)), $5, new explicit_definition_c(), locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| en_identifier BOOL ASSIGN boolean_literal - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in EN declaration."); yynerrs++;} -| en_identifier BOOL ASSIGN integer - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in EN declaration."); yynerrs++;} -| en_identifier ':' ASSIGN boolean_literal - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in EN declaration."); yynerrs++;} -| en_identifier ':' ASSIGN integer - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in EN declaration."); yynerrs++;} -| en_identifier ':' BOOL ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in EN declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in EN declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -var_init_decl: - var1_init_decl -| array_var_init_decl -| structured_var_init_decl -| fb_name_decl -| string_var_declaration -; - - - - -var1_init_decl: - var1_list ':' simple_spec_init - {$$ = new var1_init_decl_c($1, $3, locloc(@$));} -| var1_list ':' subrange_spec_init - {$$ = new var1_init_decl_c($1, $3, locloc(@$));} -| var1_list ':' enumerated_spec_init - {$$ = new var1_init_decl_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list simple_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and simple specification."); yynerrs++;} -| var1_list subrange_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and subrange specification."); yynerrs++;} -| var1_list enumerated_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and enumerated specification."); yynerrs++;} -| var1_list ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -var1_list: - variable_name - {$$ = new var1_list_c(locloc(@$)); $$->add_element($1); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } - | var1_list ',' variable_name - {$$ = $1; $$->add_element($3); - variable_name_symtable.insert($3, prev_declared_variable_name_token); - } -/* ERROR_CHECK_BEGIN */ -| var1_list variable_name - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in variable list."); yynerrs++;} -| var1_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable name defined in variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid variable name in variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -array_var_init_decl: - var1_list ':' array_spec_init - {$$ = new array_var_init_decl_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list array_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and array specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -structured_var_init_decl: - var1_list ':' initialized_structure - {$$ = new structured_var_init_decl_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list initialized_structure - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and structured specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: see notes above fb_name_list and var1_list - * for reason why ':' was removed from this rule! - * In essence, to remove a shift/reduce conflict, - * the ':' was moved to var1_list and fb_name_list! - */ -fb_name_decl: -/* fb_name_list ':' function_block_type_name */ - fb_name_list_with_colon function_block_type_name - {$$ = new fb_name_decl_c($1, $2, NULL, locloc(@$));} -/*| fb_name_list ':' function_block_type_name ASSIGN structure_initialization */ -| fb_name_list_with_colon function_block_type_name ASSIGN structure_initialization - {$$ = new fb_name_decl_c($1, $2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| fb_name_list_with_colon ASSIGN structure_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block type name defined in function block declaration with initialization."); yynerrs++;} -| fb_name_list_with_colon function_block_type_name structure_initialization - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing in function block declaration with initialization."); yynerrs++;} -| fb_name_list_with_colon function_block_type_name ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no initialization defined in function block declaration.");} - else {print_err_msg(locf(@4), locl(@4), "invalid initialization in function block declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -/* NOTE: In order to remove a reduce/reduce conflict between - * var1_list and fb_name_list, which are identical to each - * other, fb_name_list has been redefined to be a var1_list. - * - * In order to remove a further shift/reduce conflict, var1_list - * is imediately transfomred into var1_list_with_colon - * (i.e. it includes the ':' following the list), which - * means that fb_name_list is built from a - * var1_list_with_colon after all! - */ -/* -fb_name_list: - (* fb_name *) - identifier - {$$ = new fb_name_list_c($1); - variable_name_symtable.insert($1, prev_declared_fb_name_token); - } -(* | fb_name_list ',' fb_name *) -| fb_name_list ',' identifier - {$$ = $1; $$->add_element($3); - variable_name_symtable.insert($3, prev_declared_fb_name_token); - } -; -*/ - -fb_name_list_with_colon: - var1_list_with_colon - {$$ = new fb_name_list_c(locloc(@$)); - /* fill up the new fb_name_list_c object with the references - * contained in the var1_list_c object. - */ - FOR_EACH_ELEMENT(elem, $1, {$$->add_element(elem);}); - delete $1; - /* change the tokens associated with the symbols stored in - * the variable name symbol table from prev_declared_variable_name_token - * to prev_declared_fb_name_token - */ - FOR_EACH_ELEMENT(elem, $$, {variable_name_symtable.set(elem, prev_declared_fb_name_token);}); - } -; - -/* helper symbol for fb_name_list_with_colon */ -var1_list_with_colon: - var1_list ':' -; - - -// fb_name: identifier; - - - -output_declarations: - VAR_OUTPUT var_output_init_decl_list END_VAR - {$$ = new output_declarations_c(NULL, $2, new explicit_definition_c(), locloc(@$));} -| VAR_OUTPUT RETAIN var_output_init_decl_list END_VAR - {$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} -| VAR_OUTPUT NON_RETAIN var_output_init_decl_list END_VAR - {$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_OUTPUT END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in output variable(s) declaration."); yynerrs++;} -| VAR_OUTPUT RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive output variable(s) declaration."); yynerrs++;} -| VAR_OUTPUT NON_RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive output variable(s) declaration."); yynerrs++;} -| VAR_OUTPUT error var_output_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_OUPUT' in output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT RETAIN error var_output_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT NON_RETAIN error var_output_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT var_output_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT RETAIN var_output_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT NON_RETAIN var_output_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive output variable(s) declaration."); yyerrok;} -| VAR_OUTPUT NON_RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non-retentive output variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: The formal definition of 'var_output_init_decl' as defined in the standard is erroneous, - * as it does not allow a user defined 'ENO' output parameter. However, - * The semantic description of the languages clearly states that this is allowed. - * We have added the 'eno_param_declaration' clause to cover for this. - * - * Please read the comment above the definition of 'variable' in section B1.4 for details. - */ -var_output_init_decl: - var_init_decl -| eno_param_declaration -; - -var_output_init_decl_list: - var_output_init_decl ';' - {$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);} -| var_output_init_decl_list var_output_init_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| var_output_init_decl_list var_output_init_decl error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;} -| var_output_init_decl_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: The formal definition of the standard is erroneous, as it simply does not - * consider the EN and ENO keywords! - * The semantic description of the languages clearly states that these may be - * used in several ways. One of them is to declare an ENO output parameter. - * We have added the 'eno_param_declaration' clause to cover for this. - * - * Please read the comment above the definition of 'variable' in section B1.4 for details. - */ -eno_param_declaration: - eno_identifier ':' BOOL - /* NOTE We do _NOT_ include this variable in the previously_declared_variable symbol table! - * Please read the comment above the definition of 'variable' for the reason for this. - */ - {$$ = new eno_param_declaration_c($1, new bool_type_name_c(locloc(@$)), new explicit_definition_c(), locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| eno_identifier BOOL - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in ENO declaration."); yynerrs++;} -| eno_identifier ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in ENO declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in ENO declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -input_output_declarations: - VAR_IN_OUT var_declaration_list END_VAR - {$$ = new input_output_declarations_c($2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_IN_OUT END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in in_out variable(s) declaration."); yynerrs++;} -| VAR_IN_OUT error var_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_IN_OUT' in in_out variable(s) declaration."); yyerrok;} -| VAR_IN_OUT var_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed in_out variable(s) declaration."); yyerrok;} -| VAR_IN_OUT error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in in_out variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -/* helper symbol for input_output_declarations */ -var_declaration_list: - var_declaration ';' - {$$ = new var_declaration_list_c(locloc(@$)); $$->add_element($1);} -| var_declaration_list var_declaration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new var_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid variable(s) declaration."); yyerrok;} -| var_declaration error - {$$ = new var_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of variable(s) declaration."); yyerrok;} -| var_declaration_list var_declaration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;} -| var_declaration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;} -| var_declaration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after variable(s) declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -var_declaration: - temp_var_decl -| fb_name_decl -; - - -temp_var_decl: - var1_declaration -| array_var_declaration -| structured_var_declaration -| string_var_declaration -; - -var1_declaration: - var1_list ':' simple_specification - {$$ = new var1_init_decl_c($1, $3, locloc(@$));} -| var1_list ':' subrange_specification - {$$ = new var1_init_decl_c($1, $3, locloc(@$));} -| var1_list ':' enumerated_specification - {$$ = new var1_init_decl_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list simple_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and simple specification."); yynerrs++;} -| var1_list subrange_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and subrange specification."); yynerrs++;} -| var1_list enumerated_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and enumerated specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - - -array_var_declaration: - var1_list ':' array_specification - {$$ = new array_var_declaration_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list array_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and array specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -structured_var_declaration: - var1_list ':' prev_declared_structure_type_name - {$$ = new structured_var_declaration_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list prev_declared_structure_type_name - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and structured specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -var_declarations: - VAR var_init_decl_list END_VAR - {$$ = new var_declarations_c(NULL, $2, locloc(@$));} -| VAR CONSTANT var_init_decl_list END_VAR - {$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in variable(s) declaration."); yynerrs++;} -| VAR CONSTANT END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant variable(s) declaration."); yynerrs++;} -| VAR error var_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@3), "unexpected token after 'VAR' in variable(s) declaration."); yyerrok;} -| VAR CONSTANT error var_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant variable(s) declaration."); yyerrok;} -| VAR var_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed variable(s) declaration."); yyerrok;} -| VAR CONSTANT var_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant variable(s) declaration."); yyerrok;} -| VAR error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in variable(s) declaration."); yyerrok;} -| VAR CONSTANT error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -retentive_var_declarations: - VAR RETAIN var_init_decl_list END_VAR - {$$ = new retentive_var_declarations_c($3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive variable(s) declaration."); yynerrs++;} -| VAR RETAIN error var_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive variable(s) declaration."); yyerrok;} -| VAR RETAIN var_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive variable(s) declaration."); yyerrok;} -| VAR RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -located_var_declarations: - VAR located_var_decl_list END_VAR - {$$ = new located_var_declarations_c(NULL, $2, locloc(@$));} -| VAR CONSTANT located_var_decl_list END_VAR - {$$ = new located_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} -| VAR RETAIN located_var_decl_list END_VAR - {$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} -| VAR NON_RETAIN located_var_decl_list END_VAR - {$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR NON_RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive located variable(s) declaration."); yynerrs++;} -| VAR error located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in located variable(s) declaration."); yyerrok;} -| VAR CONSTANT error located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant located variable(s) declaration."); yyerrok;} -| VAR RETAIN error located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); yyerrok;} -| VAR NON_RETAIN error located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); yyerrok;} -| VAR located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed located variable(s) declaration."); yyerrok;} -| VAR CONSTANT located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant located variable(s) declaration."); yyerrok;} -| VAR RETAIN located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive located variable(s) declaration."); yyerrok;} -| VAR NON_RETAIN located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive located variable(s) declaration."); yyerrok;} -| VAR NON_RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non retentive variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for located_var_declarations */ -located_var_decl_list: - located_var_decl ';' - {$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);} -| located_var_decl_list located_var_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new located_var_decl_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid located variable declaration."); yyerrok;} -| located_var_decl error - {$$ = new located_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of located variable declaration."); yyerrok;} -| located_var_decl_list located_var_decl error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of located variable declaration."); yyerrok;} -| located_var_decl_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid located variable declaration."); yyerrok;} -| located_var_decl_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after located variable declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -located_var_decl: - variable_name location ':' located_var_spec_init - {$$ = new located_var_decl_c($1, $2, $4, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } -| location ':' located_var_spec_init - {$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| variable_name location located_var_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between located variable location and specification."); yynerrs++;} -| location located_var_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between located variable location and specification."); yynerrs++;} -| variable_name location ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in located variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in located variable declaration."); yyclearin;} - yyerrok; - } -| location ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in located variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in located variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - - -external_var_declarations: - VAR_EXTERNAL external_declaration_list END_VAR - {$$ = new external_var_declarations_c(NULL, $2, locloc(@$));} -| VAR_EXTERNAL CONSTANT external_declaration_list END_VAR - {$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_EXTERNAL END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in external variable(s) declaration."); yynerrs++;} -| VAR_EXTERNAL CONSTANT END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant external variable(s) declaration."); yynerrs++;} -| VAR_EXTERNAL error external_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_EXTERNAL' in external variable(s) declaration."); yyerrok;} -| VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant external variable(s) declaration."); yyerrok;} -| VAR_EXTERNAL external_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed external variable(s) declaration."); yyerrok;} -| VAR_EXTERNAL CONSTANT external_declaration_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant external variable(s) declaration."); yyerrok;} -| VAR_EXTERNAL error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in external variable(s) declaration."); yyerrok;} -| VAR_EXTERNAL CONSTANT error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant external variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for external_var_declarations */ -external_declaration_list: - external_declaration ';' - {$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);} -| external_declaration_list external_declaration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new external_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid external variable declaration."); yyerrok;} -| external_declaration error - {$$ = new external_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of external variable declaration."); yyerrok;} -| external_declaration_list external_declaration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of external variable declaration."); yyerrok;} -| external_declaration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid external variable declaration."); yyerrok;} -| external_declaration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after external variable declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -external_declaration: - global_var_name ':' simple_specification - {$$ = new external_declaration_c($1, $3, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } -| global_var_name ':' subrange_specification - {$$ = new external_declaration_c($1, $3, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } -| global_var_name ':' enumerated_specification - {$$ = new external_declaration_c($1, $3, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } -| global_var_name ':' array_specification - {$$ = new external_declaration_c($1, $3, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } -| global_var_name ':' prev_declared_structure_type_name - {$$ = new external_declaration_c($1, $3, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_variable_name_token); - } -| global_var_name ':' function_block_type_name - {$$ = new external_declaration_c($1, $3, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_fb_name_token); - } -/* ERROR_CHECK_BEGIN */ -| global_var_name simple_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and simple specification."); yynerrs++;} -| global_var_name subrange_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and subrange specification."); yynerrs++;} -| global_var_name enumerated_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and enumerated specification."); yynerrs++;} -| global_var_name array_specification - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and array specification."); yynerrs++;} -| global_var_name prev_declared_structure_type_name - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and structured specification."); yynerrs++;} -| global_var_name function_block_type_name - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and function block type specification."); yynerrs++;} -| global_var_name ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in external variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in external variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -global_var_name: identifier; - - -global_var_declarations: - VAR_GLOBAL global_var_decl_list END_VAR - {$$ = new global_var_declarations_c(NULL, $2, locloc(@$));} -| VAR_GLOBAL CONSTANT global_var_decl_list END_VAR - {$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} -| VAR_GLOBAL RETAIN global_var_decl_list END_VAR - {$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_GLOBAL END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in global variable(s) declaration."); yynerrs++;} -| VAR_GLOBAL CONSTANT END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant global variable(s) declaration."); yynerrs++;} -| VAR_GLOBAL RETAIN END_VAR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive global variable(s) declaration."); yynerrs++;} -| VAR_GLOBAL error global_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_GLOBAL' in global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL RETAIN error global_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL global_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL CONSTANT global_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL RETAIN global_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL CONSTANT error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant global variable(s) declaration."); yyerrok;} -| VAR_GLOBAL RETAIN error END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant global variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for global_var_declarations */ -global_var_decl_list: - global_var_decl ';' - {$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);} -| global_var_decl_list global_var_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new global_var_decl_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid global variable(s) declaration."); yyerrok;} -| global_var_decl error - {$$ = new global_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of global variable(s) declaration."); yyerrok;} -| global_var_decl_list global_var_decl error - {$$ = $1; print_err_msg(locl(@1), locf(@2), "';' missing at end of global variable(s) declaration."); yyerrok;} -| global_var_decl_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid global variable(s) declaration."); yyerrok;} -| global_var_decl_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after global variable(s) declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -global_var_decl: -/* NOTE : This possibility defined in standard has no sense and generate a conflict (disabled) - global_var_spec ':' - {$$ = new global_var_decl_c($1, NULL, locloc(@$));} -*/ - global_var_spec ':' located_var_spec_init - {$$ = new global_var_decl_c($1, $3, locloc(@$));} -| global_var_spec ':' function_block_type_name - {$$ = new global_var_decl_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| global_var_list located_var_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable list and type specification."); yynerrs++;} -| global_var_name location located_var_spec_init - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable specification and type specification."); yynerrs++;} -| global_var_spec function_block_type_name - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable specification and function block type specification."); yynerrs++;} -| global_var_spec ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in global variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in global variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -global_var_spec: - global_var_list {$$ = $1;} -| location - {$$ = new global_var_spec_c(NULL, $1, locloc(@$));} -| global_var_name location - {$$ = new global_var_spec_c($1, $2, locloc(@$)); - variable_name_symtable.insert($1, prev_declared_global_var_name_token); - } -; - - -located_var_spec_init: - simple_spec_init -| subrange_spec_init -| enumerated_spec_init -| array_spec_init -| initialized_structure -| single_byte_string_spec -| double_byte_string_spec -; - - -location: - AT direct_variable_token - {$$ = new location_c(new direct_variable_c($2, locloc(@$)), locloc(@$)); - direct_variable_symtable.insert($2, prev_declared_direct_variable_token); - } -/* ERROR_CHECK_BEGIN */ -| AT error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no location defined in location declaration.");} - else {print_err_msg(locf(@2), locl(@2), "invalid location in global location declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -global_var_list: - global_var_name - {$$ = new global_var_list_c(locloc(@$)); $$->add_element($1); - variable_name_symtable.insert($1, prev_declared_global_var_name_token); - } -| global_var_list ',' global_var_name - {$$ = $1; $$->add_element($3); - variable_name_symtable.insert($3, prev_declared_global_var_name_token); - } -/* ERROR_CHECK_BEGIN */ -| global_var_list global_var_name - {$$ = new global_var_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing in global variable list."); yynerrs++;} -| global_var_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable name defined in global variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid variable name in global variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -string_var_declaration: - single_byte_string_var_declaration -| double_byte_string_var_declaration -; - -single_byte_string_var_declaration: - var1_list ':' single_byte_string_spec - {$$ = new single_byte_string_var_declaration_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list single_byte_string_spec - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and string type specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -/* NOTE: The constructs - * - * [W]STRING - * and - * [W]STRING ASSIGN single_byte_character_string - * - * were removed as they are already contained - * within a other constructs. - * - * single_byte_string_spec is used in: - * - single_byte_string_var_declaration -> - * -> string_var_declaration ---> var_init_decl - * |--> temp_var_decl - * |--> var2_init_decl - * - located_var_spec_init - * - * STRING [ASSIGN string_constant] -> elementary_string_type_name -> - * -> simple_spec -> simple_specification -> simple_spec_init -> - * -> located_var_spec_init - * - * STRING [ASSIGN string_constant] -> elementary_string_type_name -> - * -> simple_spec -> simple_specification -> simple_spec_init -> - * -> var1_init_decl -> var_init_decl - * - * STRING [ASSIGN string_constant] -> elementary_string_type_name -> - * -> simple_spec -> simple_specification -> simple_spec_init -> - * -> var1_init_decl -> var2_init_decl - * - * STRING [ASSIGN string_constant] -> elementary_string_type_name -> - * -> simple_spec -> simple_specification -> - * -> var1_declaration -> temp_var_decl - */ -single_byte_string_spec: -/* STRING - {$$ = new single_byte_string_spec_c(NULL, NULL);} -*/ - STRING '[' integer ']' - {$$ = new single_byte_string_spec_c($3, NULL, locloc(@$));} -/* -| STRING ASSIGN single_byte_character_string - {$$ = new single_byte_string_spec_c(NULL, $3, locloc(@$));} -*/ -| STRING '[' integer ']' ASSIGN single_byte_character_string - {$$ = new single_byte_string_spec_c($3, $6, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| STRING '[' error ']' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited string type specification."); yyerrok;} -| STRING '[' error ']' ASSIGN single_byte_character_string - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited string type specification."); yyerrok;} -| STRING '[' ']' - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited string type specification."); yynerrs++;} -| STRING '[' ']' ASSIGN single_byte_character_string - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited string type specification."); yynerrs++;} -| STRING '[' integer error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "expecting ']' after length definition for limited string type specification."); yyerrok;} -| STRING '[' integer ']' single_byte_character_string - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':=' missing before limited string type initialization."); yynerrs++;} -| STRING '[' integer ']' ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@5), locf(@6), "no initial value defined in limited string type initialization.");} - else {print_err_msg(locf(@6), locl(@6), "invalid initial value in limited string type initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -double_byte_string_var_declaration: - var1_list ':' double_byte_string_spec - {$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| var1_list double_byte_string_spec - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and double byte string type specification."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -double_byte_string_spec: -/* WSTRING - {$$ = new double_byte_string_spec_c(NULL, NULL, locloc(@$));} -*/ - WSTRING '[' integer ']' - {$$ = new double_byte_string_spec_c($3, NULL, locloc(@$));} -/* -| WSTRING ASSIGN double_byte_character_string - {$$ = new double_byte_string_spec_c(NULL, $3, locloc(@$));} -*/ -| WSTRING '[' integer ']' ASSIGN double_byte_character_string - {$$ = new double_byte_string_spec_c($3, $6, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| WSTRING '[' error ']' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited double byte string type specification."); yyerrok;} -| WSTRING '[' error ']' ASSIGN single_byte_character_string - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited double byte string type specification."); yyerrok;} -| WSTRING '[' ']' - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited double byte string type specification."); yynerrs++;} -| WSTRING '[' ']' ASSIGN single_byte_character_string - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited double byte string type specification."); yynerrs++;} -| WSTRING '[' integer error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "expecting ']' after length definition for limited double byte string type specification."); yyerrok;} -| WSTRING '[' integer ']' single_byte_character_string - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':=' missing before limited double byte string type initialization."); yynerrs++;} -| WSTRING '[' integer ']' ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@5), locf(@6), "no initial value defined double byte in limited string type initialization.");} - else {print_err_msg(locf(@6), locl(@6), "invalid initial value in limited double byte string type initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -incompl_located_var_declarations: - VAR incompl_located_var_decl_list END_VAR - {$$ = new incompl_located_var_declarations_c(NULL, $2, locloc(@$));} -| VAR RETAIN incompl_located_var_decl_list END_VAR - {$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} -| VAR NON_RETAIN incompl_located_var_decl_list END_VAR - {$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR incompl_located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed incomplete located variable(s) declaration."); yyerrok;} -| VAR RETAIN incompl_located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed incomplete retentive located variable(s) declaration."); yyerrok;} -| VAR NON_RETAIN incompl_located_var_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed incomplete non-retentive located variable(s) declaration."); yyerrok;} -| VAR error incompl_located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in incomplete located variable(s) declaration."); yyerrok;} -| VAR RETAIN error incompl_located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); yyerrok;} -| VAR NON_RETAIN error incompl_located_var_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for incompl_located_var_declarations */ -incompl_located_var_decl_list: - incompl_located_var_decl ';' - {$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);} -| incompl_located_var_decl_list incompl_located_var_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| incompl_located_var_decl error - {$$ = new incompl_located_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of incomplete located variable declaration."); yyerrok;} -| incompl_located_var_decl_list incompl_located_var_decl error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of incomplete located variable declaration."); yyerrok;} -| incompl_located_var_decl_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid incomplete located variable declaration."); yyerrok;} -| incompl_located_var_decl_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after incomplete located variable declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -incompl_located_var_decl: - variable_name incompl_location ':' var_spec - {$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| variable_name incompl_location var_spec - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between incomplete located variable and type specification."); yynerrs++; - } -| variable_name incompl_location ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in incomplete located variable declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid specification in incomplete located variable declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -incompl_location: - AT incompl_location_token - {$$ = new incompl_location_c($2, locloc(@$));} -; - - -var_spec: - simple_specification -| subrange_specification -| enumerated_specification -| array_specification -| prev_declared_structure_type_name -| string_spec -; - - -/* helper symbol for var_spec */ -/* NOTE: The constructs - * - * STRING - * and - * WSTRING - * - * were removed as they are already contained - * within a simple_specification. - */ -string_spec: -/* STRING - {$$ = new single_byte_string_spec_c(NULL, NULL, locloc(@$));} -*/ - STRING '[' integer ']' - {$$ = new single_byte_string_spec_c($3, NULL, locloc(@$));} -/* -| WSTRING - {$$ = new double_byte_string_spec_c(NULL, NULL, locloc(@$));} -*/ -| WSTRING '[' integer ']' - {$$ = new double_byte_string_spec_c($3, NULL, locloc(@$));} -; - - - - -/* intermediate helper symbol for: - * - non_retentive_var_decls - * - var_declarations - */ -var_init_decl_list: - var_init_decl ';' - {$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);} -| var_init_decl_list var_init_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| var_init_decl_list var_init_decl error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;} -| var_init_decl_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - - -/***********************/ -/* B 1.5.1 - Functions */ -/***********************/ -/* -function_name: - prev_declared_derived_function_name -| standard_function_name -; -*/ - -/* The following rules should be set such as: - * function_name: function_name_no_clashes | function_name_simpleop_clashes | function_name_expression_clashes - * function_name: function_name_no_NOT_clashes | function_name_NOT_clashes; - */ - -function_name_no_clashes: prev_declared_derived_function_name | standard_function_name_no_clashes; -function_name_simpleop_clashes: standard_function_name_simpleop_clashes; -//function_name_expression_clashes: standard_function_name_expression_clashes; - -function_name_no_NOT_clashes: prev_declared_derived_function_name | standard_function_name_no_NOT_clashes; -//function_name_NOT_clashes: standard_function_name_NOT_clashes; - - -/* NOTE: The list of standard function names - * includes the standard functions MOD(), NOT() - * - * Strangely enough, MOD and NOT are reserved keywords, - * so shouldn't be used for function names. - * - * The specification contradicts itself! - * Our workaround is to treat MOD as a token, - * but to include this token as a - * standard_function_name. - * - * The names of all other standard functions get - * preloaded into the library_element_symbol_table - * with the token value of - * standard_function_name_token - * Actually, simply for completeness, MOD is also - * loaded into the library_element_symbol_table, but - * it is irrelevant since flex will catch MOD as a - * token, before it interprets it as an identifier, - * and looks in the library_element_symbol_table to check - * whether it has been previously declared. - * - * NOTE: The same as the above also occurs with the IL - * operators NOT AND OR XOR ADD SUB MUL DIV MOD - * GT GE EQ LT LE NE. - * Note that MOD is once again in the list! - * Anyway, we give these the same treatement as - * MOD, since we are writing a parser for ST and - * IL simultaneously. If this were not the case, - * the ST parser would not need the tokens NOT AND ... - * - * NOTE: Note that 'NOT' is special, as it conflicts - * with two operators: the IL 'NOT' operator, and - * the unary operator 'NOT' in ST!! - * - * NOTE: The IL language is ambiguous, since using NOT, AND, ... - * may be interpreted as either an IL operator, or - * as a standard function call! - * I (Mario) opted to interpret it as an IL operator. - * This requires changing the syntax for IL language - * function calling, to exclude all function with - * names that clash with IL operators. I therefore - * created the constructs - * function_name_without_clashes - * standard_function_name_without_clashes - * to include all function names, except those that clash - * with IL operators. These constructs are only used - * within the IL language! - */ -/* The following rules should be set such as: - * standard_function_name: standard_function_name_no_clashes | standard_function_name_simpleop_clashes | standard_function_name_expression_clashes - * standard_function_name: standard_function_name_no_NOT_clashes | standard_function_name_NOT_clashes; - */ - -/* -standard_function_name: - standard_function_name_no_clashes -| standard_function_name_expression_clashes -| standard_function_name_NOT_clashes -//| standard_function_name_simpleop_only_clashes -; -*/ - -standard_function_name_no_NOT_clashes: - standard_function_name_no_clashes -| standard_function_name_expression_clashes -//| standard_function_name_simpleop_only_clashes -; - -standard_function_name_no_clashes: - standard_function_name_token - {$$ = new identifier_c($1, locloc(@$));} -; - - -standard_function_name_simpleop_clashes: - standard_function_name_NOT_clashes -//| standard_function_name_simpleop_only_clashes -; - -standard_function_name_NOT_clashes: - NOT - {$$ = new identifier_c(strdup("NOT"), locloc(@$));} -; - -/* Add here any other IL simple operators that collide - * with standard function names! - * Don't forget to uncomment the equivalent lines in - * - standard_function_name_simpleop_clashes - * - standard_function_name - * - standard_function_name_no_NOT_clashes - */ -/* -standard_function_name_simpleop_only_clashes: -; -*/ - -standard_function_name_expression_clashes: - AND {$$ = new identifier_c(strdup("AND"), locloc(@$));} -| OR {$$ = new identifier_c(strdup("OR"), locloc(@$));} -| XOR {$$ = new identifier_c(strdup("XOR"), locloc(@$));} -| ADD {$$ = new identifier_c(strdup("ADD"), locloc(@$));} -| SUB {$$ = new identifier_c(strdup("SUB"), locloc(@$));} -| MUL {$$ = new identifier_c(strdup("MUL"), locloc(@$));} -| DIV {$$ = new identifier_c(strdup("DIV"), locloc(@$));} -| MOD {$$ = new identifier_c(strdup("MOD"), locloc(@$));} -| GT {$$ = new identifier_c(strdup("GT"), locloc(@$));} -| GE {$$ = new identifier_c(strdup("GE"), locloc(@$));} -| EQ {$$ = new identifier_c(strdup("EQ"), locloc(@$));} -| LT {$$ = new identifier_c(strdup("LT"), locloc(@$));} -| LE {$$ = new identifier_c(strdup("LE"), locloc(@$));} -| NE {$$ = new identifier_c(strdup("NE"), locloc(@$));} -/* - AND_operator {$$ = il_operator_c_2_identifier_c($1);} -//NOTE: AND2 (corresponding to the source code string '&') does not clash -// with a standard function name, so should be commented out! -//| AND2_operator {$$ = il_operator_c_2_identifier_c($1);} -| OR_operator {$$ = il_operator_c_2_identifier_c($1);} -| XOR_operator {$$ = il_operator_c_2_identifier_c($1);} -| ADD_operator {$$ = il_operator_c_2_identifier_c($1);} -| SUB_operator {$$ = il_operator_c_2_identifier_c($1);} -| MUL_operator {$$ = il_operator_c_2_identifier_c($1);} -| DIV_operator {$$ = il_operator_c_2_identifier_c($1);} -| MOD_operator {$$ = il_operator_c_2_identifier_c($1);} -| GT_operator {$$ = il_operator_c_2_identifier_c($1);} -| GE_operator {$$ = il_operator_c_2_identifier_c($1);} -| EQ_operator {$$ = il_operator_c_2_identifier_c($1);} -| LT_operator {$$ = il_operator_c_2_identifier_c($1);} -| LE_operator {$$ = il_operator_c_2_identifier_c($1);} -| NE_operator {$$ = il_operator_c_2_identifier_c($1);} -*/ -; - - -derived_function_name: - identifier -| prev_declared_derived_function_name - {$$ = $1; - if (not(allow_function_overloading)) { - fprintf(stderr, "Function overloading not allowed. Invalid identifier %s\n", ((token_c *)($1))->value); - ERROR; - } - } -; - - -function_declaration: -/* FUNCTION derived_function_name ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ - function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION - {$$ = new function_declaration_c($1, $3, $4, $5, locloc(@$)); - add_en_eno_param_decl_c::add_to($$); /* add EN and ENO declarations, if not already there */ - variable_name_symtable.pop(); - direct_variable_symtable.pop(); - if (allow_function_overloading) { - switch (library_element_symtable.find_value($1)) { - case prev_declared_derived_function_name_token: - /* do nothing, already in map. */ - break; - case BOGUS_TOKEN_ID: - /* Not yet in map. Must insert...*/ - library_element_symtable.insert($1, prev_declared_derived_function_name_token); - break; - default: - /* Already in map but associated with something else other than a funtion name! */ - ERROR; - } - } else { - library_element_symtable.insert($1, prev_declared_derived_function_name_token); - } - } -/* | FUNCTION derived_function_name ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ -| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION - {$$ = new function_declaration_c($1, $3, $4, $5, locloc(@$)); - add_en_eno_param_decl_c::add_to($$); /* add EN and ENO declarations, if not already there */ - variable_name_symtable.pop(); - direct_variable_symtable.pop(); - if (allow_function_overloading) { - switch (library_element_symtable.find_value($1)) { - case prev_declared_derived_function_name_token: /* do nothing, already in map. */ break; - case BOGUS_TOKEN_ID: library_element_symtable.insert($1, prev_declared_derived_function_name_token); break; - default: ERROR; - } - } else { - library_element_symtable.insert($1, prev_declared_derived_function_name_token); - } - } -/* ERROR_CHECK_BEGIN */ -| function_name_declaration elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after function name in function declaration."); yynerrs++;} -| function_name_declaration derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after function name in function declaration."); yynerrs++;} -| function_name_declaration ':' io_OR_function_var_declarations_list function_body END_FUNCTION - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no return type defined in function declaration."); yynerrs++;} -| function_name_declaration ':' error io_OR_function_var_declarations_list function_body END_FUNCTION - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid return type defined in function declaration."); yyerrok;} -| function_name_declaration ':' elementary_type_name function_body END_FUNCTION - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared in function declaration."); yynerrs++;} -| function_name_declaration ':' derived_type_name function_body END_FUNCTION - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared in function declaration."); yynerrs++;} -| function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list END_FUNCTION - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no body defined in function declaration."); yynerrs++;} -| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list END_FUNCTION - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no body defined in function declaration."); yynerrs++;} -| function_name_declaration ':' elementary_type_name END_FUNCTION - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration."); yynerrs++;} -| function_name_declaration ':' derived_type_name END_FUNCTION - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration."); yynerrs++;} -| function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list function_body END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locf(@3), "unclosed function declaration."); yynerrs++;} -| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list function_body END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed function declaration."); yynerrs++;} -| function_name_declaration error END_FUNCTION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in function declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -/* helper symbol for function_declaration */ -/* NOTE: due to reduce/reduce conflicts between identifiers - * being reduced to either a variable or an enumerator value, - * we were forced to keep a symbol table of the names - * of all declared variables. Variables are no longer - * created from simple identifier_token, but from - * prev_declared_variable_name_token. - * - * BUT, in functions the function name itself may be used as - * a variable! In order to be able to parse this correctly, - * the token parser (flex) must return a prev_declared_variable_name_token - * when it comes across the function name, while parsing - * the function itself. - * We do this by inserting the function name into the variable - * symbol table, and having flex return a prev_declared_variable_name_token - * whenever it comes across it. - * When we finish parsing the function the variable name - * symbol table is cleared of all entries, and the function - * name is inserted into the library element symbol table. This - * means that from then onwards flex will return a - * derived_function_name_token whenever it comes across the - * function name. - * - * In order to insert the function name into the variable_name - * symbol table BEFORE the function body gets parsed, we - * need the parser to reduce a construct that contains the - * the function name. That is why we created this extra - * construct (function_name_declaration), i.e. to force - * the parser to reduce it, before parsing the function body! - */ -function_name_declaration: - FUNCTION derived_function_name - {$$ = $2; - /* the function name functions as a - * variable within the function itself! - * - * Remember that the variable_name_symtable - * is cleared once the end of the function - * is parsed. - */ - variable_name_symtable.insert($2, prev_declared_variable_name_token); - } -/* ERROR_CHECK_BEGIN */ -| FUNCTION error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no function name defined in function declaration.");} - else {print_err_msg(locf(@2), locl(@2), "invalid function name in function declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -/* intermediate helper symbol for function_declaration */ -io_OR_function_var_declarations_list: - io_var_declarations - {$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);} -| function_var_decls - {$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);} -| io_OR_function_var_declarations_list io_var_declarations - {$$ = $1; $$->add_element($2);} -| io_OR_function_var_declarations_list function_var_decls - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| io_OR_function_var_declarations_list retentive_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected retentive variable(s) declaration in function declaration."); yynerrs++;} -| io_OR_function_var_declarations_list located_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected located variable(s) declaration in function declaration."); yynerrs++;} -| io_OR_function_var_declarations_list external_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected external variable(s) declaration in function declaration."); yynerrs++;} -| io_OR_function_var_declarations_list global_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function declaration."); yynerrs++;} -| io_OR_function_var_declarations_list incompl_located_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected incomplete located variable(s) declaration in function declaration."); yynerrs++;} -| io_OR_function_var_declarations_list temp_var_decls - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected temporary located variable(s) declaration in function declaration."); yynerrs++;} -| io_OR_function_var_declarations_list non_retentive_var_decls - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected non-retentive variable(s) declaration in function declaration."); yynerrs++;} -/*| io_OR_function_var_declarations_list access_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function declaration."); yynerrs++;}*/ -| io_OR_function_var_declarations_list instance_specific_initializations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -io_var_declarations: - input_declarations -| output_declarations -| input_output_declarations -; - - -function_var_decls: - VAR CONSTANT var2_init_decl_list END_VAR - {$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} -| VAR var2_init_decl_list END_VAR - {$$ = new function_var_decls_c(NULL, $2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR error var2_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in function variable(s) declaration."); yyerrok;} -| VAR CONSTANT error var2_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant function variable(s) declaration."); yyerrok;} -| VAR var2_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed function variable(s) declaration."); yyerrok;} -| VAR CONSTANT var2_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant function variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* intermediate helper symbol for function_var_decls */ -var2_init_decl_list: - var2_init_decl ';' - {$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);} -| var2_init_decl_list var2_init_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| var2_init_decl error - {$$ = new var2_init_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of function variable(s) declaration."); yyerrok;} -| var2_init_decl_list var2_init_decl error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of function variable(s) declaration."); yyerrok;} -| var2_init_decl_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid function variable(s) declaration."); yyerrok;} -| var2_init_decl_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after function variable(s) declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -function_body: - statement_list {$$ = $1;} /* if we leave it for the default action we get a type clash! */ -| instruction_list {$$ = $1;} /* if we leave it for the default action we get a type clash! */ -/* -| ladder_diagram -| function_block_diagram -*/ -; - - -var2_init_decl: - var1_init_decl -| array_var_init_decl -| structured_var_init_decl -| string_var_declaration -; - - - -/*****************************/ -/* B 1.5.2 - Function Blocks */ -/*****************************/ -function_block_type_name: - prev_declared_derived_function_block_name -| standard_function_block_name -; - - -standard_function_block_name: standard_function_block_name_token {$$ = new identifier_c($1, locloc(@$));}; - -derived_function_block_name: identifier; - - -function_block_declaration: - FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK - {$$ = new function_block_declaration_c($2, $3, $4, locloc(@$)); - add_en_eno_param_decl_c::add_to($$); /* add EN and ENO declarations, if not already there */ - library_element_symtable.insert($2, prev_declared_derived_function_block_name_token); - /* Clear the variable_name_symtable. Since - * we have finished parsing the function block, - * the variable names are now out of scope, so - * are no longer valid! - */ - variable_name_symtable.pop(); - direct_variable_symtable.pop(); - } -/* ERROR_CHECK_BEGIN */ -| FUNCTION_BLOCK io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in function block declaration."); yynerrs++;} -| FUNCTION_BLOCK error io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name in function block declaration."); yyerrok;} -| FUNCTION_BLOCK derived_function_block_name function_block_body END_FUNCTION_BLOCK - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared in function declaration."); yynerrs++;} -| FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list END_FUNCTION_BLOCK - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in function block declaration."); yynerrs++;} -| FUNCTION_BLOCK derived_function_block_name END_FUNCTION_BLOCK - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared and body defined in function block declaration."); yynerrs++;} -| FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list function_block_body END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "no variable(s) declared and body defined in function block declaration."); yynerrs++;} -| FUNCTION_BLOCK error END_FUNCTION_BLOCK - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in function block declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -/* intermediate helper symbol for function_declaration */ -/* { io_var_declarations | other_var_declarations } */ -/* - * NOTE: we re-use the var_declarations_list_c - */ -io_OR_other_var_declarations_list: - io_var_declarations - {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);} -| other_var_declarations - {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);} -| io_OR_other_var_declarations_list io_var_declarations - {$$ = $1; $$->add_element($2);} -| io_OR_other_var_declarations_list other_var_declarations - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| io_OR_other_var_declarations_list located_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected located variable(s) declaration in function block declaration."); yynerrs++;} -| io_OR_other_var_declarations_list global_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration."); yynerrs++;} -/*| io_OR_other_var_declarations_list access_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration."); yynerrs++;}*/ -| io_OR_other_var_declarations_list instance_specific_initializations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -/* NOTE: - * The IEC specification gives the following definition: - * other_var_declarations ::= - * external_var_declarations - * | var_declarations - * | retentive_var_declarations - * | non_retentive_var_declarations - * | temp_var_decls - * | incompl_located_var_declarations - * - * Nvertheless, the symbol non_retentive_var_declarations - * is not defined in the spec. This seems to me (Mario) - * to be a typo, so non_retentive_var_declarations - * has been replaced with non_retentive_var_decls - * in the following rule! - */ -other_var_declarations: - temp_var_decls -| non_retentive_var_decls -| external_var_declarations -| var_declarations -| retentive_var_declarations -| incompl_located_var_declarations -; - - -temp_var_decls: - VAR_TEMP temp_var_decls_list END_VAR - {$$ = new temp_var_decls_c($2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_TEMP END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in temporary variable(s) declaration."); yynerrs++;} -| VAR_TEMP temp_var_decls_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "unclosed temporary variable(s) declaration."); yyerrok;} -| VAR_TEMP error temp_var_decls_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_TEMP' in function variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* intermediate helper symbol for temp_var_decls */ -temp_var_decls_list: - temp_var_decl ';' - {$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);} -| temp_var_decls_list temp_var_decl ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new temp_var_decls_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid temporary variable(s) declaration."); yyerrok;} -| temp_var_decl error - {$$ = new temp_var_decls_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of temporary variable(s) declaration."); yyerrok;} -| temp_var_decls_list temp_var_decl error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of temporary variable(s) declaration."); yyerrok;} -| temp_var_decls_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid temporary variable(s) declaration."); yyerrok;} -| temp_var_decls_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after temporary variable(s) declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -non_retentive_var_decls: - VAR NON_RETAIN var_init_decl_list END_VAR - {$$ = new non_retentive_var_decls_c($3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR NON_RETAIN var_init_decl_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unclosed non-retentive temporary variable(s) declaration."); yyerrok;} -| VAR NON_RETAIN error var_init_decl_list END_VAR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive temporary variable(s) declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -function_block_body: - statement_list {$$ = $1;} -| instruction_list {$$ = $1;} -| sequential_function_chart {$$ = $1;} -/* -| ladder_diagram -| function_block_diagram -| -*/ -; - - - - -/**********************/ -/* B 1.5.3 - Programs */ -/**********************/ -program_type_name: identifier; - - -program_declaration: - PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM - {$$ = new program_declaration_c($2, $3, $4, locloc(@$)); - library_element_symtable.insert($2, prev_declared_program_type_name_token); - /* Clear the variable_name_symtable. Since - * we have finished parsing the program declaration, - * the variable names are now out of scope, so - * are no longer valid! - */ - variable_name_symtable.pop(); - direct_variable_symtable.pop(); - } -/* ERROR_CHECK_BEGIN */ -| PROGRAM program_var_declarations_list function_block_body END_PROGRAM - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no program name defined in program declaration.");} -| PROGRAM error program_var_declarations_list function_block_body END_PROGRAM - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program name in program declaration."); yyerrok;} -| PROGRAM program_type_name function_block_body END_PROGRAM - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared in program declaration."); yynerrs++;} -| PROGRAM program_type_name program_var_declarations_list END_PROGRAM - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in program declaration."); yynerrs++;} -| PROGRAM program_type_name END_PROGRAM - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared and body defined in program declaration."); yynerrs++;} -| PROGRAM program_type_name program_var_declarations_list function_block_body END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed program declaration."); yynerrs++;} -| PROGRAM error END_PROGRAM - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in program declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for program_declaration */ -/* - * NOTE: we re-use the var_declarations_list_c - */ -program_var_declarations_list: - io_var_declarations - {$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);} -| other_var_declarations - {$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);} -| located_var_declarations - {$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);} -| program_var_declarations_list io_var_declarations - {$$ = $1; $$->add_element($2);} -| program_var_declarations_list other_var_declarations - {$$ = $1; $$->add_element($2);} -| program_var_declarations_list located_var_declarations - {$$ = $1; $$->add_element($2);} -/* -| program_var_declarations_list program_access_decls - {$$ = $1; $$->add_element($2);} -*/ -/* ERROR_CHECK_BEGIN */ -| program_var_declarations_list global_var_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration."); yynerrs++;} -/*| program_var_declarations_list access_declarations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration."); yynerrs++;}*/ -| program_var_declarations_list instance_specific_initializations - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration."); yynerrs++; - } -/* ERROR_CHECK_END */ -; - - -/* TODO ... */ -/* -program_access_decls: - VAR_ACCESS program_access_decl_list END_VAR -; -*/ - -/* helper symbol for program_access_decls */ -/* -program_access_decl_list: - program_access_decl ';' -| program_access_decl_list program_access_decl ';' -; -*/ - -/* -program_access_decl: - access_name ':' symbolic_variable ':' non_generic_type_name -| access_name ':' symbolic_variable ':' non_generic_type_name direction -; -*/ - - - -/********************************************/ -/* B 1.6 Sequential Function Chart elements * -/********************************************/ - -sequential_function_chart: - sfc_network - {$$ = new sequential_function_chart_c(locloc(@$)); $$->add_element($1);} -| sequential_function_chart sfc_network - {$$ = $1; $$->add_element($2);} -; - -sfc_network: - initial_step - {$$ = new sfc_network_c(locloc(@$)); $$->add_element($1);} -| sfc_network step - {$$ = $1; $$->add_element($2);} -| sfc_network transition - {$$ = $1; $$->add_element($2);} -| sfc_network action - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| sfc_network error - {$$ = $1; print_err_msg(locl(@1), locf(@2), "unexpected token after SFC network in sequencial function chart."); yyerrok;} -/* ERROR_CHECK_END */ -; - -initial_step: - INITIAL_STEP step_name ':' action_association_list END_STEP -// INITIAL_STEP identifier ':' action_association_list END_STEP - {$$ = new initial_step_c($2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| INITIAL_STEP ':' action_association_list END_STEP - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "no step name defined in initial step declaration."); yynerrs++;} -| INITIAL_STEP error ':' action_association_list END_STEP - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step name defined in initial step declaration."); yyerrok;} -| INITIAL_STEP step_name action_association_list END_STEP - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':' missing after step name in initial step declaration."); yynerrs++;} -| INITIAL_STEP step_name ':' error END_STEP - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid action association list in initial step declaration."); yyerrok;} -| INITIAL_STEP step_name ':' action_association_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed initial step declaration."); yynerrs++;} -| INITIAL_STEP error END_STEP - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in initial step declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -step: - STEP step_name ':' action_association_list END_STEP -// STEP identifier ':' action_association_list END_STEP - {$$ = new step_c($2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| STEP ':' action_association_list END_STEP - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no step name defined in step declaration."); yynerrs++;} -| STEP error ':' action_association_list END_STEP - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step name defined in step declaration."); yyerrok;} -| STEP step_name action_association_list END_STEP - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':' missing after step name in step declaration."); yynerrs++;} -| STEP step_name ':' error END_STEP - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid action association list in step declaration."); yyerrok;} -| STEP step_name ':' action_association_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "invalid action association list in step declaration."); yynerrs++;} -| STEP error END_STEP - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in step declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for: - * - initial_step - * - step - */ -action_association_list: - /* empty */ - {$$ = new action_association_list_c(locloc(@$));} -| action_association_list action_association ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| action_association_list action_association error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of action association declaration."); yyerrok;} -| action_association_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after action association declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -// step_name: identifier; -step_name: any_identifier; - -action_association: - action_name '(' {cmd_goto_sfc_qualifier_state();} action_qualifier {cmd_pop_state();} indicator_name_list ')' - {$$ = new action_association_c($1, $4, $6, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -/*| action_name '(' error ')' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid qualifier defined in action association."); yyerrok;}*/ -/* ERROR_CHECK_END */ -; - -/* helper symbol for action_association */ -indicator_name_list: - /* empty */ - {$$ = new indicator_name_list_c(locloc(@$));} -| indicator_name_list ',' indicator_name - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| indicator_name_list indicator_name - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing at end of action association declaration."); yynerrs++;} -| indicator_name_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no indicator defined in indicator list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid indicator in indicator list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -// action_name: identifier; -action_name: any_identifier; - -action_qualifier: - /* empty */ - {$$ = NULL;} -| qualifier - {$$ = new action_qualifier_c($1, NULL, locloc(@$));} -| timed_qualifier ',' action_time - {$$ = new action_qualifier_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| timed_qualifier action_time - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "',' missing between timed qualifier and action time in action qualifier."); yynerrs++;} -| timed_qualifier ',' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no action time defined in action qualifier.");} - else {print_err_msg(locf(@3), locl(@3), "invalid action time in action qualifier."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -qualifier: - N {$$ = new qualifier_c(strdup("N"), locloc(@$));} -| R {$$ = new qualifier_c(strdup("R"), locloc(@$));} -| S {$$ = new qualifier_c(strdup("S"), locloc(@$));} -| P {$$ = new qualifier_c(strdup("P"), locloc(@$));} -; - -timed_qualifier: - L {$$ = new timed_qualifier_c(strdup("L"), locloc(@$));} -| D {$$ = new timed_qualifier_c(strdup("D"), locloc(@$));} -| SD {$$ = new timed_qualifier_c(strdup("SD"), locloc(@$));} -| DS {$$ = new timed_qualifier_c(strdup("DS"), locloc(@$));} -| SL {$$ = new timed_qualifier_c(strdup("SL"), locloc(@$));} -; - -action_time: - duration -| variable -; - -indicator_name: variable; - -// transition_name: identifier; -transition_name: any_identifier; - - -steps: - step_name - {$$ = new steps_c($1, NULL, locloc(@$));} -| '(' step_name_list ')' - {$$ = new steps_c(NULL, $2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| '(' step_name_list error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ')' at the end of step list in transition declaration."); yyerrok;} -| '(' error ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step list in transition declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -step_name_list: - step_name ',' step_name - {$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);} -| step_name_list ',' step_name - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| step_name_list step_name - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in step list."); yynerrs++;} -| step_name_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no step name defined in step list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid step name in step list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -/* NOTE: flex will automatically pop() out of body_state to previous state. - * We do not need to give a command from bison to return to previous flex state, - * after forcing flex to go to body_state. - */ -transition: - TRANSITION transition_priority - FROM steps TO steps - {cmd_goto_body_state();} transition_condition - END_TRANSITION - {$$ = new transition_c(NULL, $2, $4, $6, $8, locloc(@$));} -//| TRANSITION identifier FROM steps TO steps ... -| TRANSITION transition_name transition_priority - FROM steps TO steps - {cmd_goto_body_state();} transition_condition - END_TRANSITION - {$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| TRANSITION error transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid transition name defined in transition declaration."); yyerrok;} -| TRANSITION transition_name error FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid transition priority defined in transition declaration."); yyerrok;} -| TRANSITION transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no origin step(s) defined in transition declaration."); yynerrs++;} -| TRANSITION transition_name transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no origin step(s) defined in transition declaration."); yynerrs++;} -| TRANSITION transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid origin step(s) defined in transition declaration."); yyerrok;} -| TRANSITION transition_name transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locf(@5), locl(@5), "invalid origin step(s) defined in transition declaration."); yyerrok;} -| TRANSITION transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); yynerrs++;} -| TRANSITION transition_name transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@5), locf(@6), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); yynerrs++;} -| TRANSITION transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@5), locf(@7), "no destination step(s) defined in transition declaration."); yynerrs++;} -| TRANSITION transition_name transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@6), locf(@8), "no destination step(s) defined in transition declaration."); yynerrs++;} -| TRANSITION transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid destination step(s) defined in transition declaration."); yyerrok;} -| TRANSITION transition_name transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locf(@7), locl(@7), "invalid destination step(s) defined in transition declaration."); yyerrok;} -| TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no origin and destination step(s) defined in transition declaration."); yynerrs++;} -| TRANSITION transition_name transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION - {$$ = NULL; print_err_msg(locl(@3), locf(@5), "no origin and destination step(s) defined in transition declaration."); yynerrs++;} -/*| TRANSITION transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@6), "unclosed transition declaration."); yyerrok;} -| TRANSITION transition_name transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@7), "unclosed transition declaration."); yyerrok;}*/ -| TRANSITION error END_TRANSITION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in transition declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -transition_priority: - /* empty */ - {$$ = NULL;} -| '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')' - {$$ = $6;} -/* ERROR_CHECK_BEGIN -| '(' ASSIGN integer ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'PRIORITY' missing between '(' and ':=' in transition declaration with priority."); yynerrs++;} -| '(' error ASSIGN integer ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "expecting 'PRIORITY' between '(' and ':=' in transition declaration with priority."); yyerrok;} - ERROR_CHECK_END */ -; - - -transition_condition: - ':' eol_list simple_instr_list - {$$ = new transition_condition_c($3, NULL, locloc(@$));} -| ASSIGN expression ';' - {$$ = new transition_condition_c(NULL, $2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| eol_list simple_instr_list - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing before IL condition in transition declaration."); yynerrs++;} -| ':' eol_list error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no instructions defined in IL condition of transition declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid instructions in IL condition of transition declaration."); yyclearin;} - yyerrok; - } -| ASSIGN ';' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no expression defined in ST condition of transition declaration."); yynerrs++;} -| ASSIGN error ';' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid expression defined in ST condition of transition declaration."); yyerrok;} -| ASSIGN expression error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ';' after expression defined in ST condition of transition declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -action: -// ACTION identifier ':' ... - ACTION action_name {cmd_goto_body_state();} action_body END_ACTION - {$$ = new action_c($2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| ACTION {cmd_goto_body_state();} action_body END_ACTION - {$$ = NULL; print_err_msg(locl(@1), locf(@3), "no action name defined in action declaration."); yynerrs++;} -| ACTION error {cmd_goto_body_state();} action_body END_ACTION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid action name defined in action declaration."); yyerrok;} -| ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION - {$$ = NULL; print_err_msg(locl(@2), locf(@4), "':' missing after action name in action declaration."); yynerrs++;} -/*| ACTION action_name {cmd_goto_body_state();} action_body END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed action declaration."); yyerrok;}*/ -| ACTION error END_ACTION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in action declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -action_body: - ':' function_block_body - {$$ = $2;} -/* ERROR_CHECK_BEGIN */ -| ':' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no body defined in action declaration.");} - else {print_err_msg(locf(@2), locl(@2), "invalid body defined in action declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -/********************************/ -/* B 1.7 Configuration elements */ -/********************************/ -/* NOTE: - * It is not clear from reading the specification to which namespace - * the names of resources, tasks and programs belong to. - * - * The following syntax assumes that resource and program names belong to the - * same namespace as the variables defined within - * the resource/configuration (i.e. VAR_GLOBAL). - * Task names belong to a namespace all of their own, since they don't - * produce conflicts in the syntax parser, so we might just as well - * leave them be! ;-) - * The above decision was made taking into - * account that inside a VAR_CONFIG declaration global variables - * may be referenced starting off from the resource name as: - * resource_name.program_name.variable_name - * Notice how resource names and program names are used in a very similar - * manner as are variable names. - * Using a single namespace for all the above mentioned names - * also makes it easier to write the syntax parser!! ;-) Using a private - * namespace for each of the name types (resource names, program names, - * global varaiable names), i.e. letting the names be re-used across - * each of the groups (resource, program, global variables), produces - * reduce/reduce conflicts in the syntax parser. Actually, it is only - * the resource names that need to be distinguished into a - * prev_declared_resource_name so as not to conflict with [gloabl] variable - * names in the 'data' construct. - * The program names are only tracked to make sure that two programs do not - * get the same name. - * - * Using a single namespace does have the drawback that the user will - * not be able to re-use names for resources or programs if these - * have already been used to name a variable! - * - * If it ever becomes necessary to change this interpretation of - * the syntax, then this section of the syntax parser must be updated! - */ -prev_declared_global_var_name: prev_declared_global_var_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_resource_name: prev_declared_resource_name_token {$$ = new identifier_c($1, locloc(@$));}; -prev_declared_program_name: prev_declared_program_name_token {$$ = new identifier_c($1, locloc(@$));}; -// prev_declared_task_name: prev_declared_task_name_token {$$ = new identifier_c($1, locloc(@$));}; - - - - - - -configuration_name: identifier; - -/* NOTE: The specification states that valid resource type names - * are implementation defined, i.e. each implementaion will define - * what resource types it supports. - * We are implementing this syntax parser to be used by any - * implementation, so at the moment we accept any identifier - * as a resource type name. - * This implementation should probably be changed in the future. We - * should probably have a resource_type_name_token, and let the - * implementation load the global symbol library with the - * accepted resource type names before parsing the code. - * - */ -resource_type_name: any_identifier; - -configuration_declaration: - CONFIGURATION configuration_name - optional_global_var_declarations - single_resource_declaration - {variable_name_symtable.pop(); - direct_variable_symtable.pop();} - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = new configuration_declaration_c($2, $3, $4, $6, $7, locloc(@$)); - library_element_symtable.insert($2, prev_declared_configuration_name_token); - variable_name_symtable.pop(); - direct_variable_symtable.pop(); - } -| CONFIGURATION configuration_name - optional_global_var_declarations - resource_declaration_list - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = new configuration_declaration_c($2, $3, $4, $5, $6, locloc(@$)); - library_element_symtable.insert($2, prev_declared_configuration_name_token); - variable_name_symtable.pop(); - direct_variable_symtable.pop(); -} -/* ERROR_CHECK_BEGIN */ -| CONFIGURATION - optional_global_var_declarations - single_resource_declaration - {variable_name_symtable.pop(); - direct_variable_symtable.pop();} - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no configuration name defined in configuration declaration."); yynerrs++;} -| CONFIGURATION - optional_global_var_declarations - resource_declaration_list - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no configuration name defined in configuration declaration."); yynerrs++;} -| CONFIGURATION error - optional_global_var_declarations - single_resource_declaration - {variable_name_symtable.pop(); - direct_variable_symtable.pop();} - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid configuration name defined in configuration declaration."); yyerrok;} -| CONFIGURATION error - optional_global_var_declarations - resource_declaration_list - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid configuration name defined in configuration declaration."); yyerrok;} -| CONFIGURATION configuration_name - optional_global_var_declarations - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no resource(s) defined in configuration declaration."); yynerrs++;} -| CONFIGURATION configuration_name - optional_global_var_declarations - error - optional_access_declarations - optional_instance_specific_initializations - END_CONFIGURATION - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid resource(s) defined in configuration declaration."); yyerrok;} -/*| CONFIGURATION configuration_name - optional_global_var_declarations - single_resource_declaration - {variable_name_symtable.pop(); - direct_variable_symtable.pop();} - optional_access_declarations - optional_instance_specific_initializations - END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed configuration declaration."); yyerrok;}*/ -| CONFIGURATION configuration_name - optional_global_var_declarations - resource_declaration_list - optional_access_declarations - optional_instance_specific_initializations - END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed configuration declaration."); yyerrok;} -| CONFIGURATION error END_CONFIGURATION - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in configuration declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - -// helper symbol for -// - configuration_declaration -// - resource_declaration -// -optional_global_var_declarations: - // empty - {$$ = NULL;} -| global_var_declarations -; - - -// helper symbol for configuration_declaration // -optional_access_declarations: - // empty - {$$ = NULL;} -//| access_declarations -; - -// helper symbol for configuration_declaration // -optional_instance_specific_initializations: - // empty - {$$ = NULL;} -| instance_specific_initializations -; - -// helper symbol for configuration_declaration // -resource_declaration_list: - resource_declaration - {$$ = new resource_declaration_list_c(locloc(@$)); $$->add_element($1);} -| resource_declaration_list resource_declaration - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| resource_declaration_list error - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected token after resource declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -resource_declaration: - RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name ON resource_type_name - optional_global_var_declarations - single_resource_declaration - END_RESOURCE - {$$ = new resource_declaration_c($3, $5, $6, $7, locloc(@$)); - variable_name_symtable.pop(); - direct_variable_symtable.pop(); - variable_name_symtable.insert($3, prev_declared_resource_name_token); - } -/* ERROR_CHECK_BEGIN */ -| RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} ON resource_type_name - optional_global_var_declarations - single_resource_declaration - END_RESOURCE - {$$ = NULL; print_err_msg(locl(@1), locf(@3), "no resource name defined in resource declaration."); yynerrs++;} -/*| RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name ON resource_type_name - optional_global_var_declarations - single_resource_declaration - END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@5), "unclosed resource declaration."); yyerrok;}*/ -| RESOURCE error END_RESOURCE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in resource declaration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -single_resource_declaration: - task_configuration_list program_configuration_list - {$$ = new single_resource_declaration_c($1, $2, locloc(@$));} -; - - -// helper symbol for single_resource_declaration // -task_configuration_list: - // empty - {$$ = new task_configuration_list_c(locloc(@$));} -| task_configuration_list task_configuration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| task_configuration_list task_configuration error - {$$ = $1; print_err_msg(locl(@1), locf(@2), "';' missing at the end of task configuration in resource declaration."); yyerrok;} -| task_configuration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after task configuration in resource declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -// helper symbol for single_resource_declaration // -program_configuration_list: - program_configuration ';' - {$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);} -| program_configuration_list program_configuration ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| program_configuration error - {$$ = new program_configuration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of program configuration in resource declaration."); yyerrok;} -| program_configuration_list program_configuration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of program configuration in resource declaration."); yyerrok;} -| program_configuration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid program configuration in resource declaration."); yyerrok;} -| program_configuration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after program configuration in resource declaration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -resource_name: identifier; - -/* -access_declarations: - VAR_ACCESS access_declaration_list END_VAR - {$$ = NULL;} -// ERROR_CHECK_BEGIN // -| VAR_ACCESS END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in access variable(s) declaration."); yynerrs++;} -| VAR_ACCESS error access_declaration_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_ACCESS' in access variable(s) declaration."); yyerrok;} -| VAR_ACCESS access_declaration_list error END_VAR - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed access variable(s) declaration."); yyerrok;} -| VAR_ACCESS error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in access variable(s) declaration."); yyerrok;} -// ERROR_CHECK_END // -; - -// helper symbol for access_declarations // -access_declaration_list: - access_declaration ';' -| access_declaration_list access_declaration ';' -// ERROR_CHECK_BEGIN // -| error ';' - {$$ = // create a new list //; - print_err_msg(locf(@1), locl(@1), "invalid access variable declaration."); yyerrok;} -| access_declaration error - {$$ = // create a new list //; - print_err_msg(locl(@1), locf(@2), "';' missing at the end of access variable declaration."); yyerrok;} -| access_declaration_list access_declaration error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of access variable declaration."); yyerrok;} -| access_declaration_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid access variable declaration."); yyerrok;} -| access_declaration_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after access variable declaration."); yynerrs++;} -// ERROR_CHECK_END // -; - - -access_declaration: - access_name ':' access_path ':' non_generic_type_name -| access_name ':' access_path ':' non_generic_type_name direction -; - - -access_path: - prev_declared_direct_variable -| prev_declared_resource_name '.' prev_declared_direct_variable -| any_fb_name_list symbolic_variable -| prev_declared_resource_name '.' any_fb_name_list symbolic_variable -| prev_declared_program_name '.' any_fb_name_list symbolic_variable -| prev_declared_resource_name '.' prev_declared_program_name '.' any_fb_name_list symbolic_variable -; -*/ - -// helper symbol for -// - access_path -// - instance_specific_init -// -/* NOTE: The fb_name_list refers to funtion block variables - * that have been declared in a scope outside the one we are - * currently parsing, so we must accept them to be any_identifier! - * - * Beware that other locations of this syntax parser also require - * a fb_name_list. In those locations the function blocks are being declared, - * so only currently un-used identifiers (i.e. identifier) may be accepted. - * - * In order to distinguish the two, here we use any_fb_name_list, while - * in the the locations we simply use fb_name_list! - */ -any_fb_name_list: - // empty - {$$ = new any_fb_name_list_c(locloc(@$));} -//| fb_name_list fb_name '.' -| any_fb_name_list any_identifier '.' - {$$ = $1; $$->add_element($2);} -; - - - -global_var_reference: -// [resource_name '.'] global_var_name ['.' structure_element_name] // - prev_declared_global_var_name - {$$ = new global_var_reference_c(NULL, $1, NULL, locloc(@$));} -| prev_declared_global_var_name '.' structure_element_name - {$$ = new global_var_reference_c(NULL, $1, $3, locloc(@$));} -| prev_declared_resource_name '.' prev_declared_global_var_name - {$$ = new global_var_reference_c($1, $3, NULL, locloc(@$));} -| prev_declared_resource_name '.' prev_declared_global_var_name '.' structure_element_name - {$$ = new global_var_reference_c($1, $3, $5, locloc(@$));} -; - - -//access_name: identifier; - - -program_output_reference: -/* NOTE: - * program_output_reference is merely used within data_source. - * data_source is merely used within task_initialization - * task_initialization appears in a configuration declaration - * _before_ the programs are declared, so we cannot use - * prev_declared_program_name, as what might seem correct at first. - * - * The semantic checker must later check whether the identifier - * used really refers to a program declared after the task - * initialization! - */ -// prev_declared_program_name '.' symbolic_variable - program_name '.' symbolic_variable - {$$ = new program_output_reference_c($1, $3, locloc(@$));} -; - -program_name: identifier; - -/* -direction: - READ_WRITE - {$$ = NULL;} -| READ_ONLY - {$$ = NULL;} -; -*/ - -task_configuration: - TASK task_name task_initialization - {$$ = new task_configuration_c($2, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| TASK task_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no task name defined in task declaration."); yynerrs++;} -| TASK error task_initialization - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid task name defined in task declaration."); yyerrok;} -| TASK task_name error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no task initialization defined in task declaration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid task initialization in task declaration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* NOTE: The specification does not mention the namespace to which task names - * should belong to. Unlike resource and program names, for the moment we - * let the task names belong to their own private namespace, as they do not - * produce any conflicts in the syntax parser. - * If in the future our interpretation of the spec. turns out to be incorrect, - * the definition of task_name may have to be changed! - */ -task_name: any_identifier; - - -task_initialization: -// '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' // - '(' {cmd_goto_task_init_state();} task_initialization_single task_initialization_interval task_initialization_priority ')' - {$$ = new task_initialization_c($3, $4, $5, locloc(@$));} -; - - -task_initialization_single: -// [SINGLE ASSIGN data_source ','] - /* empty */ - {$$ = NULL;} -| SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} - {$$ = $4;} -/* ERROR_CHECK_BEGIN */ -| SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} - {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'SINGLE' in task initialization."); yynerrs++;} -| SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();} - {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no data source defined in 'SINGLE' statement of task initialization."); yynerrs++;} -| SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();} - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid data source defined in 'SINGLE' statement of task initialization."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -task_initialization_interval: -// [INTERVAL ASSIGN data_source ','] - /* empty */ - {$$ = NULL;} -| INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} - {$$ = $4;} -/* ERROR_CHECK_BEGIN */ -| INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} - {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'INTERVAL' in task initialization.");} -| INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();} - {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no data source defined in 'INTERVAL' statement of task initialization."); yynerrs++;} -| INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();} - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid data source defined in 'INTERVAL' statement of task initialization."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -task_initialization_priority: -// PRIORITY ASSIGN integer - PRIORITY ASSIGN {cmd_pop_state();} integer - {$$ = $4;} -/* ERROR_CHECK_BEGIN */ -| PRIORITY {cmd_pop_state();} integer - {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'PRIORITY' in task initialization."); yynerrs++;} -| PRIORITY ASSIGN {cmd_pop_state();} error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@4), "no priority number defined in 'PRIORITY' statement of task initialization.");} - else {print_err_msg(locf(@4), locl(@4), "invalid priority number in 'PRIORITY' statement of task initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -data_source: - constant -| global_var_reference -| program_output_reference -| prev_declared_direct_variable -; - -program_configuration: -// PROGRAM [RETAIN | NON_RETAIN] program_name [WITH task_name] ':' program_type_name ['(' prog_conf_elements ')'] // - PROGRAM program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = new program_configuration_c(NULL, $2, $3, $5, $6, locloc(@$)); - variable_name_symtable.insert($2, prev_declared_program_name_token); - } -| PROGRAM RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = new program_configuration_c(new retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$)); - variable_name_symtable.insert($3, prev_declared_program_name_token); - } -| PROGRAM NON_RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$)); - variable_name_symtable.insert($3, prev_declared_program_name_token); - } -/* ERROR_CHECK_BEGIN */ -| PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@5), locl(@5), "invalid program type name after ':' in program configuration."); yynerrs++;} -| PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid program type name after ':' in program configuration."); yynerrs++;} -| PROGRAM NON_RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid program type name after ':' in program configuration."); yynerrs++;} -| PROGRAM error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'PROGRAM' in program configuration."); yyerrok;} -| PROGRAM RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive program configuration."); yyerrok;} -| PROGRAM NON_RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive program configuration."); yyerrok;} -| PROGRAM optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no program name defined in program configuration."); yynerrs++;} -| PROGRAM RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no program name defined in retentive program configuration."); yynerrs++;} -| PROGRAM NON_RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no program name defined in non-retentive program configuration."); yynerrs++;} -| PROGRAM error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program name defined in program configuration."); yyerrok;} -| PROGRAM RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid program name defined in retentive program configuration."); yyerrok;} -| PROGRAM NON_RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid program name defined in non-retentive program configuration."); yyerrok;} -| PROGRAM program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "':' missing after program name or optional task name in program configuration."); yynerrs++;} -| PROGRAM RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':' missing after program name or optional task name in retentive program configuration."); yynerrs++;} -| PROGRAM NON_RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':' missing after program name or optional task name in non-retentive program configuration."); yynerrs++;} -| PROGRAM program_name optional_task_name ':' optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no program type defined in program configuration."); yynerrs++;} -| PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no program type defined in retentive program configuration."); yynerrs++;} -| PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements - {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no program type defined in non-retentive program configuration."); yynerrs++;} -/* ERROR_CHECK_END */ -; - -// helper symbol for program_configuration // -optional_task_name: - // empty // - {$$ = NULL;} -| WITH task_name - {$$ = $2;} -/* ERROR_CHECK_BEGIN */ -| WITH error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no task name defined in optional task name of program configuration.");} - else {print_err_msg(locf(@2), locl(@2), "invalid task name in optional task name of program configuration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -// helper symbol for program_configuration // -optional_prog_conf_elements: - // empty // - {$$ = NULL;} -| '(' prog_conf_elements ')' - {$$ = $2;} -/* ERROR_CHECK_BEGIN */ -| '(' error ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program configuration elements in program configuration."); yyerrok;} -| '(' prog_conf_elements error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of program configuration elements in program configuration."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -prog_conf_elements: - prog_conf_element - {$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);} -| prog_conf_elements ',' prog_conf_element - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| prog_conf_elements prog_conf_element - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in program configuration elements list."); yynerrs++;} -| prog_conf_elements ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for program configuration element in program configuration list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value for program configuration element in program configuration list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -prog_conf_element: - fb_task -| prog_cnxn -; - - -fb_task: - // fb_name WITH task_name -/* NOTE: The fb_name refers to funtion block variables - * that have been declared in a scope outside the one we are - * currently parsing, so we must accept them to be any_identifier! - */ - any_identifier WITH task_name - {$$ = new fb_task_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| any_identifier WITH error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no task name defined in function block configuration.");} - else {print_err_msg(locf(@3), locl(@3), "invalid task name in function block configuration."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -/* NOTE: - * The semantics of configuring a program are rather confusing, so here is - * my (Mario) understanding on the issue... - * - * A function/program may have as its input variables a simple variable - * (BYTE, WORD, etc...), an array (ARRAY [1 .. 3] OF BYTE, ...) , or a structure. - * Nevertheless, when calling this function from within a st or il language statement - * it is not possible to allocate a value to a single element of the array or structure - * typed input variable, as the accepted syntax is simply '(' variable_name ':=' variable ')' - * Notice how the variable_name does not include things such as 'a.elem1' or 'a[1]'! - * - * Nevertheless, when configuring a program from within a configuration, - * it becomes possible to allocate values to individual elements of the - * array or structured type input variable, as the syntax is now - * '(' symbolic_variable ':=' data_sink|prog_data_source ')' - * Notice how the symbolic_variable _does_ include things such as 'a.elem1' or 'a[1]'! - * - * Conclusion: Unlike other locations in the syntax where SENDTO appears, - * here it is not valid to replace symbolic_variable with any_identifier! - * Nevertheless, it is also not correct to leave symbolic_variable as it is, - * as we have defined it to only include previously declared variables, - * which is not the case in this situation. Here symbolic_variable is refering - * to variables that were defined within the scope of the program that is being - * called, and _not_ within the scope of the configuration that is calling the - * program, so the variables in question are not declared in the current scope! - * - * We therefore need to define a new symbolic_variable, that accepts any_identifier - * instead of previosuly declared variable names, to be used in the definition of - * prog_cnxn! - */ -prog_cnxn: - any_symbolic_variable ASSIGN prog_data_source - {$$ = new prog_cnxn_assign_c($1, $3, locloc(@$));} -| any_symbolic_variable SENDTO data_sink - {$$ = new prog_cnxn_sendto_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| any_symbolic_variable constant - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element."); yynerrs++;} -| any_symbolic_variable enumerated_value - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element."); yynerrs++;} -| any_symbolic_variable data_sink - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' or '=>' missing between parameter and variable in program configuration element."); yynerrs++;} -| any_symbolic_variable ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value or variable defined in program configuration assignment element.");} - else {print_err_msg(locf(@3), locl(@3), "invalid value or variable in program configuration assignment element."); yyclearin;} - yyerrok; - } -| any_symbolic_variable SENDTO error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable defined in program configuration sendto element.");} - else {print_err_msg(locf(@3), locl(@3), "invalid variable in program configuration sendto element."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -prog_data_source: - constant -| enumerated_value -| global_var_reference -| prev_declared_direct_variable -; - -data_sink: - global_var_reference -| prev_declared_direct_variable -; - -instance_specific_initializations: - VAR_CONFIG instance_specific_init_list END_VAR - {$$ = new instance_specific_initializations_c($2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| VAR_CONFIG END_VAR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in configuration variable(s) initialization."); yynerrs++;} -| VAR_CONFIG error instance_specific_init_list END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_CONFIG' in configuration variable(s) initialization."); yyerrok;} -| VAR_CONFIG instance_specific_init_list error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed configuration variable(s) initialization."); yyerrok;} -| VAR_CONFIG error END_VAR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in configuration variable(s) initialization."); yyerrok;} -/* ERROR_CHECK_END */ -; - -// helper symbol for instance_specific_initializations // -instance_specific_init_list: - instance_specific_init ';' - {$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);} -| instance_specific_init_list instance_specific_init ';' - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| error ';' - {$$ = new instance_specific_init_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid configuration variable initialization."); yyerrok;} -| instance_specific_init error - {$$ = new instance_specific_init_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of configuration variable initialization."); yyerrok;} -| instance_specific_init_list instance_specific_init error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of configuration variable initialization."); yyerrok;} -| instance_specific_init_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid configuration variable initialization."); yyerrok;} -| instance_specific_init_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after configuration variable initialization."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -instance_specific_init: -// -// resource_name '.' program_name '.' {fb_name '.'} -// ((variable_name [location] ':' located_var_spec_init) | (fb_name ':' function_block_type_name ':=' structure_initialization)) -// -// prev_declared_resource_name '.' prev_declared_program_name '.' any_fb_name_list variable_name ':' located_var_spec_init -/* NOTE: variable_name has been changed to any_identifier (and not simply identifier) because the - * variables being referenced have been declared outside the scope currently being parsed! - */ -/* NOTE: program_name has not been changed to prev_declared_program_name because the - * programs being referenced have been declared outside the scope currently being parsed! - * The programs are only kept inside the scope of the resource in which they are defined. - */ - prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier ':' located_var_spec_init - {$$ = new instance_specific_init_c($1, $3, $5, $6, NULL, $8, locloc(@$));} -| prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier location ':' located_var_spec_init - {$$ = new instance_specific_init_c($1, $3, $5, $6, $7, $9, locloc(@$));} -| prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier ':' fb_initialization - {$5->add_element($6); $$ = new instance_specific_init_c($1, $3, $5, NULL, NULL, $8, locloc(@$));} -; - - -/* helper symbol for instance_specific_init */ -fb_initialization: - function_block_type_name ASSIGN structure_initialization - {$$ = new fb_initialization_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| function_block_type_name structure_initialization - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between function block name and initialization in function block initialization."); yynerrs++;} -| function_block_type_name ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in function block initialization.");} - else {print_err_msg(locf(@3), locl(@3), "invalid initial value in function block initialization."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/***********************************/ -/* B 2.1 Instructions and Operands */ -/***********************************/ -/* helper symbol for many IL instructions, etc... */ -/* eat up any extra EOL tokens... */ - -eol_list: - EOL -| eol_list EOL -; - - - -instruction_list: - il_instruction - {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} -| any_pragma eol_list - {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} -| instruction_list il_instruction - {$$ = $1; $$->add_element($2);} -| instruction_list any_pragma - {$$ = $1; $$->add_element($2);} -; - - - -il_instruction: - il_incomplete_instruction eol_list - {$$ = new il_instruction_c(NULL, $1, locloc(@$));} -| label ':' il_incomplete_instruction eol_list - {$$ = new il_instruction_c($1, $3, locloc(@$));} -| label ':' eol_list - {$$ = new il_instruction_c($1, NULL, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| error eol_list - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid IL instruction."); yyerrok;} -| il_incomplete_instruction error - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of IL instruction."); yyerrok;} -| error ':' il_incomplete_instruction eol_list - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid label in IL instruction."); yyerrok;} -| label il_incomplete_instruction eol_list - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after label in IL instruction."); yynerrs++;} -| label ':' error eol_list - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid IL instruction."); yyerrok;} -| label ':' il_incomplete_instruction error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "EOL missing at the end of IL instruction."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for il_instruction */ -il_incomplete_instruction: - il_simple_operation -| il_expression -| il_jump_operation -| il_fb_call -| il_formal_funct_call -| il_return_operator -; - - -label: identifier; - - - -il_simple_operation: -// (il_simple_operator [il_operand]) | (function_name [il_operand_list]) - il_simple_operator - {$$ = new il_simple_operation_c($1, NULL, locloc(@$));} -/* - * Note: Bison is getting confused with the following rule, - * i.e. it is finding conflicts where there seemingly are really none. - * The rule was therefore replaced by the equivalent following - * two rules. - */ -/* -| il_simple_operator il_operand - {$$ = new il_simple_operation_c($1, $2, locloc(@$));} -*/ -| il_simple_operator_noclash il_operand - {$$ = new il_simple_operation_c($1, $2, locloc(@$));} -| il_simple_operator_clash il_operand - {$$ = new il_simple_operation_c($1, $2, locloc(@$));} -/* NOTE: the line - * | il_simple_operator - * already contains the 'NOT' operator, as well as all the - * expression operators ('MOD', 'AND', etc...), all of which - * may also be a function name! This means that these operators/functions, - * without any operands, could be reduced to either an operator or a - * function call. - * - * I (Mario) have chosen to reduce it to an operator. - * In order to do this, we must remove from the syntax that defines - * function calls all the functions whose names clash with the IL operators. - * - * The line - * | function_name - * has been replaced with the lines - * | function_name_no_clashes - * in order to include all possible function names except - * those whose names coincide with operators !! - */ -| function_name_no_clashes - {$$ = new il_function_call_c($1, NULL, locloc(@$));} -/* NOTE: the line - * | il_simple_operator il_operand - * already contains the 'NOT', 'MOD', etc. operators, followed by a single il_operand. - * However, this same code (MOD x) may also be reduced to a function call to the MOD - * function. This means that (MOD, AND,...) could be interpret as a function name - * or as an IL operator! This would lead us to a reduce/reduce conflict! - * - * I (Mario) have chosen to reduce it to an operand, rather than a function call. - * In order to do this, we must remove from the syntax that defines - * function calls all the functions whose names clash with the IL operators. - * - * The line - * | function_name il_operand_list - * has been replaced with the line - * | function_name_no_clashes il_operand_list - * in order to include all possible function names except - * for the function names which clash with expression and simple operators. - * - * Note that: - * this alternative syntax does not cover the possibility of - * the function 'NOT', 'MOD', etc... being called with more than one il_operand, - * in which case it is always a function call, and not an IL instruction. - * We therefore need to include an extra rule where the - * function_name_expression_clashes and function_name_simpleop_clashes - * are followed by a il_operand_list with __two__ or more il_operands!! - */ -| function_name_no_clashes il_operand_list - {$$ = new il_function_call_c($1, $2, locloc(@$));} -| il_simple_operator_clash il_operand_list2 - {$$ = new il_function_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));} -; - - - -il_expression: -// il_expr_operator '(' [il_operand] EOL {EOL} [simple_instr_list] ')' -/* - * Note: Bison is getting confused with the use of il_expr_operator, - * i.e. it is finding conflicts where there seemingly are really none. - * il_expr_operator was therefore replaced by the equivalent - * il_expr_operator_noclash | il_expr_operator_clash. - */ - 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(@$));} -| 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(@$));} -| 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(@$));} -| il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')' - {$$ = 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 */ -| il_expr_operator_noclash '(' eol_list error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of IL expression."); yyerrok;} -| il_expr_operator_noclash '(' il_operand eol_list error - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;} -| il_expr_operator_noclash '(' eol_list simple_instr_list error - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;} -| il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error - {$$ = NULL; print_err_msg(locl(@5), locf(@6), "')' missing at the end of IL expression."); yyerrok;} -| il_expr_operator_clash '(' il_operand eol_list error - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;} -| il_expr_operator_clash '(' il_operand eol_list simple_instr_list error - {$$ = NULL; print_err_msg(locl(@5), locf(@6), "')' missing at the end of IL expression."); yyerrok;} -| il_expr_operator_clash_eol_list simple_instr_list error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of IL expression."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_jump_operation: - il_jump_operator label - {$$ = new il_jump_operation_c($1, $2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| il_jump_operator error - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid label defined in IL jump operation."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_fb_call: -// il_call_operator fb_name ['(' (EOL {EOL} [il_param_list]) | [il_operand_list] ')'] - il_call_operator prev_declared_fb_name - {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} -| il_call_operator prev_declared_fb_name '(' ')' - {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} -| il_call_operator prev_declared_fb_name '(' eol_list ')' - {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} -| il_call_operator prev_declared_fb_name '(' il_operand_list ')' - {$$ = new il_fb_call_c($1, $2, $4, NULL, locloc(@$));} -| il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')' - {$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| il_call_operator error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call.");} - else {print_err_msg(locf(@2), locl(@2), "invalid function block name in IL function block call."); yyclearin;} - yyerrok; - } -| il_call_operator '(' ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} -| il_call_operator '(' eol_list ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} -| il_call_operator '(' il_operand_list ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} -| il_call_operator '(' eol_list il_param_list ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} -| il_call_operator error '(' ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} -| il_call_operator error '(' eol_list ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} -| il_call_operator error '(' il_operand_list ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} -| il_call_operator error '(' eol_list il_param_list ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} -| il_call_operator prev_declared_fb_name ')' - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call."); yynerrs++;} -| il_call_operator prev_declared_fb_name il_operand_list ')' - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call."); yynerrs++;} -| il_call_operator prev_declared_fb_name '(' error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of IL function block call."); yyerrok;} -| il_call_operator prev_declared_fb_name '(' eol_list error - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL function block call."); yyerrok;} -| il_call_operator prev_declared_fb_name '(' il_operand_list error - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL function block call."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: Please read note above the definition of function_name_without_clashes */ -il_formal_funct_call: -// function_name '(' EOL {EOL} [il_param_list] ')' -/* function_name '(' eol_list ')' */ -/* NOTE: il_formal_funct_call is only used in the definition of - * - il_incomplete_instruction - * - il_simple_instruction - * In both of the above, il_expression also - * shows up as another option. This means that the functions whose - * names clash with expressions, followed by '(' eol_list ')', are - * already included. We must therefore leave them out in this - * definition in order to remove reduce/reduce conflicts. - * - * In summary: 'MOD' '(' eol_list ')', and all other functions whose - * names clash with expressions may be interpreted by the syntax by - * two different routes. I (Mario) chose to interpret them - * as operators, rather than as function calls! - * (AND MOD OR XOR ADD DIV EQ GT GE LT LE MUL NE SUB) - */ - function_name_no_clashes '(' eol_list ')' - {$$ = new il_formal_funct_call_c($1, NULL, locloc(@$));} -| function_name_simpleop_clashes '(' eol_list ')' - {$$ = new il_formal_funct_call_c($1, NULL, locloc(@$));} -/* | function_name '(' eol_list il_param_list ')' */ -/* For the above syntax, we no longer have two ways of interpreting the - * same syntax. The above is always a function call! - * However, some of the functions that we may be calling - * may have the same name as an IL operator. This means that - * flex will be parsing them and handing them over to bison as - * IL operator tokens, and not as function name tokens. - * (when parsing ST, flex no longer recognizes IL operators, - * so will always return the correct function name, unless that - * name also coincides with an operator used in ST -> XOR, OR, MOD, AND, NOT) - * - * We must therefore interpret the IL operators as function names! - */ -| function_name_no_clashes '(' eol_list il_param_list ')' - {$$ = new il_formal_funct_call_c($1, $4, locloc(@$));} -| function_name_simpleop_clashes '(' eol_list il_param_list ')' - {$$ = new il_formal_funct_call_c($1, $4, locloc(@$));} -/* The following line should read: - * - * | function_name_expression_clashes '(' eol_list il_param_list ')' - * - * but the function_name_expression_clashes had to be first reduced to - * an intermediary symbol in order to remove a reduce/reduce conflict. - * In essence, the syntax requires more than one look ahead token - * in order to be parsed. We resolve this by reducing a collection of - * symbols into a temporary symbol (il_expr_operator_clash_eol_list), that - * will later be replaced by the correct symbol. The correct symbol will - * now be determined by a single look ahead token, as all the common - * symbols have been reduced to the temporary symbol - * il_expr_operator_clash_eol_list ! - * - * Unfortunately, this work around results in the wrong symbol - * being created for the abstract syntax tree. - * We need to figure out which symbol was created, destroy it, - * and create the correct symbol for our case. - * This is a lot of work, so I put it in a function - * at the end of this file... il_operator_c_2_identifier_c() - */ -| il_expr_operator_clash_eol_list il_param_list ')' - {$$ = new il_formal_funct_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| function_name_no_clashes '(' eol_list error ')' - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid parameter list defined in IL formal function call."); yyerrok;} -| function_name_simpleop_clashes '(' eol_list error ')' - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid parameter list defined in IL formal function call."); yyerrok;} -| il_expr_operator_clash_eol_list error ')' - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter list defined in IL formal function call."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_expr_operator_clash_eol_list: - il_expr_operator_clash '(' eol_list - {$$ = $1;} -/* ERROR_CHECK_BEGIN */ -| il_expr_operator_clash '(' error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "EOL missing after '(' in IL instruction."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_operand: - variable -| enumerated_value -| constant -; - - -il_operand_list: - il_operand - {$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1);} -| il_operand_list2 -; - - -/* List with 2 or more il_operands */ -il_operand_list2: - il_operand ',' il_operand - {$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);} -| il_operand_list2 ',' il_operand - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| il_operand_list2 il_operand - {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in IL operand list."); yynerrs++;} -| il_operand ',' error - {$$ = new il_operand_list_c(locloc(@$)); - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no operand defined in IL operand list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid operand name in IL operand list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -simple_instr_list: - il_simple_instruction - {$$ = new simple_instr_list_c(locloc(@$)); $$->add_element($1);} -| simple_instr_list il_simple_instruction - {$$ = $1; $$->add_element($2);} -; - - -il_simple_instruction: - il_simple_operation eol_list -| il_expression eol_list -| il_formal_funct_call eol_list -/* ERROR_CHECK_BEGIN */ -| il_expression error - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing after expression IL instruction."); yyerrok;} -| il_formal_funct_call error - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing after formal function call IL instruction."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* NOTE: the correct definition of il_param_list is - * il_param_list ::= {il_param_instruction} il_param_last_instruction - * - * where {...} denotes zero or many il_param_instruction's. - * - * We could do this by defining the following: - * il_param_list: il_param_instruction_list il_param_last_instruction; - * il_param_instruction_list : ** empty ** | il_param_instruction_list il_param_instruction; - * - * Unfortunately, the above leads to reduce/reduce conflicts. - * The chosen alternative (as follows) does not have any conflicts! - * il_param_list: il_param_last_instruction | il_param_instruction_list il_param_last_instruction; - * il_param_instruction_list : il_param_instruction_list | il_param_instruction_list il_param_instruction; - */ -il_param_list: - il_param_instruction_list il_param_last_instruction - {$$ = $1; $$->add_element($2);} -| il_param_last_instruction - {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} -/* ERROR_CHECK_BEGIN */ -| il_param_instruction_list error - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid parameter assignment in parameter assignment list."); yyerrok;} -| il_param_last_instruction il_param_last_instruction - {$$ = new il_param_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} -| il_param_instruction_list il_param_last_instruction il_param_last_instruction - {$$ = $1; print_err_msg(locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -/* Helper symbol for il_param_list */ -il_param_instruction_list: - il_param_instruction - {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} -| il_param_instruction_list il_param_instruction - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| il_param_last_instruction il_param_instruction - {$$ = new il_param_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} -| il_param_instruction_list il_param_last_instruction il_param_instruction - {$$ = $1; print_err_msg(locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -il_param_instruction: - il_param_assignment ',' eol_list -| il_param_out_assignment ',' eol_list -/* ERROR_CHECK_BEGIN */ -| il_param_assignment ',' error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "EOL missing at the end of parameter assignment in parameter assignment list."); yyerrok;} -| il_param_out_assignment ',' error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "EOL missing at the end of parameter out assignment in parameter assignment list."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_param_last_instruction: - il_param_assignment eol_list -| il_param_out_assignment eol_list -/* ERROR_CHECK_BEGIN */ -| il_param_assignment error - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of last parameter assignment in parameter assignment list."); yyerrok;} -| il_param_out_assignment error - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of last parameter out assignment in parameter assignment list."); yyerrok;} -/* ERROR_CHECK_END */ - -; - - -il_param_assignment: - il_assign_operator il_operand - {$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));} -| il_assign_operator '(' eol_list simple_instr_list ')' - {$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| error il_operand - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid operator in parameter assignment."); yyerrok;} -| error '(' eol_list simple_instr_list ')' - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid operator in parameter assignment."); yyerrok;} -| il_assign_operator error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no operand defined in parameter assignment.");} - else {print_err_msg(locf(@2), locl(@2), "invalid operand in parameter assignment."); yyclearin;} - yyerrok; - } -| il_assign_operator '(' eol_list ')' - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no instruction list defined in parameter assignment."); yynerrs++;} -| il_assign_operator '(' eol_list error ')' - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid instruction list defined in parameter assignment."); yyerrok;} -| il_assign_operator '(' eol_list simple_instr_list error - {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of instruction list defined in parameter assignment."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_param_out_assignment: - il_assign_out_operator variable - {$$ = new il_param_out_assignment_c($1, $2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| il_assign_out_operator error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no variable defined in IL operand list.");} - else {print_err_msg(locf(@2), locl(@2), "invalid variable in IL operand list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - -/*******************/ -/* B 2.2 Operators */ -/*******************/ -sendto_identifier: sendto_identifier_token {$$ = new identifier_c($1, locloc(@$));}; - - -/* NOTE: - * The spec includes the operator 'EQ ' - * Note that EQ is followed by a space. - * I am considering this a typo, and defining the operator - * as 'EQ' - * (Mario) - */ -LD_operator: LD {$$ = new LD_operator_c(locloc(@$));}; -LDN_operator: LDN {$$ = new LDN_operator_c(locloc(@$));}; -ST_operator: ST {$$ = new ST_operator_c(locloc(@$));}; -STN_operator: STN {$$ = new STN_operator_c(locloc(@$));}; -NOT_operator: NOT {$$ = new NOT_operator_c(locloc(@$));}; -S_operator: S {$$ = new S_operator_c(locloc(@$));}; -R_operator: R {$$ = new R_operator_c(locloc(@$));}; -S1_operator: S1 {$$ = new S1_operator_c(locloc(@$));}; -R1_operator: R1 {$$ = new R1_operator_c(locloc(@$));}; -CLK_operator: CLK {$$ = new CLK_operator_c(locloc(@$));}; -CU_operator: CU {$$ = new CU_operator_c(locloc(@$));}; -CD_operator: CD {$$ = new CD_operator_c(locloc(@$));}; -PV_operator: PV {$$ = new PV_operator_c(locloc(@$));}; -IN_operator: IN {$$ = new IN_operator_c(locloc(@$));}; -PT_operator: PT {$$ = new PT_operator_c(locloc(@$));}; -AND_operator: AND {$$ = new AND_operator_c(locloc(@$));}; -AND2_operator: AND2 {$$ = new AND_operator_c(locloc(@$));}; /* '&' in the source code! */ -OR_operator: OR {$$ = new OR_operator_c(locloc(@$));}; -XOR_operator: XOR {$$ = new XOR_operator_c(locloc(@$));}; -ANDN_operator: ANDN {$$ = new ANDN_operator_c(locloc(@$));}; -ANDN2_operator: ANDN2 {$$ = new ANDN_operator_c(locloc(@$));}; /* '&N' in the source code! */ -ORN_operator: ORN {$$ = new ORN_operator_c(locloc(@$));}; -XORN_operator: XORN {$$ = new XORN_operator_c(locloc(@$));}; -ADD_operator: ADD {$$ = new ADD_operator_c(locloc(@$));}; -SUB_operator: SUB {$$ = new SUB_operator_c(locloc(@$));}; -MUL_operator: MUL {$$ = new MUL_operator_c(locloc(@$));}; -DIV_operator: DIV {$$ = new DIV_operator_c(locloc(@$));}; -MOD_operator: MOD {$$ = new MOD_operator_c(locloc(@$));}; -GT_operator: GT {$$ = new GT_operator_c(locloc(@$));}; -GE_operator: GE {$$ = new GE_operator_c(locloc(@$));}; -EQ_operator: EQ {$$ = new EQ_operator_c(locloc(@$));}; -LT_operator: LT {$$ = new LT_operator_c(locloc(@$));}; -LE_operator: LE {$$ = new LE_operator_c(locloc(@$));}; -NE_operator: NE {$$ = new NE_operator_c(locloc(@$));}; -CAL_operator: CAL {$$ = new CAL_operator_c(locloc(@$));}; -CALC_operator: CALC {$$ = new CALC_operator_c(locloc(@$));}; -CALCN_operator: CALCN {$$ = new CALCN_operator_c(locloc(@$));}; -RET_operator: RET {$$ = new RET_operator_c(locloc(@$));}; -RETC_operator: RETC {$$ = new RETC_operator_c(locloc(@$));}; -RETCN_operator: RETCN {$$ = new RETCN_operator_c(locloc(@$));}; -JMP_operator: JMP {$$ = new JMP_operator_c(locloc(@$));}; -JMPC_operator: JMPC {$$ = new JMPC_operator_c(locloc(@$));}; -JMPCN_operator: JMPCN {$$ = new JMPCN_operator_c(locloc(@$));}; - - -il_simple_operator: - il_simple_operator_clash -| il_simple_operator_noclash -; - - -il_simple_operator_noclash: - LD_operator -| LDN_operator -| ST_operator -| STN_operator -| S_operator -| R_operator -| S1_operator -| R1_operator -| CLK_operator -| CU_operator -| CD_operator -| PV_operator -| IN_operator -| PT_operator -| il_expr_operator_noclash -; - - -il_simple_operator_clash: - il_simple_operator_clash1 -| il_simple_operator_clash2 -; - -il_simple_operator_clash1: - NOT_operator -; - -il_simple_operator_clash2: - il_expr_operator_clash -; - - -/* -il_expr_operator: - il_expr_operator_noclash -| il_expr_operator_clash -; -*/ - -il_expr_operator_clash: - AND_operator -| OR_operator -| XOR_operator -| ADD_operator -| SUB_operator -| MUL_operator -| DIV_operator -| MOD_operator -| GT_operator -| GE_operator -| EQ_operator -| LT_operator -| LE_operator -| NE_operator -; - - -il_expr_operator_noclash: - ANDN_operator -| ANDN2_operator /* string '&N' in source code! */ -| AND2_operator /* string '&' in source code! */ -| ORN_operator -| XORN_operator -; - - - - -il_assign_operator: -/* variable_name ASSIGN */ - any_identifier ASSIGN - {$$ = new il_assign_operator_c($1, locloc(@$));} -| en_identifier ASSIGN - {$$ = new il_assign_operator_c($1, locloc(@$));} -| S1_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| R1_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| CLK_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| CU_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| CD_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| PV_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| IN_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -| PT_operator ASSIGN - {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| error ASSIGN - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid parameter defined in parameter assignment."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_assign_out_operator: -/* variable_name SENDTO */ -/* any_identifier SENDTO */ - sendto_identifier SENDTO - {$$ = new il_assign_out_operator_c(NULL, $1, locloc(@$));} -/* The following is not required, as the sendto_identifier_token returned by flex will - * also include the 'ENO' identifier. - * The resulting abstract syntax tree is identical with or without this following rule, - * as both the eno_identifier and the sendto_identifier are stored as - * an identifier_c !! - * - * To understand why we must even explicitly consider the use of ENO here, - * please read the comment above the definition of 'variable' in section B1.4 for details. - */ -/* -| eno_identifier SENDTO - {$$ = new il_assign_out_operator_c(NULL, $1, locloc(@$));} -*/ -/*| NOT variable_name SENDTO */ -| NOT sendto_identifier SENDTO - {$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));} -/* The following is not required, as the sendto_identifier_token returned by flex will - * also include the 'ENO' identifier. - * The resulting abstract syntax tree is identical with or without this following rule, - * as both the eno_identifier and the sendto_identifier are stored as - * an identifier_c !! - * - * To understand why we must even explicitly consider the use of ENO here, - * please read the comment above the definition of 'variable' in section B1.4 for details. - * - * NOTE: Removing the following rule also removes a shift/reduce conflict from the parser. - * This conflict is not really an error/ambiguity in the syntax, but rather - * due to the fact that more than a single look-ahead token would be required - * to correctly parse the syntax, something that bison does not support. - * - * The shift/reduce conflict arises because bison does not know whether - * to parse the 'NOT ENO' in the following code - * LD 1 - * funct_name ( - * NOT ENO => bool_var, - * EN := TRUE - * ) - * as either a il_param_assignment (wrong!) or an il_param_out_assignment.(correct). - * The '=>' delimiter (known as SEND_TO in this iec.y file) is a dead giveaway that - * it should be parsed as an il_param_out_assignment, but still, bison gets confused! - * Bison considers the possibility of reducing the 'NOT ENO' as an NOT_operator with - * the 'ENO' operand - * (NOT_operator -> il_simple_operator -> il_simple_operation -> il_simple_instruction -> - * -> simple_instr_list -> il_param_assignment) - * instead of reducing it to an il_param_out_operator. - * ( il_param_out_operator -> il_param_out_assignment) - * - * Note that the shift/reduce conflict only manifests itself in the il_formal_funct_call, - * where both the il_param_out_assignment and il_param_assignment are used! - * - * il_param_out_assignment --+--> il_param_instruction -> il_param_instruction_list --+ - * | | - * il_param_assignment --+ | - * | - * il_formal_funct_call <- il_param_list <-+ - * - */ -/* -| NOT eno_identifier SENDTO - {$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));} -*/ -/* ERROR_CHECK_BEGIN */ -| error SENDTO - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid parameter defined in parameter out assignment."); yyerrok;} -| NOT SENDTO - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no parameter defined in parameter out assignment."); yynerrs++;} -| NOT error SENDTO - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter defined in parameter out assignment."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -il_call_operator: - CAL_operator -| CALC_operator -| CALCN_operator -; - - -il_return_operator: - RET_operator -| RETC_operator -| RETCN_operator -; - - -il_jump_operator: - JMP_operator -| JMPC_operator -| JMPCN_operator -; - - -/***********************/ -/* B 3.1 - Expressions */ -/***********************/ -expression: - xor_expression -| expression OR xor_expression - {$$ = new or_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| expression OR error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'OR' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'OR' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -xor_expression: - and_expression -| xor_expression XOR and_expression - {$$ = new xor_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| xor_expression XOR error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'XOR' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'XOR' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -and_expression: - comparison -| and_expression '&' comparison - {$$ = new and_expression_c($1, $3, locloc(@$));} -| and_expression AND comparison - {$$ = new and_expression_c($1, $3, locloc(@$));} -/* NOTE: The lexical parser never returns the token '&'. - * The '&' string is interpreted by the lexcial parser as the token - * AND2! - * This means that the first rule with '&' is actually not required, - * but we leave it in nevertheless just in case we later decide - * to remove the AND2 token... - */ -| and_expression AND2 comparison - {$$ = new and_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| and_expression '&' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '&' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '&' in ST expression."); yyclearin;} - yyerrok; - } -| and_expression AND error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'AND' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'AND' in ST expression."); yyclearin;} - yyerrok; - } -| and_expression AND2 error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '&' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '&' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -comparison: - equ_expression -| comparison '=' equ_expression - {$$ = new equ_expression_c($1, $3, locloc(@$));} -| comparison OPER_NE equ_expression - {$$ = new notequ_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| comparison '=' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '=' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '=' in ST expression."); yyclearin;} - yyerrok; - } -| comparison OPER_NE error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<>' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<>' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -equ_expression: - add_expression -| equ_expression '<' add_expression - {$$ = new lt_expression_c($1, $3, locloc(@$));} -| equ_expression '>' add_expression - {$$ = new gt_expression_c($1, $3, locloc(@$));} -| equ_expression OPER_LE add_expression - {$$ = new le_expression_c($1, $3, locloc(@$));} -| equ_expression OPER_GE add_expression - {$$ = new ge_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| equ_expression '<' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<' in ST expression."); yyclearin;} - yyerrok; - } -| equ_expression '>' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '>' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '>' in ST expression."); yyclearin;} - yyerrok; - } -| equ_expression OPER_LE error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<=' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<=' in ST expression."); yyclearin;} - yyerrok; - } -| equ_expression OPER_GE error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '>=' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '>=' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* Not required... -comparison_operator: '<' | '>' | '>=' '<=' -*/ - -add_expression: - term -| add_expression '+' term - {$$ = new add_expression_c($1, $3, locloc(@$));} -| add_expression '-' term - {$$ = new sub_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| add_expression '+' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '+' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '+' in ST expression."); yyclearin;} - yyerrok; - } -| add_expression '-' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '-' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '-' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* Not required... -add_operator: '+' | '-' -*/ - -term: - power_expression -| term '*' power_expression - {$$ = new mul_expression_c($1, $3, locloc(@$));} -| term '/' power_expression - {$$ = new div_expression_c($1, $3, locloc(@$));} -| term MOD power_expression - {$$ = new mod_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| term '*' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '*' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '*' in ST expression."); yyclearin;} - yyerrok; - } -| term '/' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '/' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '/' in ST expression."); yyclearin;} - yyerrok; - } -| term MOD error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'MOD' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'MOD' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* Not required... -multiply_operator: '*' | '/' | 'MOD' -*/ - -power_expression: - unary_expression -| power_expression OPER_EXP unary_expression - {$$ = new power_expression_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| power_expression OPER_EXP error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '**' in ST expression.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after '**' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -unary_expression: - non_negative_primary_expression -| '-' non_negative_primary_expression - {$$ = new neg_expression_c($2, locloc(@$));} -| NOT primary_expression - {$$ = new not_expression_c($2, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| '-' error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no expression defined after '-' in ST expression.");} - else {print_err_msg(locf(@2), locl(@2), "invalid expression after '-' in ST expression."); yyclearin;} - yyerrok; - } -| NOT error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no expression defined after 'NOT' in ST expression.");} - else {print_err_msg(locf(@2), locl(@2), "invalid expression after 'NOT' in ST expression."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* Not required... -unary_operator: '-' | 'NOT' -*/ - - -/* NOTE: using constant as a possible symbol for primary_expression - * leads to a reduce/reduce conflict. - * - * The text '-9' may be parsed as either a - * expression<-primary_expression<-constant<-signed_integer - * (i.e. the constant 9 negative) - * OR - * expression<-unary_expression<-constant<-integer - * (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 - * (i.e. as a parameter to the unary negation operator) - */ -/* NOTE: We use enumerated_value_without_identifier instead of enumerated_value - * in order to remove a reduce/reduce conflict between reducing an - * identifier to a variable or an enumerated_value. - * - * This change follows the IEC specification. The specification seems to - * imply (by introducing syntax that allows to unambiguosly reference an - * enumerated value - enum_type#enum_value) that in case the same identifier is used - * for a variable and an enumerated value, then the variable shall be - * considered. - */ -non_negative_primary_expression: - non_negative_constant -//| enumerated_value_without_identifier -| enumerated_value -| variable -| '(' expression ')' - {$$ = $2;} -| function_invocation -/* ERROR_CHECK_BEGIN */ -| '(' expression error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of expression in ST expression."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -primary_expression: - constant -//| enumerated_value_without_identifier -| enumerated_value -| variable -| '(' expression ')' - {$$ = $2;} -| function_invocation -/* ERROR_CHECK_BEGIN */ -| '(' expression error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of expression in ST expression."); yyerrok;} -/* ERROR_CHECK_END */ -; - - - -/* intermediate helper symbol for primary_expression */ -/* NOTE: function_name includes the standard function name 'NOT' ! - * This introduces a reduce/reduce conflict, as NOT(var) - * may be parsed as either a function_invocation, or a - * unary_expression. - * - * I (Mario) have opted to remove the possible reduction - * to function invocation, which means replacing the rule - * function_name '(' param_assignment_list ')' - * with - * function_name_no_NOT_clashes '(' param_assignment_list ')' - * - * Notice how the new rule does not include the situation where - * the function NOT is called with more than one parameter, which - * the original rule does include! Callinf the NOT function with more - * than one argument is probably a semantic error anyway, so it - * doesn't make much sense to take it into account. - * - * Nevertheless, if we were to to it entirely correctly, - * leaving the semantic checks for the next compiler stage, - * this syntax parser would need to include such a possibility. - * - * We will leave this out for now. No need to complicate the syntax - * more than the specification does by contradicting itself, and - * letting names clash! - */ -function_invocation: -/* function_name '(' [param_assignment_list] ')' */ - function_name_no_NOT_clashes '(' param_assignment_formal_list ')' - {$$ = new function_invocation_c($1, $3, NULL, locloc(@$));} -| function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')' - {$$ = new function_invocation_c($1, NULL, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| function_name_no_NOT_clashes param_assignment_formal_list ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function name in ST expression."); yynerrs++;} -| function_name_no_NOT_clashes '(' ')' - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no parameter defined in function invocation of ST expression."); yynerrs++;} -| function_name_no_NOT_clashes '(' error ')' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid parameter(s) defined in function invocation of ST expression."); yyerrok;} -| function_name_no_NOT_clashes '(' param_assignment_formal_list error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression."); yyerrok;} -| function_name_no_NOT_clashes '(' param_assignment_nonformal_list error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/********************/ -/* B 3.2 Statements */ -/********************/ -statement_list: - statement ';' - {$$ = new statement_list_c(locloc(@$)); $$->add_element($1);} -| any_pragma - {$$ = new statement_list_c(locloc(@$)); $$->add_element($1);} -| statement_list statement ';' - {$$ = $1; $$->add_element($2);} -| statement_list any_pragma - {$$ = $1; $$->add_element($2);} -/* ERROR_CHECK_BEGIN */ -| statement error - {$$ = new statement_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of statement in ST statement."); yyerrok;} -| statement_list statement error - {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of statement in ST statement."); yyerrok;} -| statement_list error ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid statement in ST statement."); yyerrok;} -| statement_list ';' - {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after statement in ST statement."); yynerrs++;} -/* ERROR_CHECK_END */ -; - - -statement: - assignment_statement -| subprogram_control_statement -| selection_statement -| iteration_statement -; - - -/*********************************/ -/* B 3.2.1 Assignment Statements */ -/*********************************/ -assignment_statement: - variable ASSIGN expression - {$$ = new assignment_statement_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| error ASSIGN expression - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid variable before ':=' in ST assignment statement."); yyerrok;} -| variable ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after ':=' in ST assignment statement.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression after ':=' in ST assignment statement."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - - - -/*****************************************/ -/* B 3.2.2 Subprogram Control Statements */ -/*****************************************/ -subprogram_control_statement: - fb_invocation -| return_statement -; - -return_statement: - RETURN {$$ = new return_statement_c(locloc(@$));} -; - - - -fb_invocation: - prev_declared_fb_name '(' ')' - {$$ = new fb_invocation_c($1, NULL, NULL, locloc(@$)); } -| prev_declared_fb_name '(' param_assignment_formal_list ')' - {$$ = new fb_invocation_c($1, $3, NULL, locloc(@$));} -| prev_declared_fb_name '(' param_assignment_nonformal_list ')' - {$$ = new fb_invocation_c($1, NULL, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| prev_declared_fb_name ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function block name in ST statement."); yynerrs++;} -| prev_declared_fb_name param_assignment_formal_list ')' - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function block name in ST statement."); yynerrs++;} -| prev_declared_fb_name '(' error ')' - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid parameter list in function block invocation in ST statement."); yyerrok;} -| prev_declared_fb_name '(' error - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;} -| prev_declared_fb_name '(' param_assignment_formal_list error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;} -| prev_declared_fb_name '(' param_assignment_nonformal_list error - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for - * - fb_invocation - * - function_invocation - */ -param_assignment_formal_list: - param_assignment_formal - {$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);} -| param_assignment_formal_list ',' param_assignment_formal - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| param_assignment_formal_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no parameter assignment defined in ST parameter assignment list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - -/* helper symbol for - * - fb_invocation - * - function_invocation - */ -param_assignment_nonformal_list: - param_assignment_nonformal - {$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);} -| param_assignment_nonformal_list ',' param_assignment_nonformal - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| param_assignment_nonformal_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no parameter assignment defined in ST parameter assignment list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -/* NOTE: According to the IEC 61131-3 standard, there are two possible - * syntaxes for calling function blocks within ST. - * The formal method has the form: - * fb ( invar := x, inoutvar := var1, outvar => var2); - * The non-formal method has the form: - * fb (x, var1, var2); - * In the text of IEC 61131-3 (where the semantics are defined), - * it is obvious that mixing the two syntaxes is considered incorrect. - * The following should therefore be incorrect: - * fb ( invar := x, var1, var2); - * However, according to the syntax definition, as defined in IEC 61131-3, - * mixing the formal and non-formal methods of invocation is allowed. - * We have two alternatives: - * (a) implement the syntax here in iec.y according to the standard, - * and leave it to the semantic analyser stage to find this error - * (b) or implement the syntax in iec.y correctly, not allowing - * the mixing of formal and non-formal invocation syntaxes. - * Considering that this is a syntax issue, and not semantic issue, - * I (Mario) have decided to go with alternative (a). - * In other words, in iec.y we do not follow the syntax as defined in - * Annex B of the IEC 61131-3 standard, but rather implement - * the syntax also taking into account the textual part of the standard too. - */ -/* -param_assignment: - variable_name ASSIGN expression -*/ -param_assignment_nonformal: - expression -; - - -param_assignment_formal: - any_identifier ASSIGN expression - {$$ = new input_variable_param_assignment_c($1, $3, locloc(@$));} -| en_identifier ASSIGN expression - {$$ = new input_variable_param_assignment_c($1, $3, locloc(@$));} -/*| variable_name SENDTO variable */ -/*| any_identifier SENDTO variable */ -| sendto_identifier SENDTO variable - {$$ = new output_variable_param_assignment_c(NULL, $1, $3, locloc(@$));} -/* The following is not required, as the sendto_identifier_token returned by flex will - * also include the 'ENO' identifier. - * The resulting abstract syntax tree is identical with or without this following rule, - * as both the eno_identifier and the sendto_identifier are stored as - * an identifier_c !! - * - * To understand why we must even explicitly consider the use of ENO here, - * please read the comment above the definition of 'variable' in section B1.4 for details. - */ -/* -| eno_identifier SENDTO variable - {$$ = new output_variable_param_assignment_c(NULL, $1, $3, locloc(@$));} -*/ -/*| NOT variable_name SENDTO variable */ -/*| NOT any_identifier SENDTO variable*/ -| NOT sendto_identifier SENDTO variable - {$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)), $2, $4, locloc(@$));} -/* The following is not required, as the sendto_identifier_token returned by flex will - * also include the 'ENO' identifier. - * The resulting abstract syntax tree is identical with or without this following rule, - * as both the eno_identifier and the sendto_identifier are stored as - * an identifier_c !! - * - * To understand why we must even explicitly consider the use of ENO here, - * please read the comment above the definition of 'variable' in section B1.4 for details. - */ -/* -| NOT eno_identifier SENDTO variable - {$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)), $2, $4, locloc(@$));} -*/ -/* ERROR_CHECK_BEGIN */ -| any_identifier ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter assignment.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter assignment."); yyclearin;} - yyerrok; - } -| en_identifier ASSIGN error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter assignment.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter assignment."); yyclearin;} - yyerrok; - } -| sendto_identifier SENDTO error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter out assignment.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter out assignment."); yyclearin;} - yyerrok; - } -/* -| eno_identifier SENDTO error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter out assignment.");} - else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter out assignment."); yyclearin;} - yyerrok; - } -*/ -| NOT SENDTO variable - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no parameter name defined in ST formal parameter out negated assignment."); yynerrs++;} -| NOT error SENDTO variable - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter name defined in ST formal parameter out negated assignment."); yyerrok;} -| NOT sendto_identifier SENDTO error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no expression defined in ST formal parameter out negated assignment.");} - else {print_err_msg(locf(@4), locl(@4), "invalid expression in ST formal parameter out negated assignment."); yyclearin;} - yyerrok; - } -/* -| NOT eno_identifier SENDTO error - {$$ = NULL; - if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no expression defined in ST formal parameter out negated assignment.");} - else {print_err_msg(locf(@4), locl(@4), "invalid expression in ST formal parameter out negated assignment."); yyclearin;} - yyerrok; - } -*/ -/* ERROR_CHECK_END */ -; - - - - - -/********************************/ -/* B 3.2.3 Selection Statements */ -/********************************/ -selection_statement: - if_statement -| case_statement -; - - -if_statement: - IF expression THEN statement_list elseif_statement_list END_IF - {$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));} -| IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF - {$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| IF THEN statement_list elseif_statement_list END_IF - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'IF' statement."); yynerrs++;} -| IF THEN statement_list elseif_statement_list ELSE statement_list END_IF - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'IF' statement."); yynerrs++;} -| IF error THEN statement_list elseif_statement_list END_IF - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement."); yyerrok;} -| IF error THEN statement_list elseif_statement_list ELSE statement_list END_IF - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement."); yyerrok;} -| IF expression error statement_list elseif_statement_list END_IF - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement."); yyerrok;} -| IF expression error statement_list elseif_statement_list ELSE statement_list END_IF - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement."); yyerrok;} -| IF expression THEN elseif_statement_list END_IF - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement."); yynerrs++;} -| IF expression THEN elseif_statement_list ELSE statement_list END_IF - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement."); yynerrs++;} -| IF expression THEN statement_list elseif_statement_list ELSE END_IF - {$$ = NULL; print_err_msg(locl(@6), locf(@7), "no statement defined after 'ELSE' in ST 'IF' statement."); yynerrs++;} -| IF expression THEN statement_list elseif_statement_list ELSE error END_IF - {$$ = NULL; print_err_msg(locf(@7), locl(@7), "invalid statement defined after 'ELSE' in ST 'IF' statement."); yynerrs++; yyerrok;} -| IF expression error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed 'IF' statement in ST."); yyerrok;} -| IF expression THEN statement_list elseif_statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'IF' statement in ST."); yynerrs++;} -| IF expression THEN statement_list elseif_statement_list ELSE statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'IF' statement in ST."); yynerrs++;} -| IF error END_IF - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'IF' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* helper symbol for if_statement */ -elseif_statement_list: - /* empty */ - {$$ = new elseif_statement_list_c(locloc(@$));} -| elseif_statement_list elseif_statement - {$$ = $1; $$->add_element($2);} -; - -/* helper symbol for elseif_statement_list */ -elseif_statement: - ELSIF expression THEN statement_list - {$$ = new elseif_statement_c($2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| ELSIF THEN statement_list - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined for 'ELSEIF' statement in ST 'IF' statement."); yynerrs++;} -| ELSIF error THEN statement_list - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for 'ELSEIF' statement in ST 'IF' statement."); yyerrok;} -| ELSIF expression error statement_list - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in 'ELSEIF' statement of ST 'IF' statement."); yyerrok;} -| ELSIF expression THEN error - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid statement list in 'ELSEIF' statement of ST 'IF' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -case_statement: - CASE expression OF case_element_list END_CASE - {$$ = new case_statement_c($2, $4, NULL, locloc(@$));} -| CASE expression OF case_element_list ELSE statement_list END_CASE - {$$ = new case_statement_c($2, $4, $6, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| CASE OF case_element_list END_CASE - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement."); yynerrs++;} -| CASE OF case_element_list ELSE statement_list END_CASE - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement."); yynerrs++;} -| CASE error OF case_element_list END_CASE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement."); yyerrok;} -| CASE error OF case_element_list ELSE statement_list END_CASE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement."); yyerrok;} -| CASE expression error case_element_list END_CASE - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement."); yyerrok;} -| CASE expression error case_element_list ELSE statement_list END_CASE - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement."); yyerrok;} -| CASE expression OF END_CASE - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); yynerrs++;} -| CASE expression OF ELSE statement_list END_CASE - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); yynerrs++;} -| CASE expression OF error END_CASE - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); yyerrok;} -| CASE expression OF error ELSE statement_list END_CASE - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); yyerrok;} -| CASE expression OF case_element_list ELSE END_CASE - {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no statement defined after 'ELSE' in ST 'CASE' statement."); yynerrs++;} -| CASE expression OF case_element_list ELSE error END_CASE - {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid statement defined after 'ELSE' in ST 'CASE' statement."); yyerrok;} -| CASE expression error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed 'CASE' statement in ST."); yyerrok;} -| CASE expression OF case_element_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'CASE' statement in ST."); yynerrs++;} -| CASE expression OF case_element_list ELSE statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'CASE' statement in ST."); yynerrs++;} -| CASE error END_CASE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'CASE' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -/* helper symbol for case_statement */ -case_element_list: - case_element - {$$ = new case_element_list_c(locloc(@$)); $$->add_element($1);} -| case_element_list case_element - {$$ = $1; $$->add_element($2);} -; - - -case_element: - case_list ':' statement_list - {$$ = new case_element_c($1, $3, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| case_list statement_list - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after case list in ST 'CASE' statement."); yynerrs++;} -| case_list ':' error - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid statement in case element of ST 'CASE' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -case_list: - case_list_element - {$$ = new case_list_c(locloc(@$)); $$->add_element($1);} -| case_list ',' case_list_element - {$$ = $1; $$->add_element($3);} -/* ERROR_CHECK_BEGIN */ -| case_list ',' error - {$$ = $1; - if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no case defined in case list of ST parameter assignment list.");} - else {print_err_msg(locf(@3), locl(@3), "invalid case in case list of ST parameter assignment list."); yyclearin;} - yyerrok; - } -/* ERROR_CHECK_END */ -; - - -case_list_element: - signed_integer -| subrange -| enumerated_value -; - - - - - -/********************************/ -/* B 3.2.4 Iteration Statements */ -/********************************/ -iteration_statement: - for_statement -| while_statement -| repeat_statement -| exit_statement -; - - -for_statement: - FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_FOR - {$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));} -| FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR - {$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement."); yynerrs++;} -| FOR ASSIGN expression TO expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement."); yynerrs++;} -| FOR error ASSIGN expression TO expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement."); yyerrok;} -| FOR error ASSIGN expression TO expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement."); yyerrok;} -| FOR control_variable expression TO expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); yynerrs++;} -| FOR control_variable expression TO expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); yynerrs++;} -| FOR control_variable error expression TO expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable error expression TO expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN TO expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement."); yynerrs++;} -| FOR control_variable ASSIGN TO expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement."); yynerrs++;} -| FOR control_variable ASSIGN error TO expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid start expression defined in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN error TO expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid start expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression error expression BY expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression error expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression error expression DO statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@7), locl(@7), "expecting 'BY' between end expression and step expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression BY expression error statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@9), locl(@9), "expecting 'DO' after step expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression error statement_list END_FOR - {$$ = NULL; print_err_msg(locf(@7), locl(@7), "expecting 'DO' after end expression in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR - {$$ = NULL; print_err_msg(locl(@9), locf(@10), "no statement(s) defined after 'DO' in ST 'FOR' statement."); yynerrs++;} -| FOR control_variable ASSIGN expression TO expression DO END_FOR - {$$ = NULL; print_err_msg(locl(@7), locf(@8), "no statement(s) defined after 'DO' in ST 'FOR' statement."); yynerrs++;} -| FOR control_variable ASSIGN expression TO expression BY expression DO error END_FOR - {$$ = NULL; print_err_msg(locf(@10), locl(@10), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression DO error END_FOR - {$$ = NULL; print_err_msg(locf(@8), locl(@8), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); yyerrok;} -| FOR control_variable error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;} -| FOR control_variable ASSIGN expression error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression DO statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yynerrs++;} -| FOR control_variable ASSIGN expression TO expression BY expression error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;} -| FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yynerrs++;} -| FOR error END_FOR - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'FOR' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - -/* The spec has the syntax - * control_variable: identifier; - * but then defines the semantics of control_variable - * (Section 3.3.2.4) as being of an integer type - * (e.g., SINT, INT, or DINT). - * - * Obviously this presuposes that the control_variable - * must have been declared in some VAR .. END_VAR - * We must therefore change the syntax to read - * control_variable: prev_declared_variable_name; - * - * If we don't, then the correct use of any previosuly declared - * variable would result in an incorrect syntax error -*/ -control_variable: - prev_declared_variable_name - {$$ = new symbolic_variable_c($1,locloc(@$));}; -// control_variable: identifier {$$ = $1;}; - -/* Integrated directly into for_statement */ -/* -for_list: - expression TO expression [BY expression] -; -*/ - - -while_statement: - WHILE expression DO statement_list END_WHILE - {$$ = new while_statement_c($2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| WHILE DO statement_list END_WHILE - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'WHILE' statement."); yynerrs++;} -| WHILE error DO statement_list END_WHILE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'WHILE' statement."); yyerrok;} -| WHILE expression error statement_list END_WHILE - {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'DO' after test expression in ST 'WHILE' statement."); yyerrok;} -| WHILE expression DO END_WHILE - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement(s) defined after 'DO' in ST 'WHILE' statement."); yynerrs++;} -| WHILE expression DO error END_WHILE - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid statement(s) defined after 'DO' in ST 'WHILE' statement."); yyerrok;} -| WHILE expression error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'WHILE' statement in ST."); yyerrok;} -| WHILE expression DO statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'WHILE' statement in ST."); yynerrs++;} -| WHILE error END_WHILE - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'WHILE' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -repeat_statement: - REPEAT statement_list UNTIL expression END_REPEAT - {$$ = new repeat_statement_c($2, $4, locloc(@$));} -/* ERROR_CHECK_BEGIN */ -| REPEAT UNTIL expression END_REPEAT - {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no statement(s) defined after 'REPEAT' in ST 'REPEAT' statement."); yynerrs++;} -| REPEAT error UNTIL expression END_REPEAT - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid statement(s) defined after 'REPEAT' for ST 'REPEAT' statement."); yyerrok;} -| REPEAT statement_list UNTIL END_REPEAT - {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no test expression defined after 'UNTIL' in ST 'REPEAT' statement.");} -| REPEAT statement_list UNTIL error END_REPEAT - {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid test expression defined after 'UNTIL' in ST 'REPEAT' statement."); yyerrok;} -| REPEAT statement_list END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'REPEAT' statement in ST."); yynerrs++;} -| REPEAT statement_list UNTIL expression error END_OF_INPUT - {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'REPEAT' statement in ST."); yyerrok;} -| REPEAT error END_REPEAT - {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'REPEAT' statement."); yyerrok;} -/* ERROR_CHECK_END */ -; - - -exit_statement: - EXIT {$$ = new exit_statement_c(locloc(@$));} -; - - - - - -%% - -#include /* required for printf() */ -#include -#include "../util/symtable.hh" - -/* variables defined in code generated by flex... */ -extern FILE *yyin; -extern int yylineno; -extern tracking_t* current_tracking; - - - - -/*************************************************************************************************/ -/* NOTE: These variables are really parameters we would like the stage2__ function to pass */ -/* to the yyparse() function. However, the yyparse() function is created automatically */ -/* by bison, so we cannot add parameters to this function. The only other */ -/* option is to use global variables! yuck! */ -/*************************************************************************************************/ - -/* A global flag used to tell the parser if overloaded funtions should be allowed. - * The IEC 61131-3 standard allows overloaded funtions in the standard library, - * but disallows them in user code... - * - * In essence, a parameter we would like to pass to the yyparse() function but - * have to do it using a global variable, as the yyparse() prototype is fixed by bison. - */ -bool allow_function_overloading = false; - -/* A global flag used to tell the parser whether to include the full variable location - * when printing out error messages... - */ -bool full_token_loc; - -/* A pointer to the root of the parsing tree that will be generated - * by bison. - */ -symbol_c *tree_root; - - - -/* The following function is called automatically by bison whenever it comes across - * an error. Unfortunately it calls this function before executing the code that handles - * the error itself, so we cannot print out the correct line numbers of the error location - * over here. - * Our solution is to store the current error message in a global variable, and have all - * error action handlers call the function print_err_msg() after setting the location - * (line number) variable correctly. - */ -const char *current_error_msg; -void yyerror (const char *error_msg) { - current_error_msg = error_msg; -/* fprintf(stderr, "error %d: %s\n", yynerrs // global variable //, error_msg); */ -/* print_include_stack(); */ -} - - -/* ERROR_CHECK_BEGIN */ -bool is_current_syntax_token() { - switch (yychar) { - case ';': - case ',': - case ')': - case ']': - case '+': - case '*': - case '-': - case '/': - case '<': - case '>': - case '=': - case '&': - case OR: - case XOR: - case AND: - case AND2: - case OPER_NE: - case OPER_LE: - case OPER_GE: - case MOD: - case OPER_EXP: - case NOT: - return true; - default: - return false; - } -} -/* ERROR_CHECK_END */ - - -void print_err_msg(int first_line, - int first_column, - const char *first_filename, - long int first_order, - int last_line, - int last_column, - const char *last_filename, - long int last_order, - const char *additional_error_msg) { - - const char *unknown_file = ""; - if (first_filename == NULL) first_filename = unknown_file; - if ( last_filename == NULL) last_filename = unknown_file; - - if (full_token_loc) { - if (first_filename == last_filename) - fprintf(stderr, "%s:%d-%d..%d-%d: error : %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg); - else - fprintf(stderr, "%s:%d-%d..%s:%d-%d: error : %s\n", first_filename, first_line, first_column, last_filename, last_line, last_column, additional_error_msg); - } else { - fprintf(stderr, "%s:%d: error : %s\n", first_filename, first_line, additional_error_msg); - } - //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); -} - - - -/* convert between an il_operator to a function name */ -/* This a kludge! - * It is required because our language requires more than one - * look ahead token, and bison only works with one! - */ -#define op_2_str(op, str) {\ - op ## _operator_c *ptr = dynamic_cast(il_operator); \ - if (ptr != NULL) name = str; \ -} - -/* NOTE: this code is very ugly and un-eficient, but I (Mario) have many - * more things to worry about right now, so just let it be... - */ -symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator) { - const char *name = NULL; - identifier_c *res; - - op_2_str(NOT, "NOT"); - - op_2_str(AND, "AND"); - op_2_str(OR, "OR"); - op_2_str(XOR, "XOR"); - op_2_str(ADD, "ADD"); - op_2_str(SUB, "SUB"); - op_2_str(MUL, "MUL"); - op_2_str(DIV, "DIV"); - op_2_str(MOD, "MOD"); - op_2_str(GT, "GT"); - op_2_str(GE, "GE"); - op_2_str(EQ, "EQ"); - op_2_str(LT, "LT"); - op_2_str(LE, "LE"); - op_2_str(NE, "NE"); - - op_2_str(LD, "LD"); - op_2_str(LDN, "LDN"); - op_2_str(ST, "ST"); - op_2_str(STN, "STN"); - - op_2_str(S, "S"); - op_2_str(R, "R"); - op_2_str(S1, "S1"); - op_2_str(R1, "R1"); - - op_2_str(CLK, "CLK"); - op_2_str(CU, "CU"); - op_2_str(CD, "CD"); - op_2_str(PV, "PV"); - op_2_str(IN, "IN"); - op_2_str(PT, "PT"); - - op_2_str(ANDN, "ANDN"); - op_2_str(ORN, "ORN"); - op_2_str(XORN, "XORN"); - - op_2_str(ADD, "ADD"); - op_2_str(SUB, "SUB"); - op_2_str(MUL, "MUL"); - op_2_str(DIV, "DIV"); - - op_2_str(GT, "GT"); - op_2_str(GE, "GE"); - op_2_str(EQ, "EQ"); - op_2_str(LT, "LT"); - op_2_str(LE, "LE"); - op_2_str(NE, "NE"); - - op_2_str(CAL, "CAL"); - op_2_str(CALC, "CALC"); - op_2_str(CALCN, "CALCN"); - op_2_str(RET, "RET"); - op_2_str(RETC, "RETC"); - op_2_str(RETCN, "RETCN"); - op_2_str(JMP, "JMP"); - op_2_str(JMPC, "JMPC"); - op_2_str(JMPCN, "JMPCN"); - - if (name == NULL) - ERROR; - - res = new identifier_c(strdup(name), - il_operator->first_line, - il_operator->first_column, - il_operator->first_file, - il_operator->first_order, - il_operator->last_line, - il_operator->last_column, - il_operator->last_file, - il_operator->last_order - ); - free(il_operator); - return res; -} - - -#include "standard_function_names.c" - -const char *standard_function_block_names[] = { -// 2.5.2.3.1 Bistable elements -// Table 34 - Standard bistable function blocks -"SR","RS", -// 2.5.2.3.2 Edge detection -// Table 35 - Standard edge detection function blocks -"R_TRIG","F_TRIG", -// 2.5.2.3.3 Counters -// Table 36 - Standard counter function blocks -"CTU","CTU_DINT","CTU_LINT","CTU_UDINT","CTU_ULINT", -"CTD","CTD_DINT","CTD_LINT","CTD_UDINT","CTD_ULINT", -"CTUD","CTUD_DINT","CTUD_LINT","CTUD_ULINT", -// 2.5.2.3.4 Timers -// Table 37 - Standard timer function blocks -"TP","TON","TOF", -/* end of array marker! Do not remove! */ -NULL -}; - - -#define LIBFILE "ieclib.txt" -#define DEF_LIBFILENAME LIBDIRECTORY "/" LIBFILE - -extern const char *INCLUDE_DIRECTORIES[]; - - - -int stage2__(const char *filename, - const char *includedir, /* Include directory, where included files will be searched for... */ - symbol_c **tree_root_ref, - bool full_token_loc_ /* error messages specify full token location */ - ) { - - FILE *in_file = NULL, *lib_file = NULL; - char *libfilename = NULL; - - for(int i = 0; standard_function_names[i] != NULL; i++) - if (library_element_symtable.find_value(standard_function_names[i]) == - library_element_symtable.end_value()) - library_element_symtable.insert(standard_function_names[i], standard_function_name_token); - - 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... */ - /* - #if YYDEBUG - yydebug = 1; - #endif - */ - yyin = lib_file; - allow_function_overloading = true; - full_token_loc = full_token_loc_; - current_filename = libfilename; - current_tracking = GetNewTracking(yyin); - if (yyparse() != 0) - ERROR; - - if (yynerrs > 0) { - fprintf (stderr, "\nFound %d error(s) 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!!! - */ - for(int i = 0; standard_function_block_names[i] != NULL; i++) - if (library_element_symtable.find_value(standard_function_block_names[i]) == - library_element_symtable.end_value()) - library_element_symtable.insert(standard_function_block_names[i], standard_function_block_name_token); - - - /* now parse the input file... */ - #if YYDEBUG - yydebug = 1; - #endif - yyin = in_file; - allow_function_overloading = 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 (yynerrs > 0) { - fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */); - exit(EXIT_FAILURE); - } - - if (tree_root_ref != NULL) - *tree_root_ref = tree_root; - - fclose(in_file); - return 0; -} - - - diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/iec_bison.yy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage1_2/iec_bison.yy Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,8307 @@ +/* + * 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 . + * + * + * 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) + * + */ + +/* + * Stage 2 + * ======= + * + * This file contains the syntax definition of the textual + * languages IL and ST, as well as the textual version of SFC. + * The syntax parser, comprising the 2nd stage of the overall + * compiler, is generated by runing bison on this file. + */ + + + + +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ +/******* *******/ +/******* The following syntax does not have any conflicts. *******/ +/******* *******/ +/******* P L E A S E K E E P I T T H A T W A Y ! *******/ +/******* =================================================== *******/ +/******* *******/ +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ + + + + +%{ +#include /* required for strdup() */ + + +/* declare the token parser generated by flex... */ +int yylex(void); + +/* declare the error handler defined at the end of this file */ +void yyerror (const char *error_msg); + +/* produce a more verbose parsing error message */ +#define YYERROR_VERBOSE + +/* Include debuging code. + * Printing of debug info must then be activated by setting + * the variable yydebug to 1. + */ +#define YYDEBUG 0 + + +/* file with declaration of absyntax classes... */ +#include "../absyntax/absyntax.hh" + +/* file with declaration of token constants. Generated by bison! */ +#include "iec_bison.h" + +/* The interface through which bison and flex interact. */ +#include "stage1_2_priv.hh" + + +#include "../absyntax_utils/add_en_eno_param_decl.hh" /* required for add_en_eno_param_decl_c */ + +/* an ugly hack!! + * We will probably not need it when we decide + * to cut down the abstract syntax down to size. + * We keep it as it is until we get to write + * stages 3 and 4 of the compiler. Who knows, + * we might just find out that we really do need + * the abstract syntax tree to stay as it is + * afterall! + */ +/* for each element in list_c * + * execute the code + */ +#define FOR_EACH_ELEMENT(elem, list, code) { \ + symbol_c *elem; \ + for(int i = 0; i < list->n; i++) { \ + elem = list->elements[i]; \ + code; \ + } \ +} + + + +/* Macros used to pass the line and column locations when + * creating a new object for the abstract syntax tree. + */ +#define locloc(foo) foo.first_line, foo.first_column, foo.first_file, foo.first_order, foo.last_line, foo.last_column, foo.last_file, foo.last_order +#define locf(foo) foo.first_line, foo.first_column, foo.first_file, foo.first_order +#define locl(foo) foo.last_line, foo.last_column, foo.last_file, foo.last_order + +/* Redefine the default action to take for each rule, so that the filenames are correctly processed... */ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ + (Current).first_file = YYRHSLOC(Rhs, 1).first_file; \ + (Current).first_order = YYRHSLOC(Rhs, 1).first_order; \ + (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ + (Current).last_file = YYRHSLOC(Rhs, 1).last_file; \ + (Current).last_order = YYRHSLOC(Rhs, 1).last_order; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC(Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC(Rhs, 0).last_column; \ + (Current).first_file = (Current).last_file = \ + YYRHSLOC(Rhs, 0).last_file; \ + (Current).first_order = (Current).last_order = \ + YYRHSLOC(Rhs, 0).last_order; \ + } \ + while (0) + + +/* A macro for printing out internal parser errors... */ +#define ERROR error_exit(__FILE__,__LINE__) +/* function defined in main.cc */ +extern void error_exit(const char *file_name, int line_no); + + + +/*************************/ +/* global variables... */ +/*************************/ +/* NOTE: For some strange reason bison ver 2.3 is including these declarations + * in the iec_bison.h file, which is in turn included by flex. + * We cannot therefore define any variables over here, but merely declare + * their existance (otherwise we get errors when linking the code, since we + * would get a new variable defined each time iec_bison.h is included!). + * Even though the variables are declared 'extern' over here, they will in + * fact be defined towards the end of this same file (i.e. in the prologue) + */ + + +/* NOTE: These variable are really parameters we would like the stage2__ function to pass + * to the yyparse() function. However, the yyparse() function is created automatically + * by bison, so we cannot add parameters to this function. The only other + * option is to use global variables! yuck! + */ + +/* A global flag used to tell the parser if overloaded funtions should be allowed. + * The IEC 61131-3 standard allows overloaded funtions in the standard library, + * but disallows them in user code... + */ +extern bool allow_function_overloading; + +/* A flag to tell the compiler whether to allow the declaration + * of extensible function (i.e. functions that may have a variable number of + * input parameters, such as AND(word#33, word#44, word#55, word#66). + * This is an extension to the standard syntax. + * See comments below for details why we support this! + */ +extern bool allow_extensible_function_parameters; + +/* A global flag used to tell the parser whether to include the full variable location + * when printing out error messages... + */ +extern bool full_token_loc; + +/* A pointer to the root of the parsing tree that will be generated + * by bison. + */ +extern symbol_c *tree_root; + + + +/************************/ +/* forward declarations */ +/************************/ +/* The functions declared here are defined at the end of this file... */ + +/* Convert an il_operator_c into an identifier_c */ +symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator); + +/* return if current token is a syntax element */ +/* ERROR_CHECK_BEGIN */ +bool is_current_syntax_token(); +/* ERROR_CHECK_END */ + +/* print an error message */ +void print_err_msg(int first_line, + int first_column, + const char *first_filename, + long int first_order, + int last_line, + int last_column, + const char *last_filename, + long int last_order, + const char *additional_error_msg); +%} + + + + +// %glr-parser +// %expect-rr 1 + + +/* The following definitions need to be inside a '%code requires' + * so that they are also included in the header files. If this were not the case, + * YYLTYPE would be delcared as something in the iec.cc file, and another thing + * (actually the default value of YYLTYPE) in the iec_bison.h heder file. + */ +%code requires { +/* define a new data type to store the locations, so we can also store + * the filename in which the token is expressed. + */ +/* NOTE: since this code will be placed in the iec_bison.h header file, + * as well as the iec.cc file that also includes the iec_bison.h header file, + * declaring the typedef struct yyltype__local here would result in a + * compilation error when compiling iec.cc, as this struct would be + * declared twice. + * We therefore use the #if !defined YYLTYPE ... + * to make sure only the first declaration is parsed by the C++ compiler. + * + * At first glance it seems that what we really should do is delcare the + * YYLTYPE directly as an anonymous struct, thus: + * #define YYLTYPE struct{ ...} + * however, this also results in compilation errors. + * + * I (Mario) think this is kind of a hack. If you know how to + * do this re-declaration of YYLTYPE properly, please let me know! + */ +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED + typedef struct { + int first_line; + int first_column; + const char *first_file; + long int first_order; + int last_line; + int last_column; + const char *last_file; + long int last_order; + } yyltype__local; + #define YYLTYPE yyltype__local +#endif +} + + + +%union { + symbol_c *leaf; + list_c *list; + char *ID; /* token value */ +} + +/* + TODO: DO we need to define a destructor do free + memory when recovering from errors, or do the + class destructors already handle this? + Following is example on how to define + detructors, using the syntax: + %destructor { CODE } SYMBOLS +%union + { + char *string; + } + %token STRING + %type string + %destructor { free ($$); } STRING string +*/ + + + + +/*************************************/ +/* Prelimenary helpful constructs... */ +/*************************************/ +/* A token used to identify the very end of the input file + * after all includes have already been processed. + * + * Flex automatically returns the token with value 0 + * at the end of the file. We therefore specify here + * a token with that exact same value here, so we can use it + * to detect the very end of the input files. + */ +%token END_OF_INPUT 0 + +/* A bogus token that, in principle, flex MUST NEVER generate */ +/* USE 1: + * ====== + * This token is currently also being used as the default + * initialisation value of the token_id member in + * the symbol_c base class. + * + * USE 2 + * ===== + * This token may also be used in the future to remove + * mysterious reduce/reduce conflicts due to the fact + * that our grammar may not be LALR(1) but merely LR(1). + * This means that bison cannot handle it without some + * caoxing from ourselves. We will then need this token + * to do the coaxing... + */ +%token BOGUS_TOKEN_ID + +%type start + +%type any_identifier + +%token prev_declared_variable_name_token +%token prev_declared_direct_variable_token +%token prev_declared_fb_name_token +%type prev_declared_variable_name +%type prev_declared_direct_variable +%type prev_declared_fb_name + +%token prev_declared_simple_type_name_token +%token prev_declared_subrange_type_name_token +%token prev_declared_enumerated_type_name_token +%token prev_declared_array_type_name_token +%token prev_declared_structure_type_name_token +%token prev_declared_string_type_name_token + +%type prev_declared_simple_type_name +%type prev_declared_subrange_type_name +%type prev_declared_enumerated_type_name +%type prev_declared_array_type_name +%type prev_declared_structure_type_name +%type prev_declared_string_type_name + +%token prev_declared_derived_function_name_token +%token prev_declared_derived_function_block_name_token +%token prev_declared_program_type_name_token +%type prev_declared_derived_function_name +%type prev_declared_derived_function_block_name +%type prev_declared_program_type_name + + + + +/**********************************************************************************/ +/* B XXX - Things that are missing from the standard, but should have been there! */ +/**********************************************************************************/ + +/* Pragmas that our compiler will accept. + * See the comment in iec.flex for why these pragmas exist. + */ +%token disable_code_generation_pragma_token +%token enable_code_generation_pragma_token +%type disable_code_generation_pragma +%type enable_code_generation_pragma + + +/* All other pragmas that we do not support... */ +/* In most stage 4, the text inside the pragmas will simply be copied to the output file. + * This allows us to insert C code (if using stage 4 generating C code) + * inside/interningled with the IEC 61131-3 code! + */ +%token pragma_token +%type pragma + +/* The joining of all previous pragmas, i.e. any possible pragma */ +%type any_pragma + + +/* Where do these tokens belong?? They are missing from the standard! */ +/* NOTE: There are other tokens related to these 'EN' ENO', that are also + * missing from the standard. However, their location in the annex B is + * relatively obvious, so they have been inserted in what seems to us their + * correct place in order to ease understanding of the parser... + * + * please read the comment above the definition of 'variable' in section B1.4 for details. + */ +%token EN +%token ENO +%type en_identifier +%type eno_identifier + + + + +/***************************/ +/* B 0 - Programming Model */ +/***************************/ +%type library +%type library_element_declaration + + +/*******************************************/ +/* B 1.1 - Letters, digits and identifiers */ +/*******************************************/ +/* Done totally within flex... + letter + digit + octal_digit + hex_digit +*/ +%token identifier_token +%type identifier + +/*********************/ +/* B 1.2 - Constants */ +/*********************/ +%type constant +%type non_negative_constant + +/******************************/ +/* B 1.2.1 - Numeric Literals */ +/******************************/ +/* Done totally within flex... + bit +*/ +%type numeric_literal +%type integer_literal +%type signed_integer +%token integer_token +%type integer +%token binary_integer_token +%type binary_integer +%token octal_integer_token +%type octal_integer +%token hex_integer_token +%type hex_integer +%token real_token +%type real +%type signed_real +%type real_literal +// %type exponent +%type bit_string_literal +%type boolean_literal + +%token safeboolean_true_literal_token +%token safeboolean_false_literal_token +%token boolean_true_literal_token +%token boolean_false_literal_token + +%token FALSE +%token TRUE + + +/*******************************/ +/* B 1.2.2 - Character Strings */ +/*******************************/ +%token single_byte_character_string_token +%token double_byte_character_string_token + +%type character_string +%type single_byte_character_string +%type double_byte_character_string + + +/***************************/ +/* B 1.2.3 - Time Literals */ +/***************************/ +%type time_literal + + +/************************/ +/* B 1.2.3.1 - Duration */ +/************************/ +%type duration +%type interval +%type days +%type fixed_point +%type hours +%type minutes +%type seconds +%type milliseconds + +%type integer_d +%type integer_h +%type integer_m +%type integer_s +%type integer_ms +%type fixed_point_d +%type fixed_point_h +%type fixed_point_m +%type fixed_point_s +%type fixed_point_ms + +%token fixed_point_token +%token fixed_point_d_token +%token integer_d_token +%token fixed_point_h_token +%token integer_h_token +%token fixed_point_m_token +%token integer_m_token +%token fixed_point_s_token +%token integer_s_token +%token fixed_point_ms_token +%token integer_ms_token + +// %token TIME +%token T_SHARP + + +/************************************/ +/* B 1.2.3.2 - Time of day and Date */ +/************************************/ +%type time_of_day +%type daytime +%type day_hour +%type day_minute +%type day_second +%type date +%type date_literal +%type year +%type month +%type day +%type date_and_time + +// %token TIME_OF_DAY +// %token DATE +%token D_SHARP +// %token DATE_AND_TIME + + +/**********************/ +/* B 1.3 - Data Types */ +/**********************/ +/* Strangely, the following symbol does seem to be required! */ +// %type data_type_name +%type non_generic_type_name + + +/***********************************/ +/* B 1.3.1 - Elementary Data Types */ +/***********************************/ +/* NOTES: + * + * - To make the definition of bit_string_literal more + * concise, it is useful to use an extra non-terminal + * symbol (i.e. a grouping or construct) that groups the + * following elements (BYTE, WORD, DWORD, LWORD). + * Note that the definition of bit_string_type_name + * (according to the spec) includes the above elements + * and an extra BOOL. + * We could use an extra construct with the first four + * elements to be used solely in the definition of + * bit_string_literal, but with the objective of not + * having to replicate the actions (if we ever need + * to change them, they would need to be changed in both + * bit_string_type_name and the extra grouping), we + * have re-defined bit_string_type_name as only including + * the first four elements. + * In order to have our parser implement the specification + * correctly we have augmented every occurence of + * bit_string_type_name in other rules with the BOOL + * token. Since bit_string_type_name only appears in + * the rule for elementary_type_name, this does not + * seem to be a big concession to make! + * + * - We have added a helper symbol to concentrate the + * instantiation of STRING and WSTRING into a single + * location (elementary_string_type_name). + * These two elements show up in several other rules, + * but we want to create the equivalent abstract syntax + * in a single location of this file, in order to make + * possible future changes easier to edit... + */ +%type elementary_type_name +%type numeric_type_name +%type integer_type_name +%type signed_integer_type_name +%type unsigned_integer_type_name +%type real_type_name +%type date_type_name +%type bit_string_type_name +/* helper symbol to concentrate the instantiation + * of STRING and WSTRING into a single location + */ +%type elementary_string_type_name + +%token BYTE +%token WORD +%token DWORD +%token LWORD + +%token LREAL +%token REAL + +%token SINT +%token INT +%token DINT +%token LINT + +%token USINT +%token UINT +%token UDINT +%token ULINT + +%token WSTRING +%token STRING +%token BOOL + +%token TIME +%token DATE +%token DATE_AND_TIME +%token DT +%token TIME_OF_DAY +%token TOD + +/******************************************************/ +/* Symbols 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 */ +/******************************************************/ + +%token SAFEBYTE +%token SAFEWORD +%token SAFEDWORD +%token SAFELWORD + +%token SAFELREAL +%token SAFEREAL + +%token SAFESINT +%token SAFEINT +%token SAFEDINT +%token SAFELINT + +%token SAFEUSINT +%token SAFEUINT +%token SAFEUDINT +%token SAFEULINT + +%token SAFEWSTRING +%token SAFESTRING +%token SAFEBOOL + +%token SAFETIME +%token SAFEDATE +%token SAFEDATE_AND_TIME +%token SAFEDT +%token SAFETIME_OF_DAY +%token SAFETOD + +/********************************/ +/* B 1.3.2 - Generic data types */ +/********************************/ +/* Strangely, the following symbol does seem to be required! */ +// %type generic_type_name + +/* The following tokens do not seem to be used either + * but we declare them so they become reserved words... + */ +%token ANY +%token ANY_DERIVED +%token ANY_ELEMENTARY +%token ANY_MAGNITUDE +%token ANY_NUM +%token ANY_REAL +%token ANY_INT +%token ANY_BIT +%token ANY_STRING +%token ANY_DATE + + +/********************************/ +/* B 1.3.3 - Derived data types */ +/********************************/ +%type derived_type_name +%type single_element_type_name +// %type simple_type_name +// %type subrange_type_name +// %type enumerated_type_name +// %type array_type_name +// %type structure_type_name + +%type data_type_declaration +/* helper symbol for data_type_declaration */ +%type type_declaration_list +%type type_declaration +%type single_element_type_declaration + +%type simple_type_declaration +%type simple_spec_init +%type simple_specification + +%type subrange_type_declaration +%type subrange_spec_init +%type subrange_specification +%type subrange + +%type enumerated_type_declaration +%type enumerated_spec_init +%type enumerated_specification +/* helper symbol for enumerated_value */ +%type enumerated_value_list +%type enumerated_value +//%type enumerated_value_without_identifier + +%type array_type_declaration +%type array_spec_init +%type array_specification +/* helper symbol for array_specification */ +%type array_subrange_list +%type array_initialization +/* helper symbol for array_initialization */ +%type array_initial_elements_list +%type array_initial_elements +%type array_initial_element + +%type structure_type_declaration +%type structure_specification +%type initialized_structure +%type structure_declaration +/* helper symbol for structure_declaration */ +%type structure_element_declaration_list +%type structure_element_declaration +%type structure_element_name +%type structure_initialization +/* helper symbol for structure_initialization */ +%type structure_element_initialization_list +%type structure_element_initialization + +//%type string_type_name +%type string_type_declaration +/* helper symbol for string_type_declaration */ +%type string_type_declaration_size +/* helper symbol for string_type_declaration */ +%type string_type_declaration_init + +%token ASSIGN +%token DOTDOT /* ".." */ +%token TYPE +%token END_TYPE +%token ARRAY +%token OF +%token STRUCT +%token END_STRUCT + + + +/*********************/ +/* B 1.4 - Variables */ +/*********************/ +%type variable +%type symbolic_variable +/* helper symbol for prog_cnxn */ +%type any_symbolic_variable +%type variable_name + + + + +/********************************************/ +/* B.1.4.1 Directly Represented Variables */ +/********************************************/ +/* Done totally within flex... + location_prefix + size_prefix +*/ +%token direct_variable_token +//%type direct_variable + + +/*************************************/ +/* B.1.4.2 Multi-element Variables */ +/*************************************/ +%type multi_element_variable +/* helper symbol for any_symbolic_variable */ +%type any_multi_element_variable +%type array_variable +/* helper symbol for any_symbolic_variable */ +%type any_array_variable +%type subscripted_variable +/* helper symbol for any_symbolic_variable */ +%type any_subscripted_variable +%type subscript_list +%type subscript +%type structured_variable +/* helper symbol for any_symbolic_variable */ +%type any_structured_variable +%type record_variable +/* helper symbol for any_symbolic_variable */ +%type any_record_variable +%type field_selector + + +/******************************************/ +/* B 1.4.3 - Declaration & Initialisation */ +/******************************************/ +%type input_declarations +/* helper symbol for input_declarations */ +%type input_declaration_list +%type input_declaration +%type edge_declaration +/* en_param_declaration is not in the standard, but should be! */ +%type en_param_declaration +%type var_init_decl +%type var1_init_decl +%type var1_list +%type array_var_init_decl +%type structured_var_init_decl +%type fb_name_decl +/* helper symbol for fb_name_decl */ +%type fb_name_list_with_colon +/* helper symbol for fb_name_list_with_colon */ +%type var1_list_with_colon +// %type fb_name_list +// %type fb_name +%type output_declarations +%type var_output_init_decl +%type var_output_init_decl_list +/* eno_param_declaration is not in the standard, but should be! */ +%type eno_param_declaration +%type input_output_declarations +/* helper symbol for input_output_declarations */ +%type var_declaration_list +%type var_declaration +%type temp_var_decl +%type var1_declaration +%type array_var_declaration +%type structured_var_declaration +%type var_declarations +%type retentive_var_declarations +%type located_var_declarations +/* helper symbol for located_var_declarations */ +%type located_var_decl_list +%type located_var_decl +%type external_var_declarations +/* helper symbol for external_var_declarations */ +%type external_declaration_list +%type external_declaration +%type global_var_name +%type global_var_declarations +/* helper symbol for global_var_declarations */ +%type global_var_decl_list +%type global_var_decl +%type global_var_spec +%type located_var_spec_init +%type location +%type global_var_list +%type string_var_declaration +%type single_byte_string_var_declaration +%type single_byte_string_spec +%type double_byte_string_var_declaration +%type double_byte_string_spec +%type incompl_located_var_declarations +/* helper symbol for incompl_located_var_declarations */ +%type incompl_located_var_decl_list +%type incompl_located_var_decl +%type incompl_location +%type var_spec +/* helper symbol for var_spec */ +%type string_spec +/* intermediate helper symbol for: + * - non_retentive_var_decls + * - var_declarations + */ +%type var_init_decl_list + +%token incompl_location_token + +%token VAR_INPUT +%token VAR_OUTPUT +%token VAR_IN_OUT +%token VAR_EXTERNAL +%token VAR_GLOBAL +%token END_VAR +%token RETAIN +%token NON_RETAIN +%token R_EDGE +%token F_EDGE +%token AT + + +/***********************/ +/* B 1.5.1 - Functions */ +/***********************/ +// %type function_name +/* helper symbol for IL language */ +%type function_name_no_clashes +%type function_name_simpleop_clashes +//%type function_name_expression_clashes +/* helper symbols for ST language */ +//%type function_name_NOT_clashes +%type function_name_no_NOT_clashes + +//%type standard_function_name +/* helper symbols for IL language */ +%type standard_function_name_no_clashes +%type standard_function_name_simpleop_clashes +%type standard_function_name_expression_clashes +/* helper symbols for ST language */ +%type standard_function_name_NOT_clashes +%type standard_function_name_no_NOT_clashes + +%type derived_function_name +%type function_declaration +/* helper symbol for function_declaration */ +%type function_name_declaration +%type io_var_declarations +%type function_var_decls +%type function_body +%type var2_init_decl +/* intermediate helper symbol for function_declaration */ +%type io_OR_function_var_declarations_list +/* intermediate helper symbol for function_var_decls */ +%type var2_init_decl_list + +%token standard_function_name_token + +%token FUNCTION +%token END_FUNCTION +%token CONSTANT + + +/*****************************/ +/* B 1.5.2 - Function Blocks */ +/*****************************/ +%type function_block_type_name +%type standard_function_block_name +%type derived_function_block_name +%type function_block_declaration +%type other_var_declarations +%type temp_var_decls +%type non_retentive_var_decls +%type function_block_body +/* intermediate helper symbol for function_declaration */ +%type io_OR_other_var_declarations_list +/* intermediate helper symbol for temp_var_decls */ +%type temp_var_decls_list + +%token standard_function_block_name_token + +%token FUNCTION_BLOCK +%token END_FUNCTION_BLOCK +%token VAR_TEMP +// %token END_VAR +%token VAR +// %token NON_RETAIN +// %token END_VAR + + +/**********************/ +/* B 1.5.3 - Programs */ +/**********************/ +%type program_type_name +%type program_declaration +/* helper symbol for program_declaration */ +%type program_var_declarations_list + +%token PROGRAM +%token END_PROGRAM + + +/********************************************/ +/* B 1.6 Sequential Function Chart elements */ +/********************************************/ + +%type sequential_function_chart +%type sfc_network +%type initial_step +%type step +%type action_association_list +%type step_name +%type action_association +/* helper symbol for action_association */ +%type indicator_name_list +%type action_name +%type action_qualifier +%type qualifier +%type timed_qualifier +%type action_time +%type indicator_name +%type transition +%type steps +%type step_name_list +%type transition_priority +%type transition_condition +%type action +%type action_body +%type transition_name + + +// %token ASSIGN +%token ACTION +%token END_ACTION + +%token TRANSITION +%token END_TRANSITION +%token FROM +%token TO +%token PRIORITY + +%token INITIAL_STEP +%token STEP +%token END_STEP + +%token L +%token D +%token SD +%token DS +%token SL + +%token N +%token P +/* NOTE: the following two clash with the R and S IL operators. + * It will have to be handled when we include parsing of SFC... + */ +/* +%token R +%token S +*/ + + +/********************************/ +/* B 1.7 Configuration elements */ +/********************************/ +%type configuration_name +%type resource_type_name +%type configuration_declaration +// helper symbol for +// - configuration_declaration +// - resource_declaration +// +%type optional_global_var_declarations +// helper symbol for configuration_declaration +%type optional_access_declarations +// helper symbol for configuration_declaration +%type optional_instance_specific_initializations +// helper symbol for configuration_declaration +%type resource_declaration_list +%type resource_declaration +%type single_resource_declaration +// helper symbol for single_resource_declaration +%type task_configuration_list +// helper symbol for single_resource_declaration +%type program_configuration_list +%type resource_name +// %type access_declarations +// helper symbol for access_declarations +// %type access_declaration_list +// %type access_declaration +// %type access_path +// helper symbol for access_path +%type any_fb_name_list +%type global_var_reference +// %type access_name +%type program_output_reference +%type program_name +// %type direction +%type task_configuration +%type task_name +%type task_initialization +// 3 helper symbols for task_initialization +%type task_initialization_single +%type task_initialization_interval +%type task_initialization_priority + +%type data_source +%type program_configuration +// helper symbol for program_configuration +%type optional_task_name +// helper symbol for program_configuration +%type optional_prog_conf_elements +%type prog_conf_elements +%type prog_conf_element +%type fb_task +%type prog_cnxn +%type prog_data_source +%type data_sink +%type instance_specific_initializations +// helper symbol for instance_specific_initializations +%type instance_specific_init_list +%type instance_specific_init +// helper symbol for instance_specific_init +%type fb_initialization + +%type prev_declared_global_var_name +%token prev_declared_global_var_name_token + +%type prev_declared_program_name +%token prev_declared_program_name_token + +%type prev_declared_resource_name +%token prev_declared_resource_name_token + +%token prev_declared_configuration_name_token + +// %type prev_declared_task_name +// %token prev_declared_task_name_token + +%token CONFIGURATION +%token END_CONFIGURATION +%token TASK +%token RESOURCE +%token ON +%token END_RESOURCE +%token VAR_CONFIG +%token VAR_ACCESS +// %token END_VAR +%token WITH +// %token PROGRAM +// %token RETAIN +// %token NON_RETAIN +// %token PRIORITY +%token SINGLE +%token INTERVAL +%token READ_WRITE +%token READ_ONLY + + +/***********************************/ +/* B 2.1 Instructions and Operands */ +/***********************************/ +%type instruction_list +%type il_instruction +%type il_incomplete_instruction +%type label +%type il_simple_operation +// helper symbol for il_simple_operation +//%type il_simple_operator_clash_il_operand +%type il_expression +%type il_jump_operation +%type il_fb_call +%type il_formal_funct_call +// helper symbol for il_formal_funct_call +%type il_expr_operator_clash_eol_list +%type il_operand +%type il_operand_list +// helper symbol for il_simple_operation +%type il_operand_list2 +%type simple_instr_list +%type il_simple_instruction +%type il_param_list +%type il_param_instruction_list +%type il_param_instruction +%type il_param_last_instruction +%type il_param_assignment +%type il_param_out_assignment + +%token EOL + + +/*******************/ +/* B 2.2 Operators */ +/*******************/ +%token sendto_identifier_token +%type sendto_identifier + +%type LD_operator +%type LDN_operator +%type ST_operator +%type STN_operator +%type NOT_operator +%type S_operator +%type R_operator +%type S1_operator +%type R1_operator +%type CLK_operator +%type CU_operator +%type CD_operator +%type PV_operator +%type IN_operator +%type PT_operator +%type AND_operator +%type AND2_operator +%type OR_operator +%type XOR_operator +%type ANDN_operator +%type ANDN2_operator +%type ORN_operator +%type XORN_operator +%type ADD_operator +%type SUB_operator +%type MUL_operator +%type DIV_operator +%type MOD_operator +%type GT_operator +%type GE_operator +%type EQ_operator +%type LT_operator +%type LE_operator +%type NE_operator +%type CAL_operator +%type CALC_operator +%type CALCN_operator +%type RET_operator +%type RETC_operator +%type RETCN_operator +%type JMP_operator +%type JMPC_operator +%type JMPCN_operator + +%type il_simple_operator +%type il_simple_operator_clash +%type il_simple_operator_clash1 +%type il_simple_operator_clash2 +%type il_simple_operator_noclash + +//%type il_expr_operator +%type il_expr_operator_clash +%type il_expr_operator_noclash + +%type il_assign_operator +%type il_assign_out_operator +%type il_call_operator +%type il_return_operator +%type il_jump_operator + + +%token LD +%token LDN +%token ST +%token STN +%token NOT +%token S +%token R +%token S1 +%token R1 +%token CLK +%token CU +%token CD +%token PV +%token IN +%token PT +%token AND +%token AND2 /* character '&' in the source code*/ +%token OR +%token XOR +%token ANDN +%token ANDN2 /* characters '&N' in the source code */ +%token ORN +%token XORN +%token ADD +%token SUB +%token MUL +%token DIV +%token MOD +%token GT +%token GE +%token EQ +%token LT +%token LE +%token NE +%token CAL +%token CALC +%token CALCN +%token RET +%token RETC +%token RETCN +%token JMP +%token JMPC +%token JMPCN + +%token SENDTO /* "=>" */ + + +/***********************/ +/* B 3.1 - Expressions */ +/***********************/ +/* NOTE: + * + * - unary_operator, multiply_operator, + * add_operator and comparison_operator + * are not required. Their values are integrated + * directly into other rules... + */ +%type expression +%type xor_expression +%type and_expression +%type comparison +%type equ_expression +// %type comparison_operator +%type add_expression +// %type add_operator +%type term +// %type multiply_operator +%type power_expression +%type unary_expression +// %type unary_operator +%type primary_expression +%type non_negative_primary_expression +/* intermediate helper symbol for primary_expression */ +%type function_invocation + +// %token AND +// %token XOR +// %token OR +// %token MOD +// %token NOT +%token OPER_NE +%token OPER_GE +%token OPER_LE +%token OPER_EXP + + +/********************/ +/* B 3.2 Statements */ +/********************/ +%type statement_list +%type statement + + + +/*********************************/ +/* B 3.2.1 Assignment Statements */ +/*********************************/ +%type assignment_statement +// %token ASSIGN /* ":=" */ + + +/*****************************************/ +/* B 3.2.2 Subprogram Control Statements */ +/*****************************************/ +%type subprogram_control_statement +%type return_statement +%type fb_invocation +// %type param_assignment +%type param_assignment_formal +%type param_assignment_nonformal +/* helper symbols for fb_invocation */ +%type param_assignment_formal_list +%type param_assignment_nonformal_list + +// %token ASSIGN +// %token SENDTO /* "=>" */ +%token RETURN + + +/********************************/ +/* B 3.2.3 Selection Statements */ +/********************************/ +%type selection_statement +%type if_statement +%type case_statement +%type case_element +%type case_list +%type case_list_element +/* helper symbol for if_statement */ +%type elseif_statement_list +/* helper symbol for elseif_statement_list */ +%type elseif_statement +/* helper symbol for case_statement */ +%type case_element_list + +%token IF +%token THEN +%token ELSIF +%token ELSE +%token END_IF + +%token CASE +// %token OF +// %token ELSE +%token END_CASE + + + +/********************************/ +/* B 3.2.4 Iteration Statements */ +/********************************/ +%type iteration_statement +%type for_statement +%type control_variable +%type while_statement +%type repeat_statement +%type exit_statement +/* Integrated directly into for_statement */ +// %type for_list + +%token FOR +// %token ASSIGN +// %token TO +%token BY +%token DO +%token END_FOR + +%token WHILE +// %token DO +%token END_WHILE + +%token REPEAT +%token UNTIL +%token END_REPEAT + +%token EXIT + + +%% + + + + +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ +/********************************************************/ + + +start: + library {$$ = $1;} +; + + +/**********************************************************************************/ +/* B XXX - Things that are missing from the standard, but should have been there! */ +/**********************************************************************************/ + + +/* the pragmas... */ + + +disable_code_generation_pragma: + disable_code_generation_pragma_token {$$ = new disable_code_generation_pragma_c(locloc(@$));} + +enable_code_generation_pragma: + enable_code_generation_pragma_token {$$ = new enable_code_generation_pragma_c(locloc(@$));} + +pragma: + pragma_token {$$ = new pragma_c($1, locloc(@$));} + +any_pragma: + disable_code_generation_pragma +| enable_code_generation_pragma +| pragma +; + + +/* EN/ENO */ +/* Tese tokens are essentially used as variable names, so we handle them + * similarly to these... + */ +en_identifier: + EN {$$ = new identifier_c("EN", locloc(@$));} +; + +eno_identifier: + ENO {$$ = new identifier_c("ENO", locloc(@$));} +; + + + +/*************************************/ +/* Prelimenary helpful constructs... */ +/*************************************/ + +/* NOTE: + * short version: + * identifier is used for previously undeclared identifiers + * any_identifier is used when any identifier, previously + * declared or not, is required in the syntax. + * + * long version: + * When flex comes across an identifier, it first + * searches through the currently declared variables, + * functions, types, etc... to determine if it has + * been previously declared. + * Only if the identifier has not yet been declared + * will it return an identifier_token (later turned into + * an identifier symbol by the bison generated syntax parser). + * + * Some constructs in the syntax, such as when calling + * a function 'F(var1 := 1; var2 := 2);', will accept _any_ + * identifier in 'var1', even if it has been previously + * declared in the current scope, since var1 belongs to + * another scope (the variables declared in function F). + * + * For the above reason, we need to define the symbol + * any_identifier. All the symbols that may become an + * any_identifier are expected to be stored in the + * abstract syntax as a identifier_c + */ +/* NOTE: + * Type names, function names, function block type names and + * program type names are considerd keywords once they are defined, + * so may no longer be used for variable names! + * BUT the spec is confusing on this issue, as it is not clear when + * a function name should be considered as defined. If it is to be + * considered defined only from the location from where it is declared + * and onwards, it means that before it is declared its name may be + * used for variable names! + * This means that we must allow names previously used for functions + * (et. al.) to also constitue an any_identifier! + */ +any_identifier: + identifier +| prev_declared_fb_name +| prev_declared_variable_name +/**/ +| prev_declared_enumerated_type_name +| prev_declared_simple_type_name +| prev_declared_subrange_type_name +| prev_declared_array_type_name +| prev_declared_structure_type_name +| prev_declared_string_type_name +| prev_declared_derived_function_name +| prev_declared_derived_function_block_name +| prev_declared_program_type_name +/**/ +| prev_declared_resource_name +| prev_declared_program_name +| prev_declared_global_var_name +; + + +prev_declared_variable_name: prev_declared_variable_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_fb_name: prev_declared_fb_name_token {$$ = new identifier_c($1, locloc(@$));}; + +prev_declared_simple_type_name: prev_declared_simple_type_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_subrange_type_name: prev_declared_subrange_type_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_enumerated_type_name: prev_declared_enumerated_type_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_array_type_name: prev_declared_array_type_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_structure_type_name: prev_declared_structure_type_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_string_type_name: prev_declared_string_type_name_token {$$ = new identifier_c($1, locloc(@$));}; + +prev_declared_derived_function_name: prev_declared_derived_function_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_derived_function_block_name: prev_declared_derived_function_block_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_program_type_name: prev_declared_program_type_name_token {$$ = new identifier_c($1, locloc(@$));}; + + + +/***************************/ +/* B 0 - Programming Model */ +/***************************/ +library: + /* empty */ + {if (tree_root == NULL) + tree_root = new library_c(); + $$ = (list_c *)tree_root; + } +| library library_element_declaration + {$$ = $1; $$->add_element($2);} +| library any_pragma + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| library error library_element_declaration + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unknown syntax error."); yyerrok;} +| library error END_OF_INPUT + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unknown syntax error."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +library_element_declaration: + data_type_declaration +| function_declaration +| function_block_declaration +| program_declaration +| configuration_declaration +; + + + +/*******************************************/ +/* B 1.1 - Letters, digits and identifiers */ +/*******************************************/ +/* NOTE: the spec defines identifier as: + * identifier ::= (letter|('_' (letter|digit))) {['_'] (letter|digit)} + * In essence, any sequence of letters or digits, starting with a letter + * or '_'. + * + * On section 2.1.3 (pg 26) , the spec states + * "The keywords listed in annex C shall not be used for any other purpose, + * e.g., variable names or extensions as defined in 1.5.1." + * (NOTE: the spec itself does not follow this rule, as it defines standard + * functions with names identidal to keywords, e.g. 'MOD', 'NOT' !!. This is + * another issue altogether, and is worked around somewhere else...) + * + * This means that we must re-define indentifier so as to exclude + * any keywords defined in annex C. + * + * Note also that the list includes + * - Data type names + * - Function names + * - Function Block names + * This means that any named used for a function name, data type name + * or function block name, essentially becomes a keyword, and may therefore + * no longer be re-used for any other use! (see NOTE 2) + * + * In our case, excluding the keywords is achieved in the lexical parser, + * by two mechanisms: + * (1) giving higher priority to the keywords (tokens) than to identifiers, + * so when the lexical parser finds a keyword it will be parsed as a + * token before being parsed as an identifier. + * (2) when an identifier is found that is not a keyword, the lexical parser + * then looks in the global symbol table, and will not return an identifier + * if the name has been previously used as a data type name, function name, + * or function block name! (In these cases it will return a + * prev_declared_function_name_token, etc...). + * + * Unfortunately, the language (especially IL) uses tokens that are + * not defined as keywords in the spec (e.g. 'IN', 'R1', 'S1', 'PT', etc...)! + * This means that it is valid to name a function 'IN', a variable 'PT', etc... + * In order to solve this potential ambiguity, flex only parses the above + * identifiers as keywords / tokens if we are currently parsing IL code. + * When parsing all code other than IL code, the above identifiers are treated + * just like any other identifier. + * + * + * + * + * NOTE 2: + * I (Mario) find it strange that the writers of the spec really want + * names previously used for function names, data type names or function + * block names, to become full fledged keywords. I understand that they + * do not want these names being used as variable names, but how about + * enumeration values? How about structure element names? + * If we interpret the spec literally, these would not be accepted, + * which would probably burden the programmer quite a bit, in making sure + * all these name don't clash! + * + * + * + * NOTE 3: The keywords, as specified in Annex C are... + * + * - Data type names + * - Function names + * - Function Block names + * - ACTION...END_ACTION + * - ARRAY...OF + * - AT + * - CASE...OF...ELSE...END_CASE + * - CONFIGURATION...END_CONFIGURATION + * - CONSTANT + * - EN, ENO + * - EXIT + * - FALSE + * - F_EDGE + * - FOR...TO...BY...DO...END_FOR + * - FUNCTION...END_FUNCTION + * - FUNCTION_BLOCK...END_FUNCTION_BLOCK + * - IF...THEN...ELSIF...ELSE...END_IF + * - INITIAL_STEP...END_STEP + * - NOT, MOD, AND, XOR, OR + * - PROGRAM...WITH... + * - PROGRAM...END_PROGRAM + * - R_EDGE + * - READ_ONLY, READ_WRITE + * - REPEAT...UNTIL...END_REPEAT + * - RESOURCE...ON...END_RESOURCE + * - RETAIN, NON_RETAIN + * - RETURN + * - STEP...END_STEP + * - STRUCT...END_STRUCT + * - TASK + * - TRANSITION...FROM...TO...END_TRANSITION + * - TRUE + * - TYPE...END_TYPE + * - VAR...END_VAR + * - VAR_INPUT...END_VAR + * - VAR_OUTPUT...END_VAR + * - VAR_IN_OUT...END_VAR + * - VAR_TEMP...END_VAR + * - VAR_EXTERNAL...END_VAR + * - VAR_ACCESS...END_VAR + * - VAR_CONFIG...END_VAR + * - VAR_GLOBAL...END_VAR + * - WHILE...DO...END_WHILE + * - WITH + */ + +identifier: + identifier_token {$$ = new identifier_c($1, locloc(@$));} +; + + + +/*********************/ +/* B 1.2 - Constants */ +/*********************/ +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 +/* 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 */ /* NOTE: already included as a signed integer! */ +| signed_integer +| binary_integer +| octal_integer +| hex_integer +; + + +/* 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!) + */ +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 +; + + +/******************************/ +/* B 1.2.1 - Numeric Literals */ +/******************************/ +/* NOTES: + * + * - integer is parsed by flex, but signed_integer + * is parsed by bison. Flex cannot parse a signed + * integer correctly! For example: '123+456' + * would be parsed by flex as an {integer} {signed_integer} + * instead of {integer} '+' {integer} + * + * - Neither flex nor bison can parse a real_literal + * completely (and correctly). + * Note that we cannot use the definition of real in bison as + * real: signed_integer '.' integer [exponent] + * exponent: {'E'|'e'} ['+'|'-'] integer + * because 123e45 would be parsed by flex as + * integer (123) identifier (e45). + * I.e., flex never hands over an 'e' directly to + * bison, but rather interprets it as an identifier. + * I guess we could jump through hoops and get it + * working in bison, but the following alternative + * seems more straight forward... + * + * We therefore had to break up the definition of + * real_literal in discrete parts: + * real_literal: [real_type_name '#'] singned_real + * signed_real: ['+'|'-'] real + * Flex handles real, while bison handles signed_real + * and real_literal. + * + * - According to the spec, integer '.' integer + * may be reduced to either a real or a fixed_point. + * It is nevertheless possible to figure out from the + * context which of the two rules should be used in + * the reduction. + * Unfortunately, due to the issue described above + * regarding the exponent of a real, the syntax + * integer '.' integer + * must be parsed by flex as a single token (i.e. + * fixed_point_token). This means we must add fixed_point + * to the definition of real! + * + * - The syntax also uses a construct + * fixed_point: integer ['.' integer] + * Notice that real is not defined based on fixed point, + * but rather off integer thus: + * real: integer '.' integer [exponent] + * This means that a real may not be composed of a single + * integer, unlike the construct fixed_point! + * This also means that a + * integer '.' integer + * could be reduced to either a real or a fixed_point + * construct. It is probably possible to decide by looking + * at the context, BUT: + * Unfortunatley, due to the reasons explained way above, + * a real (with an exponent) has to be handled by flex as a + * whole. This means that we cannot leave to bison (the syntax + * parser) the decision of how to reduce an + * integer '.' integer + * (either to real or to fixed_point) + * The decision on how to reduce it would need to be done by + * ther lexical analyser (i.e. flex). But flex cannot do this + * sort of thing. + * The solution I (Mario) adopted is to have flex return + * a real_token on (notice that exponent is no longer optional) + * integer '.' integer exponent + * and to return a fixed_point_token when it finds + * integer '.' integer + * We now redefine real and fixed_point to be + * fixed_point: fixed_point_token | integer + * real: real_token | fixed_point_token + */ +real: + real_token {$$ = new real_c($1, locloc(@$));} +| fixed_point_token {$$ = new real_c($1, locloc(@$));} +; + +integer: integer_token {$$ = new integer_c($1, locloc(@$));}; +binary_integer: binary_integer_token {$$ = new binary_integer_c($1, locloc(@$));}; +octal_integer: octal_integer_token {$$ = new octal_integer_c($1, locloc(@$));}; +hex_integer: hex_integer_token {$$ = new hex_integer_c($1, locloc(@$));}; + +numeric_literal: + integer_literal +| real_literal +; + + +integer_literal: + integer_type_name '#' signed_integer + {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} +| integer_type_name '#' binary_integer + {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} +| integer_type_name '#' octal_integer + {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} +| integer_type_name '#' hex_integer + {$$ = new integer_literal_c($1, $3, locf(@1), locl(@3));} +/* NOTE: see note in the definition of constant for reason + * why signed_integer, binary_integer, octal_integer + * and hex_integer are missing here! + */ +/* 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++;} +| integer_type_name binary_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;} +| integer_type_name octal_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;} +| integer_type_name hex_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between integer type name and value in integer literal."); yynerrs++;} +| integer_type_name '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for integer literal.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for integer literal."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +signed_integer: + integer +| '+' integer {$$ = $2;} +| '-' integer {$$ = new neg_integer_c($2, locloc(@$));} +; + + +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 + {$$ = new real_literal_c($1, $3, locf(@1), locl(@3));} +/* ERROR_CHECK_BEGIN */ +| real_type_name signed_real + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between real type name and value in real literal."); yynerrs++;} +| real_type_name '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for real literal.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for real literal."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +signed_real: + real +| '+' real {$$ = $2;} +| '-' real {$$ = new neg_real_c($2, locloc(@2));} +; + + + +bit_string_literal: + bit_string_type_name '#' integer /* i.e. unsigned_integer */ + {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} +| bit_string_type_name '#' binary_integer + {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} +| bit_string_type_name '#' octal_integer + {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} +| bit_string_type_name '#' hex_integer + {$$ = new bit_string_literal_c($1, $3, locf(@1), locl(@3));} +/* NOTE: see note in the definition of constant for reason + * why unsigned_integer, binary_integer, octal_integer + * and hex_integer are missing here! + */ +/* NOTE: see note under the B 1.2.1 section of token + * and grouping type definition for reason why the use of + * bit_string_type_name, although seemingly incorrect, is + * really correct here! + */ +/* ERROR_CHECK_BEGIN */ +| bit_string_type_name integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} +| bit_string_type_name binary_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} +| bit_string_type_name octal_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} +| bit_string_type_name hex_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between bit string type name and value in bit string literal."); yynerrs++;} +| bit_string_type_name '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for bit string literal.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for bit string literal."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +boolean_literal: + boolean_true_literal_token + {$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)), + new boolean_true_c(locloc(@$)), + locloc(@$)); + } +| boolean_false_literal_token + {$$ = new boolean_literal_c(new bool_type_name_c(locloc(@$)), + new boolean_false_c(locloc(@$)), + locloc(@$)); + } +| safeboolean_true_literal_token + {$$ = new boolean_literal_c(new safebool_type_name_c(locloc(@$)), + new boolean_true_c(locloc(@$)), + locloc(@$)); + } +| safeboolean_false_literal_token + {$$ = new boolean_literal_c(new safebool_type_name_c(locloc(@$)), + new boolean_false_c(locloc(@$)), + locloc(@$)); + } +| FALSE + {$$ = new boolean_literal_c(NULL, + new boolean_false_c(locloc(@$)), + locloc(@$)); + } +| TRUE + {$$ = new boolean_literal_c(NULL, + new boolean_true_c(locloc(@$)), + locloc(@$)); + } +/* +| BOOL '#' '1' {} +| BOOL '#' '0' {} +*/ +/* NOTE: the rules + * BOOL '#' '1' + * and + * BOOL '#' '0' + * do not work as expected... + * Consider that we are using 'BOOL' and '#' as tokens + * that flex hands over to bison (yacc). Because flex would + * then parse the single '1' or '0' as an integer, + * the rule in bison would have to be + * BOOL '#' integer, followed by verifying of the + * integer has the correct value! + * + * We therefore have flex return TRUE whenever it + * comes across 'TRUE' or 'BOOL#1', and FALSE whenever + * it comes across 'FALSE' or 'BOOL#0'. + * Note that this means that flex will parse "BOOL#01" + * as FALSE followed by an integer ('1'). + * Bison should detect this as an error, so we should + * be OK. + * + * Another option would be to change the rules to accept + * BOOL '#' integer + * but then check whether the integer has a correct + * value! At the moment I feel that the first option + * is more straight forward. + */ +; + + + +/*******************************/ +/* B 1.2.2 - Character Strings */ +/*******************************/ +/* Transform the tokens given us by flex into leafs */ +single_byte_character_string: single_byte_character_string_token + {$$ = new single_byte_character_string_c($1, locloc(@$));}; + +double_byte_character_string: double_byte_character_string_token + {$$ = new double_byte_character_string_c($1, locloc(@$));}; + + +character_string: + single_byte_character_string +| double_byte_character_string +; + + + + + +/***************************/ +/* B 1.2.3 - Time Literals */ +/***************************/ +time_literal: + time_of_day +| date +| date_and_time +| duration +; + + +/************************/ +/* B 1.2.3.1 - Duration */ +/************************/ +duration: +/* (T | TIME) '#' ['-'] interval */ +/* NOTE: since TIME is also a data type, it is a keyword + * and may therefore be handled by a token. + * + * Unfortunately T is not a data type, and therefore + * not a keyword. This means that we may have variables named T! + * Flex cannot return the token TIME when it comes across a single T! + * + * We therefore have flex returning the token T_SHARP + * when it comes across 'T#' + */ + TIME '#' interval + {$$ = new duration_c(new time_type_name_c(locloc(@1)), NULL, $3, locloc(@$));} +| TIME '#' '-' interval + {$$ = new duration_c(new time_type_name_c(locloc(@1)), new neg_time_c(locloc(@$)), $4, locloc(@$));} +| T_SHARP interval + {$$ = new duration_c(new time_type_name_c(locloc(@1)), NULL, $2, locloc(@$));} +| T_SHARP '-' interval + {$$ = new duration_c(new time_type_name_c(locloc(@1)), new neg_time_c(locloc(@$)), $3, locloc(@$));} +| SAFETIME '#' interval + {$$ = new duration_c(new safetime_type_name_c(locloc(@1)), NULL, $3, locloc(@$));} +| SAFETIME '#' '-' interval + {$$ = new duration_c(new safetime_type_name_c(locloc(@1)), new neg_time_c(locloc(@$)), $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| TIME interval + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} +| TIME '-' interval + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME' and interval in duration."); yynerrs++;} +| TIME '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for duration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for duration."); yyclearin;} + yyerrok; + } +| T_SHARP error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for duration.");} + else {print_err_msg(locf(@2), locl(@2), "invalid value for duration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +interval: + days +| hours +| minutes +| seconds +| milliseconds +; + +integer_d: integer_d_token {$$ = new integer_c($1, locloc(@$));}; +integer_h: integer_h_token {$$ = new integer_c($1, locloc(@$));}; +integer_m: integer_m_token {$$ = new integer_c($1, locloc(@$));}; +integer_s: integer_s_token {$$ = new integer_c($1, locloc(@$));}; +integer_ms: integer_ms_token {$$ = new integer_c($1, locloc(@$));}; + +fixed_point_d: + fixed_point_d_token + {$$ = new fixed_point_c($1, locloc(@$));} +| integer_d +; + +fixed_point_h: + fixed_point_h_token + {$$ = new fixed_point_c($1, locloc(@$));} +| integer_h +; + +fixed_point_m: + fixed_point_m_token + {$$ = new fixed_point_c($1, locloc(@$));} +| integer_m +; + +fixed_point_s: + fixed_point_s_token + {$$ = new fixed_point_c($1, locloc(@$));} +| integer_s +; + +fixed_point_ms: + fixed_point_ms_token + {$$ = new fixed_point_c($1, locloc(@$));} +| integer_ms +; + + +fixed_point: + fixed_point_token + {$$ = new fixed_point_c($1, locloc(@$));} +| integer +; + + +days: +/* fixed_point ('d') */ + fixed_point_d + {$$ = new days_c($1, NULL, locloc(@$));} +/*| integer ('d') ['_'] hours */ +| integer_d hours + {$$ = new days_c($1, $2, locloc(@$));} +| integer_d '_' hours + {$$ = new days_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| integer_d '_' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for hours in duration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for hours in duration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +hours: +/* fixed_point ('h') */ + fixed_point_h + {$$ = new hours_c($1, NULL, locloc(@$));} +/*| integer ('h') ['_'] minutes */ +| integer_h minutes + {$$ = new hours_c($1, $2, locloc(@$));} +| integer_h '_' minutes + {$$ = new hours_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| integer_h '_' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for minutes in duration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for minutes in duration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ + +; + +minutes: +/* fixed_point ('m') */ + fixed_point_m + {$$ = new minutes_c($1, NULL, locloc(@$));} +/*| integer ('m') ['_'] seconds */ +| integer_m seconds + {$$ = new minutes_c($1, $2, locloc(@$));} +| integer_m '_' seconds + {$$ = new minutes_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| integer_m '_' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for seconds in duration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for seconds in duration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +seconds: +/* fixed_point ('s') */ + fixed_point_s + {$$ = new seconds_c($1, NULL, locloc(@$));} +/*| integer ('s') ['_'] milliseconds */ +| integer_s milliseconds + {$$ = new seconds_c($1, $2, locloc(@$));} +| integer_s '_' milliseconds + {$$ = new seconds_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| integer_s '_' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for milliseconds in duration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for milliseconds in duration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +milliseconds: +/* fixed_point ('ms') */ + fixed_point_ms + {$$ = new milliseconds_c($1, locloc(@$));} +; + + + +/************************************/ +/* B 1.2.3.2 - Time of day and Date */ +/************************************/ +time_of_day: + TIME_OF_DAY '#' daytime + {$$ = new time_of_day_c(new tod_type_name_c(locloc(@1)), $3, locloc(@$));} +| SAFETIME_OF_DAY '#' daytime + {$$ = new time_of_day_c(new safetod_type_name_c(locloc(@1)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| TIME_OF_DAY daytime + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'TIME_OF_DAY' and daytime in time of day."); yynerrs++;} +| TIME_OF_DAY '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for time of day.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for time of day."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +daytime: + day_hour ':' day_minute ':' day_second + {$$ = new daytime_c($1, $3, $5, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| ':' day_minute ':' day_second + {$$ = NULL; print_err_msg(locf(@1), locl(@4), "no value defined for hours in daytime."); yynerrs++;} +| error ':' day_minute ':' day_second + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid value defined for hours in daytime."); yyerrok;} +| day_hour day_minute ':' day_second + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between hours and minutes in daytime."); yynerrs++;} +| day_hour ':' ':' day_second + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for minutes in daytime."); yynerrs++;} +| day_hour ':' error ':' day_second + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value defined for minutes in daytime."); yyerrok;} +| day_hour ':' day_minute day_second + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "':' missing between minutes and seconds in daytime."); yynerrs++;} +| day_hour ':' day_minute ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for seconds in daytime.");} + else {print_err_msg(locf(@5), locl(@5), "invalid value for seconds in daytime."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +day_hour: integer; +day_minute: integer; +day_second: fixed_point; + + +date: + DATE '#' date_literal + {$$ = new date_c(new date_type_name_c(locloc(@1)), $3, locloc(@$));} +| D_SHARP date_literal + {$$ = new date_c(new date_type_name_c(locloc(@1)), $2, locloc(@$));} +| SAFEDATE '#' date_literal + {$$ = new date_c(new safedate_type_name_c(locloc(@1)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| DATE date_literal + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'DATE' and date literal in date."); yynerrs++;} +| DATE '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for date.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for date."); yyclearin;} + yyerrok; + } +| D_SHARP error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no value defined for date.");} + else {print_err_msg(locf(@2), locl(@2), "invalid value for date."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +date_literal: + year '-' month '-' day + {$$ = new date_literal_c($1, $3, $5, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| '-' month '-' day + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no value defined for year in date literal."); yynerrs++;} +| year month '-' day + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'-' missing between year and month in date literal."); yynerrs++;} +| year '-' '-' day + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for month in date literal."); yynerrs++;} +| year '-' error '-' day + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value defined for month in date literal."); yyerrok;} +| year '-' month day + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "'-' missing between month and day in date literal."); yynerrs++;} +| year '-' month '-' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for day in date literal.");} + else {print_err_msg(locf(@5), locl(@5), "invalid value for day in date literal."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +year: integer; +month: integer; +day: integer; + + +date_and_time: + DATE_AND_TIME '#' date_literal '-' daytime + {$$ = new date_and_time_c(new dt_type_name_c(locloc(@1)), $3, $5, locloc(@$));} +| SAFEDATE_AND_TIME '#' date_literal '-' daytime + {$$ = new date_and_time_c(new safedt_type_name_c(locloc(@1)), $3, $5, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| DATE_AND_TIME date_literal '-' daytime + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between 'DATE_AND_TIME' and date literal in date and time."); yynerrs++;} +| DATE_AND_TIME '#' '-' daytime + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no value defined for date literal in date and time."); yynerrs++;} +| DATE_AND_TIME '#' error '-' daytime + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid value for date literal in date and time."); yyerrok;} +| DATE_AND_TIME '#' date_literal daytime + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "'-' missing between date literal and daytime in date and time."); yynerrs++;} +| DATE_AND_TIME '#' date_literal '-' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@4), locf(@5), "no value defined for daytime in date and time.");} + else {print_err_msg(locf(@5), locl(@5), "invalid value for daytime in date and time."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + + + + +/**********************/ +/* B 1.3 - Data Types */ +/**********************/ +/* Strangely, the following symbol does seem to be required! */ +/* +data_type_name: + non_generic_type_name +| generic_type_name +; +*/ + +non_generic_type_name: + elementary_type_name +| derived_type_name +; + + + +/***********************************/ +/* B 1.3.1 - Elementary Data Types */ +/***********************************/ + /******************************************************/ + /* SAFExxxx Symbols 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 */ + /******************************************************/ + +elementary_type_name: + numeric_type_name +| date_type_name +| bit_string_type_name +| elementary_string_type_name +| TIME {$$ = new time_type_name_c(locloc(@$));} +| BOOL {$$ = new bool_type_name_c(locloc(@$));} +/* NOTE: see note under the B 1.2.1 section of token + * and grouping type definition for reason why BOOL + * was added to this definition. + */ +| SAFETIME {$$ = new safetime_type_name_c(locloc(@$));} +| SAFEBOOL {$$ = new safebool_type_name_c(locloc(@$));} +; + +numeric_type_name: + integer_type_name +| real_type_name +; + +integer_type_name: + signed_integer_type_name +| unsigned_integer_type_name +; + +signed_integer_type_name: + SINT {$$ = new sint_type_name_c(locloc(@$));} +| INT {$$ = new int_type_name_c(locloc(@$));} +| DINT {$$ = new dint_type_name_c(locloc(@$));} +| LINT {$$ = new lint_type_name_c(locloc(@$));} +| SAFESINT {$$ = new safesint_type_name_c(locloc(@$));} +| SAFEINT {$$ = new safeint_type_name_c(locloc(@$));} +| SAFEDINT {$$ = new safedint_type_name_c(locloc(@$));} +| SAFELINT {$$ = new safelint_type_name_c(locloc(@$));} +; + +unsigned_integer_type_name: + USINT {$$ = new usint_type_name_c(locloc(@$));} +| UINT {$$ = new uint_type_name_c(locloc(@$));} +| UDINT {$$ = new udint_type_name_c(locloc(@$));} +| ULINT {$$ = new ulint_type_name_c(locloc(@$));} +| SAFEUSINT {$$ = new safeusint_type_name_c(locloc(@$));} +| SAFEUINT {$$ = new safeuint_type_name_c(locloc(@$));} +| SAFEUDINT {$$ = new safeudint_type_name_c(locloc(@$));} +| SAFEULINT {$$ = new safeulint_type_name_c(locloc(@$));} +; + +real_type_name: + REAL {$$ = new real_type_name_c(locloc(@$));} +| LREAL {$$ = new lreal_type_name_c(locloc(@$));} +| SAFEREAL {$$ = new safereal_type_name_c(locloc(@$));} +| SAFELREAL {$$ = new safelreal_type_name_c(locloc(@$));} +; + +date_type_name: + DATE {$$ = new date_type_name_c(locloc(@$));} +| TIME_OF_DAY {$$ = new tod_type_name_c(locloc(@$));} +| TOD {$$ = new tod_type_name_c(locloc(@$));} +| DATE_AND_TIME {$$ = new dt_type_name_c(locloc(@$));} +| DT {$$ = new dt_type_name_c(locloc(@$));} +| SAFEDATE {$$ = new safedate_type_name_c(locloc(@$));} +| SAFETIME_OF_DAY {$$ = new safetod_type_name_c(locloc(@$));} +| SAFETOD {$$ = new safetod_type_name_c(locloc(@$));} +| SAFEDATE_AND_TIME {$$ = new safedt_type_name_c(locloc(@$));} +| SAFEDT {$$ = new safedt_type_name_c(locloc(@$));} +; + + +bit_string_type_name: + BYTE {$$ = new byte_type_name_c(locloc(@$));} +| WORD {$$ = new word_type_name_c(locloc(@$));} +| DWORD {$$ = new dword_type_name_c(locloc(@$));} +| LWORD {$$ = new lword_type_name_c(locloc(@$));} +| SAFEBYTE {$$ = new safebyte_type_name_c(locloc(@$));} +| SAFEWORD {$$ = new safeword_type_name_c(locloc(@$));} +| SAFEDWORD {$$ = new safedword_type_name_c(locloc(@$));} +| SAFELWORD {$$ = new safelword_type_name_c(locloc(@$));} +/* NOTE: see note under the B 1.2.1 section of token + * and grouping type definition for reason why the BOOL + * was omitted from this definition. + */ +; + + +/* Helper symbol to concentrate the instantiation + * of STRING and WSTRING into a single location. + * + * These two elements show up in several other rules, + * but we want to create the equivalent abstract syntax + * in a single location of this file, in order to make + * possible future changes easier to edit... + */ +elementary_string_type_name: + STRING {$$ = new string_type_name_c(locloc(@$));} +| WSTRING {$$ = new wstring_type_name_c(locloc(@$));} +| SAFESTRING {$$ = new safestring_type_name_c(locloc(@$));} +| SAFEWSTRING {$$ = new safewstring_type_name_c(locloc(@$));} +; + + + +/********************************/ +/* B 1.3.2 - Generic data types */ +/********************************/ +/* Strangely, the following symbol does not seem to be required! */ +/* +generic_type_name: + ANY +| ANY_DERIVED +| ANY_ELEMENTARY +| ANY_MAGNITUDE +| ANY_NUM +| ANY_REAL +| ANY_INT +| ANY_BIT +| ANY_STRING +| ANY_DATE +; +*/ + + +/********************************/ +/* B 1.3.3 - Derived data types */ +/********************************/ + +derived_type_name: + single_element_type_name +| prev_declared_array_type_name +| prev_declared_structure_type_name +| prev_declared_string_type_name +; + +single_element_type_name: + prev_declared_simple_type_name +/* Include the following if arrays of function blocks are to be allowed! + * Since the standard does not allow them, + * we leave it commented out for the time being... + */ +//| prev_declared_derived_function_block_name +| prev_declared_subrange_type_name +| prev_declared_enumerated_type_name +; + +/* NOTE: in order to remove a reduce/reduce conflict, + * all occurences of simple_type_name, etc... + * have been replaced with identifier! + */ +/* +simple_type_name: identifier; +subrange_type_name: identifier; +enumerated_type_name: identifier; +array_type_name: identifier; +structure_type_name: identifier; +*/ + +data_type_declaration: + TYPE type_declaration_list END_TYPE + {$$ = new data_type_declaration_c($2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| TYPE END_TYPE + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no data type declared in data type(s) declaration."); yynerrs++;} +| TYPE error type_declaration_list END_TYPE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'TYPE' in data type(s) declaration."); yyerrok;} +| TYPE type_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed data type(s) declaration."); yyerrok;} +| TYPE error END_TYPE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in data type(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for data_type_declaration */ +type_declaration_list: + type_declaration ';' + {$$ = new type_declaration_list_c(locloc(@$)); $$->add_element($1);} +| type_declaration_list type_declaration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new type_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid data type declaration."); yyerrok;} +| type_declaration error + {$$ = new type_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of data type declaration."); yyerrok;} +| type_declaration_list type_declaration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of data type declaration."); yyerrok;} +| type_declaration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid data type declaration."); yyerrok;} +| type_declaration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after data type declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +type_declaration: + single_element_type_declaration +| array_type_declaration +| structure_type_declaration +| string_type_declaration +; + +single_element_type_declaration: + simple_type_declaration +| subrange_type_declaration +| enumerated_type_declaration +; + +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); + } +/* ERROR_CHECK_BEGIN */ +| error ':' simple_spec_init + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for data type declaration.");yyerrok;} +| identifier simple_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in simple type declaration."); yynerrs++;} +| identifier ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in data type declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in data type declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +simple_spec_init: + simple_specification + /* The following commented line was changed to the + * next two lines so that we wouldn't + * have the first element of a simple_spec_init_c() + * pointing to another simple_spec_init_c! + */ +/* +| simple_specification ASSIGN constant + {$$ = new simple_spec_init_c($1, $3);} +*/ +| elementary_type_name ASSIGN constant + {$$ = new simple_spec_init_c($1, $3, locloc(@$));} +| prev_declared_simple_type_name ASSIGN constant + {$$ = new simple_spec_init_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| elementary_type_name constant + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in specification with initialization."); yynerrs++;} +| prev_declared_simple_type_name constant + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in specification with initialization."); yynerrs++;} +| elementary_type_name ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in specification with initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid initial value in specification with initialization."); yyclearin;} + yyerrok; + } +| prev_declared_simple_type_name ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in specification with initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid initial value in specification with initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* When converting to C/C++, we need to know whether + * the elementary_type_name is being used in a variable + * declaration or elsewhere (ex. declaration of a derived + * type), so the abstract syntax has the elementary_type_name + * wrapped inside a simple_spec_init_c. + * The exact same thing occurs with prev_declared_simple_type_name. + * + * This is why in the definition of simple_spec_init, + * simple_specification was brocken up into its + * constituent components... + */ +simple_specification: +// elementary_type_name | simple_type_name + elementary_type_name + {$$ = new simple_spec_init_c($1, NULL, locloc(@$));} +| prev_declared_simple_type_name + {$$ = new simple_spec_init_c($1, NULL, locloc(@$));} +; + + +subrange_type_declaration: +/* subrange_type_name ':' subrange_spec_init */ + identifier ':' subrange_spec_init + {$$ = new subrange_type_declaration_c($1, $3, locloc(@$)); + library_element_symtable.insert($1, prev_declared_subrange_type_name_token); + } +/* ERROR_CHECK_BEGIN */ +| error ':' subrange_spec_init + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for subrange type declaration."); yyerrok;} +| identifier subrange_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in subrange type declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +subrange_spec_init: + subrange_specification + {$$ = new subrange_spec_init_c($1, NULL, locloc(@$));} +| subrange_specification ASSIGN signed_integer + {$$ = new subrange_spec_init_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| subrange_specification signed_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in subrange specification with initialization."); yynerrs++;} +| subrange_specification ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in subrange specification with initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid initial value in subrange specification with initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +subrange_specification: + integer_type_name '(' subrange ')' + {$$ = new subrange_specification_c($1, $3, locloc(@$));} +| prev_declared_subrange_type_name + {$$ = new subrange_specification_c($1, NULL, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| integer_type_name '(' ')' + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no subrange defined in subrange specification."); yynerrs++;} +| integer_type_name '(' error ')' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid subrange defined in subrange specification."); yyerrok;} +| integer_type_name '(' subrange error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after subrange defined in subrange specification."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +subrange: + signed_integer DOTDOT signed_integer + {$$ = new subrange_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| signed_integer signed_integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'..' missing between bounds in subrange definition."); yynerrs++;} +| signed_integer DOTDOT error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for upper bound in subrange definition.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for upper bound in subrange definition."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +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); + } +/* ERROR_CHECK_BEGIN */ +| error ':' enumerated_spec_init + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid name defined for enumerated type declaration."); yyerrok;} +| identifier enumerated_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in enumerated type declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +enumerated_spec_init: + enumerated_specification + {$$ = new enumerated_spec_init_c($1, NULL, locloc(@$));} +| enumerated_specification ASSIGN enumerated_value + {$$ = new enumerated_spec_init_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| enumerated_specification enumerated_value + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in enumerated specification with initialization."); yynerrs++;} +| enumerated_specification ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in enumerated specification with initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value in enumerated specification with initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +enumerated_specification: + '(' enumerated_value_list ')' + {$$ = $2;} +| prev_declared_enumerated_type_name +/* ERROR_CHECK_BEGIN */ +| '(' ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no enumerated value list defined in enumerated specification."); yynerrs++;} +| '(' error ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid enumerated value list defined in enumerated specification.");yyerrok;} +| '(' enumerated_value_list error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of enumerated specification."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for enumerated_specification */ +enumerated_value_list: + enumerated_value + {$$ = new enumerated_value_list_c(locloc(@$)); $$->add_element($1);} +| enumerated_value_list ',' enumerated_value + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| enumerated_value_list enumerated_value + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in enumerated value list.");} +| enumerated_value_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in enumerated value list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value in enumerated value list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +enumerated_value: + identifier + {$$ = new enumerated_value_c(NULL, $1, locloc(@$));} +| prev_declared_enumerated_type_name '#' any_identifier + {$$ = new enumerated_value_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| prev_declared_enumerated_type_name any_identifier + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'#' missing between enumerated type name and value in enumerated literal."); yynerrs++;} +| prev_declared_enumerated_type_name '#' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for enumerated literal.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for enumerated literal."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +/* +enumerated_value_without_identifier: + prev_declared_enumerated_type_name '#' any_identifier + {$$ = new enumerated_value_c($1, $3, locloc(@$));} +; +*/ + + +array_type_declaration: +/* array_type_name ':' array_spec_init */ + identifier ':' array_spec_init + {$$ = new array_type_declaration_c($1, $3, locloc(@$)); + library_element_symtable.insert($1, prev_declared_array_type_name_token); + } +/* ERROR_CHECK_BEGIN */ +| identifier array_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in array type declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +array_spec_init: + array_specification + {$$ = new array_spec_init_c($1, NULL, locloc(@$));} +| array_specification ASSIGN array_initialization + {$$ = new array_spec_init_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| array_specification array_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in array specification with initialization."); yynerrs++;} +| array_specification ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in array specification with initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid initial value in array specification with initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +array_specification: + prev_declared_array_type_name +| ARRAY '[' array_subrange_list ']' OF non_generic_type_name + {$$ = new array_specification_c($3, $6, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| ARRAY array_subrange_list ']' OF non_generic_type_name + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'[' missing before subrange list in array specification."); yynerrs++;} +| ARRAY '[' ']' OF non_generic_type_name + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no subrange list defined in array specification."); yynerrs++;} +| ARRAY '[' error ']' OF non_generic_type_name + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid subrange list defined in array specification."); yyerrok;} +| ARRAY OF non_generic_type_name + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no subrange list defined in array specification."); yynerrs++;} +| ARRAY error OF non_generic_type_name + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid subrange list defined in array specification."); yyerrok;} +| ARRAY '[' array_subrange_list OF non_generic_type_name + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "']' missing after subrange list in array specification."); yynerrs++;} +| ARRAY '[' array_subrange_list ']' non_generic_type_name + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "'OF' missing between subrange list and item type name in array specification."); yynerrs++;} +| ARRAY '[' array_subrange_list ']' OF error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no item data type defined in array specification.");} + else {print_err_msg(locf(@3), locl(@3), "invalid item data type in array specification."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* helper symbol for array_specification */ +array_subrange_list: + subrange + {$$ = new array_subrange_list_c(locloc(@$)); $$->add_element($1);} +| array_subrange_list ',' subrange + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| array_subrange_list subrange + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in subrange list."); yynerrs++;} +| array_subrange_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no subrange defined in subrange list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid subrange in subrange list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +array_initialization: + '[' array_initial_elements_list ']' + {$$ = $2;} +/* ERROR_CHECK_BEGIN */ +| '[' ']' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no initial values list defined in array initialization."); yynerrs++;} +| '[' error ']' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid initial values list defined in array initialization."); yyerrok;} +| '[' array_initial_elements_list error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "']' missing at the end of array initialization."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for array_initialization */ +array_initial_elements_list: + array_initial_elements + {$$ = new array_initial_elements_list_c(locloc(@$)); $$->add_element($1);} +| array_initial_elements_list ',' array_initial_elements + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN +| array_initial_elements_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no array initial value in array initial values list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +array_initial_elements: + array_initial_element +| integer '(' ')' +| integer '(' array_initial_element ')' + {$$ = new array_initial_elements_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| integer '(' error ')' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid array initial value in array initial values list."); yyerrok;} +| integer '(' array_initial_element error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of array initial value in array initial values list."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +array_initial_element: + constant +| enumerated_value +| structure_initialization +| array_initialization +; + + + +structure_type_declaration: +/* structure_type_name ':' structure_specification */ + identifier ':' structure_specification + {$$ = new structure_type_declaration_c($1, $3, locloc(@$)); + library_element_symtable.insert($1, prev_declared_structure_type_name_token); + } +/* ERROR_CHECK_BEGIN */ +| identifier structure_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between data type name and specification in structure type declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +structure_specification: + structure_declaration +| initialized_structure +; + + +initialized_structure: + prev_declared_structure_type_name + {$$ = new initialized_structure_c($1, NULL, locloc(@$));} +| prev_declared_structure_type_name ASSIGN structure_initialization + {$$ = new initialized_structure_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| prev_declared_structure_type_name structure_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structure specification with initialization."); yynerrs++;} +| prev_declared_structure_type_name ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined in structure specification with initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value in structure specification with initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +structure_declaration: + STRUCT structure_element_declaration_list END_STRUCT + {$$ = $2;} +/* ERROR_CHECK_BEGIN */ +| STRUCT END_STRUCT + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no structure element declared in structure type declaration."); yynerrs++;} +| STRUCT error structure_element_declaration_list END_STRUCT + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'STRUCT' in structure type declaration."); yyerrok;} +| STRUCT structure_element_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed structure type declaration."); yyerrok;} +| STRUCT error END_STRUCT + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in structure type declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for structure_declaration */ +structure_element_declaration_list: + structure_element_declaration ';' + {$$ = new structure_element_declaration_list_c(locloc(@$)); $$->add_element($1);} +| structure_element_declaration_list structure_element_declaration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new structure_element_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid structure element declaration."); yyerrok;} +| structure_element_declaration error + {$$ = new structure_element_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of structure element declaration."); yyerrok;} +| structure_element_declaration_list structure_element_declaration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of structure element declaration."); yyerrok;} +| structure_element_declaration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid structure element declaration."); yyerrok;} +| structure_element_declaration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after structure element declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +structure_element_declaration: + structure_element_name ':' simple_spec_init + {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} +| structure_element_name ':' subrange_spec_init + {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} +| structure_element_name ':' enumerated_spec_init + {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} +| structure_element_name ':' array_spec_init + {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} +| structure_element_name ':' initialized_structure + {$$ = new structure_element_declaration_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| structure_element_name simple_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and simple specification."); yynerrs++;} +| structure_element_name subrange_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and subrange specification."); yynerrs++;} +| structure_element_name enumerated_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and enumerated specification."); yynerrs++;} +| structure_element_name array_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and array specification."); yynerrs++;} +| structure_element_name initialized_structure + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between structure element name and structure specification."); yynerrs++;} +| structure_element_name ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in structure element declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in structure element declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +structure_element_name: any_identifier; + + +structure_initialization: + '(' structure_element_initialization_list ')' + {$$ = $2;} +/* ERROR_CHECK_BEGIN */ +| '(' error ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid structure element initialization list in structure initialization."); yyerrok;} +| '(' structure_element_initialization_list error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ')' at the end of structure element initialization list in structure initialization."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for structure_initialization */ +structure_element_initialization_list: + structure_element_initialization + {$$ = new structure_element_initialization_list_c(locloc(@$)); $$->add_element($1);} +| structure_element_initialization_list ',' structure_element_initialization + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN +| structure_element_initialization_list structure_element_initialization + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in structure element initialization list in structure initialization."); yynerrs++;} +| structure_element_initialization_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no structure element initialization defined in structure initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid structure element initialization in structure initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +structure_element_initialization: + structure_element_name ASSIGN constant + {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} +| structure_element_name ASSIGN enumerated_value + {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} +| structure_element_name ASSIGN array_initialization + {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} +| structure_element_name ASSIGN structure_initialization + {$$ = new structure_element_initialization_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| structure_element_name constant + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structure element initialization."); yynerrs++;} +| structure_element_name enumerated_value + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in enumerated structure element initialization."); yynerrs++;} +| structure_element_name array_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in array structure element initialization."); yynerrs++;} +| structure_element_name structure_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing in structured structure element initialization."); yynerrs++;} +| structure_element_name ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in structured structure element initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid initial value in structured structure element initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* NOTE: in order to remove a reduce/reduce conflict, + * all occurences of string_type_name + * have been replaced with identifier! + */ +/* +string_type_name: identifier; +*/ + +string_type_declaration: +/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */ + identifier ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init + {$$ = new string_type_declaration_c($1, $3, $4, $5, locloc(@$)); + library_element_symtable.insert($1, prev_declared_string_type_name_token); + } +; + + +/* helper symbol for string_type_declaration */ +string_type_declaration_size: + '[' integer ']' + {$$ = $2;} +/* REMOVED !! */ +//| /* empty */ +// {$$ = NULL;} +; +/* The syntax contains a reduce/reduce conflict. + * The optional '[' ']' + * has been changed to become mandatory to remove the conflict. + * + * The conflict arises because + * new_str_type : STRING := "hello!" + * may be reduced to a string_type_declaration OR + * a simple_type_declaration. + * + * Our change forces it to be reduced to a + * simple_type_declaration! + * We chose this option because changing the definition + * of simple_spec_init would force us to change all the other + * rules in which it appears. The change we made has no + * side-effects! + */ + +/* helper symbol for string_type_declaration */ +string_type_declaration_init: + /* empty */ + {$$ = NULL;} +| ASSIGN character_string + {$$ = $2;} +; + + + +/*********************/ +/* B 1.4 - Variables */ +/*********************/ +/* NOTE: The standard is erroneous in it's definition of 'variable' because: + * - The standard considers 'ENO' as a keyword... + * - ...=> which means that it may never be parsed as an 'identifier'... + * - ...=> and therefore may never be used as the name of a variable inside an expression. + * - However, a function/FB must be able to assign the ENO parameter + * it's value, doing it in an assignment statement, and therefore using the 'ENO' + * character sequence as an identifier! + * The obvious solution is to also allow the ENO keyword to be + * used as the name of a variable. Note that this variable may be used + * even though it is not explicitly declared as a function/FB variable, + * as the standard requires us to define it implicitly in this case! + * There are three ways of achieving this: + * (i) simply not define EN and ENO as keywords in flex (lexical analyser) + * and let them be considered 'identifiers'. Aditionally, add some code + * so that if they are not explicitly declared, we add them automatically to + * the declaration of each Functions and FB, where they would then be parsed + * as a previously_declared_variable. + * This approach has the advantage the EN and ENO would automatically be valid + * in every location where it needs to be valid, namely in the explicit declaration + * of these same variables, or when they are used within expressions. + * However, this approach has the drawback that + * EN and ENO could then also be used anywhere a standard identifier is allowed, + * including in the naming of Functions, FBs, Programs, Configurations, Resources, + * SFC Actions, SFC Steps, etc... + * This would mean that we would then have to add a lexical analysis check + * within the bison code (syntax analyser) to all the above constructs to make sure + * that the identifier being used is not EN or ENO. + * (ii) The other approach is to define EN and ENO as keywords / tokens in flex + * (lexical analyser) and then change the syntax in bison to acomodate + * these tokens wherever they could correctly appear. + * This has the drawback that we need to do some changes to the synax defintion. + * (iii) Yet a another option is to mix the above two methods. + * Define EN and ENO as tokens in flex, but change (only) the syntax for + * variable declaration to allow these tokens to also be used in declaring variables. + * From this point onwards these tokens are then considered a previously_declared_variable, + * since flex will first check for this before even checking for tokens. + * + * I (Mario) cuurretnly (2011) believe the cleanest method of achieving this goal + * is to use option (iii) + * However, considering that: + * - I have already previously implemented option (ii); + * - option (iii) requires that flex parse the previously_declared_variable + * before parsing any token. We already support this (remeber that this is + * used mainly to allow some IL operators as well as PRIORITY, etc. tokens + * to be used as identifiers, since the standard does not define them as keywords), + * but this part of the code in flex is often commented out as usually people do not expect + * us to follow the standard in the strict sense, but rather consider those + * tokens as keywords; + * considering the above, we currently carry on using option (ii). + */ +variable: + symbolic_variable +| prev_declared_direct_variable +| eno_identifier + {$$ = new symbolic_variable_c($1, locloc(@$));} +; + + +symbolic_variable: +/* NOTE: To be entirely correct, variable_name must be replacemed by + * prev_declared_variable_name | prev_declared_fb_name | prev_declared_global_var_name + */ + prev_declared_fb_name + {$$ = new symbolic_variable_c($1, locloc(@$));} +| prev_declared_global_var_name + {$$ = new symbolic_variable_c($1, locloc(@$));} +| prev_declared_variable_name + {$$ = new symbolic_variable_c($1, locloc(@$));} +| multi_element_variable +/* +| identifier + {$$ = new symbolic_variable_c($1, locloc(@$));} +*/ +; + + +/* NOTE: in section B 1.7, when configuring a program, symbolic_variable + * is used. Nevertheless, during the parsing of a configuration, + * the variables in question are out of scope, so we should + * be allowing any_identifier instead of prev_declared_variable_name! + * + * We therefore need a new any_symbolic_variable construct that + * allows the use of any_identifier instead of previously declared + * variables, function blocks, etc... + */ +any_symbolic_variable: +// variable_name -> replaced by any_identifier + any_identifier + {$$ = new symbolic_variable_c($1, locloc(@$));} +| any_multi_element_variable +; + + +/* for yet undeclared variable names ! */ +variable_name: identifier; + + + + + +/********************************************/ +/* B.1.4.1 Directly Represented Variables */ +/********************************************/ +prev_declared_direct_variable: prev_declared_direct_variable_token {$$ = new direct_variable_c($1, locloc(@$));}; + + + + +/*************************************/ +/* B.1.4.2 Multi-element Variables */ +/*************************************/ +multi_element_variable: + array_variable +| structured_variable +; + +/* please see note above any_symbolic_variable */ +any_multi_element_variable: + any_array_variable +| any_structured_variable +; + + +array_variable: + subscripted_variable '[' subscript_list ']' + {$$ = new array_variable_c($1, $3, locloc(@$));} +; + +/* please see note above any_symbolic_variable */ +any_array_variable: + any_subscripted_variable '[' subscript_list ']' + {$$ = new array_variable_c($1, $3, locloc(@$));} +; + + +subscripted_variable: + symbolic_variable +; + + +/* please see note above any_symbolic_variable */ +any_subscripted_variable: + any_symbolic_variable +; + + +subscript_list: + subscript + {$$ = new subscript_list_c(locloc(@$)); $$->add_element($1);} +| subscript_list ',' subscript + {$$ = $1; $$->add_element($3);} +; + + +subscript: expression; + + +structured_variable: + record_variable '.' field_selector + {$$ = new structured_variable_c($1, $3, locloc(@$));} +; + + +/* please see note above any_symbolic_variable */ +any_structured_variable: + any_record_variable '.' field_selector + {$$ = new structured_variable_c($1, $3, locloc(@$));} +; + + + +record_variable: + symbolic_variable +; + + +/* please see note above any_symbolic_variable */ +any_record_variable: + any_symbolic_variable +; + + +field_selector: + any_identifier +| eno_identifier +; + + + + + + +/******************************************/ +/* B 1.4.3 - Declaration & Initialisation */ +/******************************************/ +input_declarations: + VAR_INPUT input_declaration_list END_VAR + {$$ = new input_declarations_c(NULL, $2, new explicit_definition_c(), locloc(@$));} +| VAR_INPUT RETAIN input_declaration_list END_VAR + {$$ = new input_declarations_c(new retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} +| VAR_INPUT NON_RETAIN input_declaration_list END_VAR + {$$ = new input_declarations_c(new non_retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_INPUT END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in input variable(s) declaration."); yynerrs++;} +| VAR_INPUT RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive input variable(s) declaration."); yynerrs++;} +| VAR_INPUT NON_RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive input variable(s) declaration."); yynerrs++;} +| VAR_INPUT error input_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_INPUT' in input variable(s) declaration."); yyerrok;} +| VAR_INPUT RETAIN error input_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive input variable(s) declaration."); yyerrok;} +| VAR_INPUT NON_RETAIN error input_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive input variable(s) declaration."); yyerrok;} +| VAR_INPUT input_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed input variable(s) declaration."); yyerrok;} +| VAR_INPUT RETAIN input_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive input variable(s) declaration."); yyerrok;} +| VAR_INPUT NON_RETAIN input_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive input variable(s) declaration."); yyerrok;} +| VAR_INPUT error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in input variable(s) declaration."); yyerrok;} +| VAR_INPUT RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive input variable(s) declaration."); yyerrok;} +| VAR_INPUT NON_RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non-retentive input variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for input_declarations */ +input_declaration_list: + input_declaration ';' + {$$ = new input_declaration_list_c(locloc(@$)); $$->add_element($1);} +| input_declaration_list input_declaration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new input_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid input variable(s) declaration."); yyerrok;} +| input_declaration error + {$$ = new input_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of input variable(s) declaration."); yyerrok;} +| input_declaration_list input_declaration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of input variable(s) declaration."); yyerrok;} +| input_declaration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid input variable(s) declaration."); yyerrok;} +| input_declaration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after input variable(s) declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: The formal definition of 'input_declaration' as defined in the standard is erroneous, + * as it does not allow a user defined 'EN' input parameter. However, + * The semantic description of the languages clearly states that this is allowed. + * We have added the 'en_param_declaration' clause to cover for this. + */ +input_declaration: + var_init_decl +| edge_declaration +| en_param_declaration +; + + +edge_declaration: + var1_list ':' BOOL R_EDGE + {$$ = new edge_declaration_c(new raising_edge_option_c(locloc(@3)), $1, locloc(@$));} +| var1_list ':' BOOL F_EDGE + {$$ = new edge_declaration_c(new falling_edge_option_c(locloc(@3)), $1, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list BOOL R_EDGE + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in edge declaration."); yynerrs++;} +| var1_list BOOL F_EDGE + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in edge declaration."); yynerrs++;} +| var1_list ':' BOOL R_EDGE F_EDGE + {$$ = NULL; print_err_msg(locl(@5), locf(@5), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration."); yynerrs++;} +| var1_list ':' BOOL F_EDGE R_EDGE + {$$ = NULL; print_err_msg(locl(@5), locf(@5), "'R_EDGE' and 'F_EDGE' can't be present at the same time in edge declaration."); yynerrs++;} +| var1_list ':' R_EDGE + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in edge declaration."); yynerrs++;} +| var1_list ':' F_EDGE + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in edge declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: The formal definition of the standard is erroneous, as it simply does not + * consider the EN and ENO keywords! + * The semantic description of the languages clearly states that these may be + * used in several ways. One of them is to declare an EN input parameter. + * We have added the 'en_param_declaration' clause to cover for this. + * + * Please read the comment above the definition of 'variable' in section B1.4 for details. + */ +en_param_declaration: + en_identifier ':' BOOL ASSIGN boolean_literal + {$$ = new en_param_declaration_c($1, new bool_type_name_c(locloc(@$)), $5, new explicit_definition_c(), locloc(@$));} +| en_identifier ':' BOOL ASSIGN integer + {$$ = new en_param_declaration_c($1, new bool_type_name_c(locloc(@$)), $5, new explicit_definition_c(), locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| en_identifier BOOL ASSIGN boolean_literal + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in EN declaration."); yynerrs++;} +| en_identifier BOOL ASSIGN integer + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in EN declaration."); yynerrs++;} +| en_identifier ':' ASSIGN boolean_literal + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in EN declaration."); yynerrs++;} +| en_identifier ':' ASSIGN integer + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'BOOL' missing in EN declaration."); yynerrs++;} +| en_identifier ':' BOOL ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in EN declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in EN declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +var_init_decl: + var1_init_decl +| array_var_init_decl +| structured_var_init_decl +| fb_name_decl +| string_var_declaration +; + + + + +var1_init_decl: + var1_list ':' simple_spec_init + {$$ = new var1_init_decl_c($1, $3, locloc(@$));} +| var1_list ':' subrange_spec_init + {$$ = new var1_init_decl_c($1, $3, locloc(@$));} +| var1_list ':' enumerated_spec_init + {$$ = new var1_init_decl_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list simple_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and simple specification."); yynerrs++;} +| var1_list subrange_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and subrange specification."); yynerrs++;} +| var1_list enumerated_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and enumerated specification."); yynerrs++;} +| var1_list ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +/* NOTE: + * The syntax + * variable_name DOTDOT + * is an extension to the standard!!! + * + * In order to be able to handle extensible standard functions + * (i.e. standard functions that may have a variable number of + * input parameters, such as AND(word#33, word#44, word#55, word#66), + * we have extended the acceptable syntax to allow var_name '..' + * in an input variable declaration. + * + * This allows us to parse the declaration of standard + * extensible functions and load their interface definition + * into the abstract syntax tree just like we do to other + * user defined functions. + * This has the advantage that we can later do semantic + * checking of calls to functions (be it a standard or user defined + * function) in (almost) exactly the same way. + * + * Of course, we have a flag that disables this syntax when parsing user + * written code, so we only allow this extra syntax while parsing the + * 'header' file that declares all the standard IEC 61131-3 functions. + */ +var1_list: + variable_name + {$$ = new var1_list_c(locloc(@$)); $$->add_element($1); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| variable_name integer DOTDOT + {$$ = new var1_list_c(locloc(@$)); $$->add_element(new extensible_input_parameter_c($1, $2, locloc(@$))); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + if (!allow_extensible_function_parameters) print_err_msg(locf(@1), locl(@2), "invalid syntax in variable name declaration."); + } + | var1_list ',' variable_name + {$$ = $1; $$->add_element($3); + variable_name_symtable.insert($3, prev_declared_variable_name_token); + } + | var1_list ',' variable_name integer DOTDOT + {$$ = $1; $$->add_element(new extensible_input_parameter_c($3, $4, locloc(@$))); + variable_name_symtable.insert($3, prev_declared_variable_name_token); + if (!allow_extensible_function_parameters) print_err_msg(locf(@1), locl(@2), "invalid syntax in variable name declaration."); + } +/* ERROR_CHECK_BEGIN */ +| var1_list variable_name + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in variable list."); yynerrs++;} +| var1_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable name defined in variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid variable name in variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +array_var_init_decl: + var1_list ':' array_spec_init + {$$ = new array_var_init_decl_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list array_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and array specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +structured_var_init_decl: + var1_list ':' initialized_structure + {$$ = new structured_var_init_decl_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list initialized_structure + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and structured specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: see notes above fb_name_list and var1_list + * for reason why ':' was removed from this rule! + * In essence, to remove a shift/reduce conflict, + * the ':' was moved to var1_list and fb_name_list! + */ +fb_name_decl: +/* fb_name_list ':' function_block_type_name */ + fb_name_list_with_colon function_block_type_name + {$$ = new fb_name_decl_c($1, $2, NULL, locloc(@$));} +/*| fb_name_list ':' function_block_type_name ASSIGN structure_initialization */ +| fb_name_list_with_colon function_block_type_name ASSIGN structure_initialization + {$$ = new fb_name_decl_c($1, $2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| fb_name_list_with_colon ASSIGN structure_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block type name defined in function block declaration with initialization."); yynerrs++;} +| fb_name_list_with_colon function_block_type_name structure_initialization + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing in function block declaration with initialization."); yynerrs++;} +| fb_name_list_with_colon function_block_type_name ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no initialization defined in function block declaration.");} + else {print_err_msg(locf(@4), locl(@4), "invalid initialization in function block declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +/* NOTE: In order to remove a reduce/reduce conflict between + * var1_list and fb_name_list, which are identical to each + * other, fb_name_list has been redefined to be a var1_list. + * + * In order to remove a further shift/reduce conflict, var1_list + * is imediately transfomred into var1_list_with_colon + * (i.e. it includes the ':' following the list), which + * means that fb_name_list is built from a + * var1_list_with_colon after all! + */ +/* +fb_name_list: + (* fb_name *) + identifier + {$$ = new fb_name_list_c($1); + variable_name_symtable.insert($1, prev_declared_fb_name_token); + } +(* | fb_name_list ',' fb_name *) +| fb_name_list ',' identifier + {$$ = $1; $$->add_element($3); + variable_name_symtable.insert($3, prev_declared_fb_name_token); + } +; +*/ + +fb_name_list_with_colon: + var1_list_with_colon + {$$ = new fb_name_list_c(locloc(@$)); + /* fill up the new fb_name_list_c object with the references + * contained in the var1_list_c object. + */ + FOR_EACH_ELEMENT(elem, $1, {$$->add_element(elem);}); + delete $1; + /* change the tokens associated with the symbols stored in + * the variable name symbol table from prev_declared_variable_name_token + * to prev_declared_fb_name_token + */ + FOR_EACH_ELEMENT(elem, $$, {variable_name_symtable.set(elem, prev_declared_fb_name_token);}); + } +; + +/* helper symbol for fb_name_list_with_colon */ +var1_list_with_colon: + var1_list ':' +; + + +// fb_name: identifier; + + + +output_declarations: + VAR_OUTPUT var_output_init_decl_list END_VAR + {$$ = new output_declarations_c(NULL, $2, new explicit_definition_c(), locloc(@$));} +| VAR_OUTPUT RETAIN var_output_init_decl_list END_VAR + {$$ = new output_declarations_c(new retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} +| VAR_OUTPUT NON_RETAIN var_output_init_decl_list END_VAR + {$$ = new output_declarations_c(new non_retain_option_c(locloc(@2)), $3, new explicit_definition_c(), locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_OUTPUT END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in output variable(s) declaration."); yynerrs++;} +| VAR_OUTPUT RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive output variable(s) declaration."); yynerrs++;} +| VAR_OUTPUT NON_RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive output variable(s) declaration."); yynerrs++;} +| VAR_OUTPUT error var_output_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_OUPUT' in output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT RETAIN error var_output_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT NON_RETAIN error var_output_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT var_output_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT RETAIN var_output_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT NON_RETAIN var_output_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive output variable(s) declaration."); yyerrok;} +| VAR_OUTPUT NON_RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non-retentive output variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: The formal definition of 'var_output_init_decl' as defined in the standard is erroneous, + * as it does not allow a user defined 'ENO' output parameter. However, + * The semantic description of the languages clearly states that this is allowed. + * We have added the 'eno_param_declaration' clause to cover for this. + * + * Please read the comment above the definition of 'variable' in section B1.4 for details. + */ +var_output_init_decl: + var_init_decl +| eno_param_declaration +; + +var_output_init_decl_list: + var_output_init_decl ';' + {$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);} +| var_output_init_decl_list var_output_init_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| var_output_init_decl_list var_output_init_decl error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;} +| var_output_init_decl_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: The formal definition of the standard is erroneous, as it simply does not + * consider the EN and ENO keywords! + * The semantic description of the languages clearly states that these may be + * used in several ways. One of them is to declare an ENO output parameter. + * We have added the 'eno_param_declaration' clause to cover for this. + * + * Please read the comment above the definition of 'variable' in section B1.4 for details. + */ +eno_param_declaration: + eno_identifier ':' BOOL + /* NOTE We do _NOT_ include this variable in the previously_declared_variable symbol table! + * Please read the comment above the definition of 'variable' for the reason for this. + */ + {$$ = new eno_param_declaration_c($1, new bool_type_name_c(locloc(@$)), new explicit_definition_c(), locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| eno_identifier BOOL + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and specification in ENO declaration."); yynerrs++;} +| eno_identifier ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in ENO declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in ENO declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +input_output_declarations: + VAR_IN_OUT var_declaration_list END_VAR + {$$ = new input_output_declarations_c($2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_IN_OUT END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in in_out variable(s) declaration."); yynerrs++;} +| VAR_IN_OUT error var_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_IN_OUT' in in_out variable(s) declaration."); yyerrok;} +| VAR_IN_OUT var_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed in_out variable(s) declaration."); yyerrok;} +| VAR_IN_OUT error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in in_out variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +/* helper symbol for input_output_declarations */ +var_declaration_list: + var_declaration ';' + {$$ = new var_declaration_list_c(locloc(@$)); $$->add_element($1);} +| var_declaration_list var_declaration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new var_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid variable(s) declaration."); yyerrok;} +| var_declaration error + {$$ = new var_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of variable(s) declaration."); yyerrok;} +| var_declaration_list var_declaration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;} +| var_declaration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;} +| var_declaration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after variable(s) declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +var_declaration: + temp_var_decl +| fb_name_decl +; + + +temp_var_decl: + var1_declaration +| array_var_declaration +| structured_var_declaration +| string_var_declaration +; + +var1_declaration: + var1_list ':' simple_specification + {$$ = new var1_init_decl_c($1, $3, locloc(@$));} +| var1_list ':' subrange_specification + {$$ = new var1_init_decl_c($1, $3, locloc(@$));} +| var1_list ':' enumerated_specification + {$$ = new var1_init_decl_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list simple_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and simple specification."); yynerrs++;} +| var1_list subrange_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and subrange specification."); yynerrs++;} +| var1_list enumerated_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and enumerated specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + + +array_var_declaration: + var1_list ':' array_specification + {$$ = new array_var_declaration_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list array_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and array specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +structured_var_declaration: + var1_list ':' prev_declared_structure_type_name + {$$ = new structured_var_declaration_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list prev_declared_structure_type_name + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and structured specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +var_declarations: + VAR var_init_decl_list END_VAR + {$$ = new var_declarations_c(NULL, $2, locloc(@$));} +| VAR CONSTANT var_init_decl_list END_VAR + {$$ = new var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in variable(s) declaration."); yynerrs++;} +| VAR CONSTANT END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant variable(s) declaration."); yynerrs++;} +| VAR error var_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@3), "unexpected token after 'VAR' in variable(s) declaration."); yyerrok;} +| VAR CONSTANT error var_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant variable(s) declaration."); yyerrok;} +| VAR var_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed variable(s) declaration."); yyerrok;} +| VAR CONSTANT var_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant variable(s) declaration."); yyerrok;} +| VAR error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in variable(s) declaration."); yyerrok;} +| VAR CONSTANT error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +retentive_var_declarations: + VAR RETAIN var_init_decl_list END_VAR + {$$ = new retentive_var_declarations_c($3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive variable(s) declaration."); yynerrs++;} +| VAR RETAIN error var_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive variable(s) declaration."); yyerrok;} +| VAR RETAIN var_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive variable(s) declaration."); yyerrok;} +| VAR RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in retentive variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +located_var_declarations: + VAR located_var_decl_list END_VAR + {$$ = new located_var_declarations_c(NULL, $2, locloc(@$));} +| VAR CONSTANT located_var_decl_list END_VAR + {$$ = new located_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} +| VAR RETAIN located_var_decl_list END_VAR + {$$ = new located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} +| VAR NON_RETAIN located_var_decl_list END_VAR + {$$ = new located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR NON_RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in non-retentive located variable(s) declaration."); yynerrs++;} +| VAR error located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in located variable(s) declaration."); yyerrok;} +| VAR CONSTANT error located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant located variable(s) declaration."); yyerrok;} +| VAR RETAIN error located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); yyerrok;} +| VAR NON_RETAIN error located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); yyerrok;} +| VAR located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed located variable(s) declaration."); yyerrok;} +| VAR CONSTANT located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant located variable(s) declaration."); yyerrok;} +| VAR RETAIN located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive located variable(s) declaration."); yyerrok;} +| VAR NON_RETAIN located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed non-retentive located variable(s) declaration."); yyerrok;} +| VAR NON_RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in non retentive variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for located_var_declarations */ +located_var_decl_list: + located_var_decl ';' + {$$ = new located_var_decl_list_c(locloc(@$)); $$->add_element($1);} +| located_var_decl_list located_var_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new located_var_decl_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid located variable declaration."); yyerrok;} +| located_var_decl error + {$$ = new located_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of located variable declaration."); yyerrok;} +| located_var_decl_list located_var_decl error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of located variable declaration."); yyerrok;} +| located_var_decl_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid located variable declaration."); yyerrok;} +| located_var_decl_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after located variable declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +located_var_decl: + variable_name location ':' located_var_spec_init + {$$ = new located_var_decl_c($1, $2, $4, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| location ':' located_var_spec_init + {$$ = new located_var_decl_c(NULL, $1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| variable_name location located_var_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between located variable location and specification."); yynerrs++;} +| location located_var_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between located variable location and specification."); yynerrs++;} +| variable_name location ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in located variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in located variable declaration."); yyclearin;} + yyerrok; + } +| location ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in located variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in located variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + + +external_var_declarations: + VAR_EXTERNAL external_declaration_list END_VAR + {$$ = new external_var_declarations_c(NULL, $2, locloc(@$));} +| VAR_EXTERNAL CONSTANT external_declaration_list END_VAR + {$$ = new external_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_EXTERNAL END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in external variable(s) declaration."); yynerrs++;} +| VAR_EXTERNAL CONSTANT END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant external variable(s) declaration."); yynerrs++;} +| VAR_EXTERNAL error external_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_EXTERNAL' in external variable(s) declaration."); yyerrok;} +| VAR_EXTERNAL CONSTANT error external_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant external variable(s) declaration."); yyerrok;} +| VAR_EXTERNAL external_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed external variable(s) declaration."); yyerrok;} +| VAR_EXTERNAL CONSTANT external_declaration_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant external variable(s) declaration."); yyerrok;} +| VAR_EXTERNAL error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in external variable(s) declaration."); yyerrok;} +| VAR_EXTERNAL CONSTANT error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant external variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for external_var_declarations */ +external_declaration_list: + external_declaration ';' + {$$ = new external_declaration_list_c(locloc(@$)); $$->add_element($1);} +| external_declaration_list external_declaration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new external_declaration_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid external variable declaration."); yyerrok;} +| external_declaration error + {$$ = new external_declaration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of external variable declaration."); yyerrok;} +| external_declaration_list external_declaration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of external variable declaration."); yyerrok;} +| external_declaration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid external variable declaration."); yyerrok;} +| external_declaration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after external variable declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +external_declaration: + global_var_name ':' simple_specification + {$$ = new external_declaration_c($1, $3, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| global_var_name ':' subrange_specification + {$$ = new external_declaration_c($1, $3, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| global_var_name ':' enumerated_specification + {$$ = new external_declaration_c($1, $3, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| global_var_name ':' array_specification + {$$ = new external_declaration_c($1, $3, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| global_var_name ':' prev_declared_structure_type_name + {$$ = new external_declaration_c($1, $3, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_variable_name_token); + } +| global_var_name ':' function_block_type_name + {$$ = new external_declaration_c($1, $3, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_fb_name_token); + } +/* ERROR_CHECK_BEGIN */ +| global_var_name simple_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and simple specification."); yynerrs++;} +| global_var_name subrange_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and subrange specification."); yynerrs++;} +| global_var_name enumerated_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and enumerated specification."); yynerrs++;} +| global_var_name array_specification + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and array specification."); yynerrs++;} +| global_var_name prev_declared_structure_type_name + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and structured specification."); yynerrs++;} +| global_var_name function_block_type_name + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between external variable name and function block type specification."); yynerrs++;} +| global_var_name ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in external variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in external variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +global_var_name: identifier; + + +global_var_declarations: + VAR_GLOBAL global_var_decl_list END_VAR + {$$ = new global_var_declarations_c(NULL, $2, locloc(@$));} +| VAR_GLOBAL CONSTANT global_var_decl_list END_VAR + {$$ = new global_var_declarations_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} +| VAR_GLOBAL RETAIN global_var_decl_list END_VAR + {$$ = new global_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_GLOBAL END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in global variable(s) declaration."); yynerrs++;} +| VAR_GLOBAL CONSTANT END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in constant global variable(s) declaration."); yynerrs++;} +| VAR_GLOBAL RETAIN END_VAR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable declared in retentive global variable(s) declaration."); yynerrs++;} +| VAR_GLOBAL error global_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_GLOBAL' in global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL CONSTANT error global_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL RETAIN error global_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL global_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL CONSTANT global_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL RETAIN global_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed retentive global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL CONSTANT error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant global variable(s) declaration."); yyerrok;} +| VAR_GLOBAL RETAIN error END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unknown error in constant global variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for global_var_declarations */ +global_var_decl_list: + global_var_decl ';' + {$$ = new global_var_decl_list_c(locloc(@$)); $$->add_element($1);} +| global_var_decl_list global_var_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new global_var_decl_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid global variable(s) declaration."); yyerrok;} +| global_var_decl error + {$$ = new global_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of global variable(s) declaration."); yyerrok;} +| global_var_decl_list global_var_decl error + {$$ = $1; print_err_msg(locl(@1), locf(@2), "';' missing at end of global variable(s) declaration."); yyerrok;} +| global_var_decl_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid global variable(s) declaration."); yyerrok;} +| global_var_decl_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after global variable(s) declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +global_var_decl: +/* NOTE : This possibility defined in standard has no sense and generate a conflict (disabled) + global_var_spec ':' + {$$ = new global_var_decl_c($1, NULL, locloc(@$));} +*/ + global_var_spec ':' located_var_spec_init + {$$ = new global_var_decl_c($1, $3, locloc(@$));} +| global_var_spec ':' function_block_type_name + {$$ = new global_var_decl_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| global_var_list located_var_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable list and type specification."); yynerrs++;} +| global_var_name location located_var_spec_init + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable specification and type specification."); yynerrs++;} +| global_var_spec function_block_type_name + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between global variable specification and function block type specification."); yynerrs++;} +| global_var_spec ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in global variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in global variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +global_var_spec: + global_var_list {$$ = $1;} +| location + {$$ = new global_var_spec_c(NULL, $1, locloc(@$));} +| global_var_name location + {$$ = new global_var_spec_c($1, $2, locloc(@$)); + variable_name_symtable.insert($1, prev_declared_global_var_name_token); + } +; + + +located_var_spec_init: + simple_spec_init +| subrange_spec_init +| enumerated_spec_init +| array_spec_init +| initialized_structure +| single_byte_string_spec +| double_byte_string_spec +; + + +location: + AT direct_variable_token + {$$ = new location_c(new direct_variable_c($2, locloc(@$)), locloc(@$)); + direct_variable_symtable.insert($2, prev_declared_direct_variable_token); + } +/* ERROR_CHECK_BEGIN */ +| AT error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no location defined in location declaration.");} + else {print_err_msg(locf(@2), locl(@2), "invalid location in global location declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +global_var_list: + global_var_name + {$$ = new global_var_list_c(locloc(@$)); $$->add_element($1); + variable_name_symtable.insert($1, prev_declared_global_var_name_token); + } +| global_var_list ',' global_var_name + {$$ = $1; $$->add_element($3); + variable_name_symtable.insert($3, prev_declared_global_var_name_token); + } +/* ERROR_CHECK_BEGIN */ +| global_var_list global_var_name + {$$ = new global_var_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing in global variable list."); yynerrs++;} +| global_var_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable name defined in global variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid variable name in global variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +string_var_declaration: + single_byte_string_var_declaration +| double_byte_string_var_declaration +; + +single_byte_string_var_declaration: + var1_list ':' single_byte_string_spec + {$$ = new single_byte_string_var_declaration_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list single_byte_string_spec + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and string type specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +/* NOTE: The constructs + * + * [W]STRING + * and + * [W]STRING ASSIGN single_byte_character_string + * + * were removed as they are already contained + * within a other constructs. + * + * single_byte_string_spec is used in: + * - single_byte_string_var_declaration -> + * -> string_var_declaration ---> var_init_decl + * |--> temp_var_decl + * |--> var2_init_decl + * - located_var_spec_init + * + * STRING [ASSIGN string_constant] -> elementary_string_type_name -> + * -> simple_spec -> simple_specification -> simple_spec_init -> + * -> located_var_spec_init + * + * STRING [ASSIGN string_constant] -> elementary_string_type_name -> + * -> simple_spec -> simple_specification -> simple_spec_init -> + * -> var1_init_decl -> var_init_decl + * + * STRING [ASSIGN string_constant] -> elementary_string_type_name -> + * -> simple_spec -> simple_specification -> simple_spec_init -> + * -> var1_init_decl -> var2_init_decl + * + * STRING [ASSIGN string_constant] -> elementary_string_type_name -> + * -> simple_spec -> simple_specification -> + * -> var1_declaration -> temp_var_decl + */ +single_byte_string_spec: +/* STRING + {$$ = new single_byte_string_spec_c(NULL, NULL);} +*/ + STRING '[' integer ']' + {$$ = new single_byte_string_spec_c(new single_byte_limited_len_string_spec_c(new string_type_name_c(locloc(@1)), $3, locloc(@$)), NULL, locloc(@$));} +/* +| STRING ASSIGN single_byte_character_string + {$$ = new single_byte_string_spec_c($1, NULL, $3, locloc(@$));} +*/ +| STRING '[' integer ']' ASSIGN single_byte_character_string + {$$ = new single_byte_string_spec_c(new single_byte_limited_len_string_spec_c(new string_type_name_c(locloc(@1)), $3, locloc(@$)), $6, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| STRING '[' error ']' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited string type specification."); yyerrok;} +| STRING '[' error ']' ASSIGN single_byte_character_string + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited string type specification."); yyerrok;} +| STRING '[' ']' + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited string type specification."); yynerrs++;} +| STRING '[' ']' ASSIGN single_byte_character_string + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited string type specification."); yynerrs++;} +| STRING '[' integer error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "expecting ']' after length definition for limited string type specification."); yyerrok;} +| STRING '[' integer ']' single_byte_character_string + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':=' missing before limited string type initialization."); yynerrs++;} +| STRING '[' integer ']' ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@5), locf(@6), "no initial value defined in limited string type initialization.");} + else {print_err_msg(locf(@6), locl(@6), "invalid initial value in limited string type initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +double_byte_string_var_declaration: + var1_list ':' double_byte_string_spec + {$$ = new double_byte_string_var_declaration_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| var1_list double_byte_string_spec + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between variable list and double byte string type specification."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +double_byte_string_spec: +/* WSTRING + {$$ = new double_byte_string_spec_c($1, NULL, NULL, locloc(@$));} +*/ + WSTRING '[' integer ']' + {$$ = new double_byte_string_spec_c(new double_byte_limited_len_string_spec_c(new wstring_type_name_c(locloc(@1)), $3, locloc(@$)), NULL, locloc(@$));} + +/* +| WSTRING ASSIGN double_byte_character_string + {$$ = new double_byte_string_spec_c($1, NULL, $3, locloc(@$));} +*/ +| WSTRING '[' integer ']' ASSIGN double_byte_character_string + {$$ = new double_byte_string_spec_c(new double_byte_limited_len_string_spec_c(new wstring_type_name_c(locloc(@1)), $3, locloc(@$)), $6, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| WSTRING '[' error ']' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited double byte string type specification."); yyerrok;} +| WSTRING '[' error ']' ASSIGN single_byte_character_string + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid length value for limited double byte string type specification."); yyerrok;} +| WSTRING '[' ']' + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited double byte string type specification."); yynerrs++;} +| WSTRING '[' ']' ASSIGN single_byte_character_string + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "missing length value for limited double byte string type specification."); yynerrs++;} +| WSTRING '[' integer error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "expecting ']' after length definition for limited double byte string type specification."); yyerrok;} +| WSTRING '[' integer ']' single_byte_character_string + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':=' missing before limited double byte string type initialization."); yynerrs++;} +| WSTRING '[' integer ']' ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@5), locf(@6), "no initial value defined double byte in limited string type initialization.");} + else {print_err_msg(locf(@6), locl(@6), "invalid initial value in limited double byte string type initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +incompl_located_var_declarations: + VAR incompl_located_var_decl_list END_VAR + {$$ = new incompl_located_var_declarations_c(NULL, $2, locloc(@$));} +| VAR RETAIN incompl_located_var_decl_list END_VAR + {$$ = new incompl_located_var_declarations_c(new retain_option_c(locloc(@2)), $3, locloc(@$));} +| VAR NON_RETAIN incompl_located_var_decl_list END_VAR + {$$ = new incompl_located_var_declarations_c(new non_retain_option_c(locloc(@2)), $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR incompl_located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed incomplete located variable(s) declaration."); yyerrok;} +| VAR RETAIN incompl_located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed incomplete retentive located variable(s) declaration."); yyerrok;} +| VAR NON_RETAIN incompl_located_var_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed incomplete non-retentive located variable(s) declaration."); yyerrok;} +| VAR error incompl_located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in incomplete located variable(s) declaration."); yyerrok;} +| VAR RETAIN error incompl_located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive located variable(s) declaration."); yyerrok;} +| VAR NON_RETAIN error incompl_located_var_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive located variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for incompl_located_var_declarations */ +incompl_located_var_decl_list: + incompl_located_var_decl ';' + {$$ = new incompl_located_var_decl_list_c(locloc(@$)); $$->add_element($1);} +| incompl_located_var_decl_list incompl_located_var_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| incompl_located_var_decl error + {$$ = new incompl_located_var_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of incomplete located variable declaration."); yyerrok;} +| incompl_located_var_decl_list incompl_located_var_decl error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of incomplete located variable declaration."); yyerrok;} +| incompl_located_var_decl_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid incomplete located variable declaration."); yyerrok;} +| incompl_located_var_decl_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after incomplete located variable declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +incompl_located_var_decl: + variable_name incompl_location ':' var_spec + {$$ = new incompl_located_var_decl_c($1, $2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| variable_name incompl_location var_spec + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing between incomplete located variable and type specification."); yynerrs++; + } +| variable_name incompl_location ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no specification defined in incomplete located variable declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid specification in incomplete located variable declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +incompl_location: + AT incompl_location_token + {$$ = new incompl_location_c($2, locloc(@$));} +; + + +var_spec: + simple_specification +| subrange_specification +| enumerated_specification +| array_specification +| prev_declared_structure_type_name +| string_spec +; + + +/* helper symbol for var_spec */ +string_spec: +/* STRING + {$$ = new single_byte_limited_len_string_spec_c($1, NULL, locloc(@$));} +*/ + STRING '[' integer ']' + {$$ = new single_byte_limited_len_string_spec_c(new string_type_name_c(locloc(@1)), $3, locloc(@$));} +/* +| WSTRING + {$$ = new double_byte_limited_len_string_spec_c($1, NULL, locloc(@$));} +*/ +| WSTRING '[' integer ']' + {$$ = new double_byte_limited_len_string_spec_c(new wstring_type_name_c(locloc(@1)), $3, locloc(@$));} +; + + + + +/* intermediate helper symbol for: + * - non_retentive_var_decls + * - var_declarations + */ +var_init_decl_list: + var_init_decl ';' + {$$ = new var_init_decl_list_c(locloc(@$)); $$->add_element($1);} +| var_init_decl_list var_init_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| var_init_decl_list var_init_decl error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of variable(s) declaration."); yyerrok;} +| var_init_decl_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + + +/***********************/ +/* B 1.5.1 - Functions */ +/***********************/ +/* +function_name: + prev_declared_derived_function_name +| standard_function_name +; +*/ + +/* The following rules should be set such as: + * function_name: function_name_no_clashes | function_name_simpleop_clashes | function_name_expression_clashes + * function_name: function_name_no_NOT_clashes | function_name_NOT_clashes; + */ + +function_name_no_clashes: prev_declared_derived_function_name | standard_function_name_no_clashes; +function_name_simpleop_clashes: standard_function_name_simpleop_clashes; +//function_name_expression_clashes: standard_function_name_expression_clashes; + +function_name_no_NOT_clashes: prev_declared_derived_function_name | standard_function_name_no_NOT_clashes; +//function_name_NOT_clashes: standard_function_name_NOT_clashes; + + +/* NOTE: The list of standard function names + * includes the standard functions MOD(), NOT() + * + * Strangely enough, MOD and NOT are reserved keywords, + * so shouldn't be used for function names. + * + * The specification contradicts itself! + * Our workaround is to treat MOD as a token, + * but to include this token as a + * standard_function_name. + * + * The names of all other standard functions get + * preloaded into the library_element_symbol_table + * with the token value of + * standard_function_name_token + * Actually, simply for completeness, MOD is also + * loaded into the library_element_symbol_table, but + * it is irrelevant since flex will catch MOD as a + * token, before it interprets it as an identifier, + * and looks in the library_element_symbol_table to check + * whether it has been previously declared. + * + * NOTE: The same as the above also occurs with the IL + * operators NOT AND OR XOR ADD SUB MUL DIV MOD + * GT GE EQ LT LE NE. + * Note that MOD is once again in the list! + * Anyway, we give these the same treatement as + * MOD, since we are writing a parser for ST and + * IL simultaneously. If this were not the case, + * the ST parser would not need the tokens NOT AND ... + * + * NOTE: Note that 'NOT' is special, as it conflicts + * with two operators: the IL 'NOT' operator, and + * the unary operator 'NOT' in ST!! + * + * NOTE: The IL language is ambiguous, since using NOT, AND, ... + * may be interpreted as either an IL operator, or + * as a standard function call! + * I (Mario) opted to interpret it as an IL operator. + * This requires changing the syntax for IL language + * function calling, to exclude all function with + * names that clash with IL operators. I therefore + * created the constructs + * function_name_without_clashes + * standard_function_name_without_clashes + * to include all function names, except those that clash + * with IL operators. These constructs are only used + * within the IL language! + */ +/* The following rules should be set such as: + * standard_function_name: standard_function_name_no_clashes | standard_function_name_simpleop_clashes | standard_function_name_expression_clashes + * standard_function_name: standard_function_name_no_NOT_clashes | standard_function_name_NOT_clashes; + */ + +/* +standard_function_name: + standard_function_name_no_clashes +| standard_function_name_expression_clashes +| standard_function_name_NOT_clashes +//| standard_function_name_simpleop_only_clashes +; +*/ + +standard_function_name_no_NOT_clashes: + standard_function_name_no_clashes +| standard_function_name_expression_clashes +//| standard_function_name_simpleop_only_clashes +; + +standard_function_name_no_clashes: + standard_function_name_token + {$$ = new identifier_c($1, locloc(@$));} +; + + +standard_function_name_simpleop_clashes: + standard_function_name_NOT_clashes +//| standard_function_name_simpleop_only_clashes +; + +standard_function_name_NOT_clashes: + NOT + {$$ = new identifier_c(strdup("NOT"), locloc(@$));} +; + +/* Add here any other IL simple operators that collide + * with standard function names! + * Don't forget to uncomment the equivalent lines in + * - standard_function_name_simpleop_clashes + * - standard_function_name + * - standard_function_name_no_NOT_clashes + */ +/* +standard_function_name_simpleop_only_clashes: +; +*/ + +standard_function_name_expression_clashes: + AND {$$ = new identifier_c(strdup("AND"), locloc(@$));} +| OR {$$ = new identifier_c(strdup("OR"), locloc(@$));} +| XOR {$$ = new identifier_c(strdup("XOR"), locloc(@$));} +| ADD {$$ = new identifier_c(strdup("ADD"), locloc(@$));} +| SUB {$$ = new identifier_c(strdup("SUB"), locloc(@$));} +| MUL {$$ = new identifier_c(strdup("MUL"), locloc(@$));} +| DIV {$$ = new identifier_c(strdup("DIV"), locloc(@$));} +| MOD {$$ = new identifier_c(strdup("MOD"), locloc(@$));} +| GT {$$ = new identifier_c(strdup("GT"), locloc(@$));} +| GE {$$ = new identifier_c(strdup("GE"), locloc(@$));} +| EQ {$$ = new identifier_c(strdup("EQ"), locloc(@$));} +| LT {$$ = new identifier_c(strdup("LT"), locloc(@$));} +| LE {$$ = new identifier_c(strdup("LE"), locloc(@$));} +| NE {$$ = new identifier_c(strdup("NE"), locloc(@$));} +/* + AND_operator {$$ = il_operator_c_2_identifier_c($1);} +//NOTE: AND2 (corresponding to the source code string '&') does not clash +// with a standard function name, so should be commented out! +//| AND2_operator {$$ = il_operator_c_2_identifier_c($1);} +| OR_operator {$$ = il_operator_c_2_identifier_c($1);} +| XOR_operator {$$ = il_operator_c_2_identifier_c($1);} +| ADD_operator {$$ = il_operator_c_2_identifier_c($1);} +| SUB_operator {$$ = il_operator_c_2_identifier_c($1);} +| MUL_operator {$$ = il_operator_c_2_identifier_c($1);} +| DIV_operator {$$ = il_operator_c_2_identifier_c($1);} +| MOD_operator {$$ = il_operator_c_2_identifier_c($1);} +| GT_operator {$$ = il_operator_c_2_identifier_c($1);} +| GE_operator {$$ = il_operator_c_2_identifier_c($1);} +| EQ_operator {$$ = il_operator_c_2_identifier_c($1);} +| LT_operator {$$ = il_operator_c_2_identifier_c($1);} +| LE_operator {$$ = il_operator_c_2_identifier_c($1);} +| NE_operator {$$ = il_operator_c_2_identifier_c($1);} +*/ +; + + +derived_function_name: + identifier +| prev_declared_derived_function_name + {$$ = $1; + if (!allow_function_overloading) { + fprintf(stderr, "Function overloading not allowed. Invalid identifier %s\n", ((token_c *)($1))->value); + ERROR; + } + } +| AND + {$$ = new identifier_c("AND", locloc(@$)); + if (!allow_function_overloading) print_err_msg(locloc(@1), "Function overloading \"AND\" not allowed. Invalid identifier\n"); + } +| OR + {$$ = new identifier_c("OR", locloc(@$)); + if (!allow_function_overloading) print_err_msg(locloc(@1), "Function overloading \"OR\" not allowed. Invalid identifier\n"); + } +| XOR + {$$ = new identifier_c("XOR", locloc(@$)); + if (!allow_function_overloading) print_err_msg(locloc(@1), "Function overloading \"XOR\" not allowed. Invalid identifier\n"); + } +| NOT + {$$ = new identifier_c("NOT", locloc(@$)); + if (!allow_function_overloading) print_err_msg(locloc(@1), "Function overloading \"NOT\" not allowed. Invalid identifier\n"); + } +| MOD + {$$ = new identifier_c("MOD", locloc(@$)); + if (!allow_function_overloading) print_err_msg(locloc(@1), "Function overloading \"MOD\" not allowed. Invalid identifier\n"); + } +; + + +function_declaration: +/* FUNCTION derived_function_name ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ + function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION + {$$ = new function_declaration_c($1, $3, $4, $5, locloc(@$)); + add_en_eno_param_decl_c::add_to($$); /* add EN and ENO declarations, if not already there */ + variable_name_symtable.pop(); + direct_variable_symtable.pop(); + if (allow_function_overloading) { + switch (library_element_symtable.find_value($1)) { + case prev_declared_derived_function_name_token: + /* do nothing, already in map. */ + break; + case BOGUS_TOKEN_ID: + /* Not yet in map. Must insert...*/ + library_element_symtable.insert($1, prev_declared_derived_function_name_token); + break; + default: + /* Already in map but associated with something else other than a funtion name! */ + ERROR; + } + } else { + library_element_symtable.insert($1, prev_declared_derived_function_name_token); + } + } +/* | FUNCTION derived_function_name ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ +| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION + {$$ = new function_declaration_c($1, $3, $4, $5, locloc(@$)); + add_en_eno_param_decl_c::add_to($$); /* add EN and ENO declarations, if not already there */ + variable_name_symtable.pop(); + direct_variable_symtable.pop(); + if (allow_function_overloading) { + switch (library_element_symtable.find_value($1)) { + case prev_declared_derived_function_name_token: /* do nothing, already in map. */ break; + case BOGUS_TOKEN_ID: library_element_symtable.insert($1, prev_declared_derived_function_name_token); break; + default: ERROR; + } + } else { + library_element_symtable.insert($1, prev_declared_derived_function_name_token); + } + } +/* ERROR_CHECK_BEGIN */ +| function_name_declaration elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after function name in function declaration."); yynerrs++;} +| function_name_declaration derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after function name in function declaration."); yynerrs++;} +| function_name_declaration ':' io_OR_function_var_declarations_list function_body END_FUNCTION + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no return type defined in function declaration."); yynerrs++;} +| function_name_declaration ':' error io_OR_function_var_declarations_list function_body END_FUNCTION + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid return type defined in function declaration."); yyerrok;} +| function_name_declaration ':' elementary_type_name function_body END_FUNCTION + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared in function declaration."); yynerrs++;} +| function_name_declaration ':' derived_type_name function_body END_FUNCTION + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared in function declaration."); yynerrs++;} +| function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list END_FUNCTION + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no body defined in function declaration."); yynerrs++;} +| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list END_FUNCTION + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no body defined in function declaration."); yynerrs++;} +| function_name_declaration ':' elementary_type_name END_FUNCTION + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration."); yynerrs++;} +| function_name_declaration ':' derived_type_name END_FUNCTION + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no variable(s) declared and body defined in function declaration."); yynerrs++;} +| function_name_declaration ':' elementary_type_name io_OR_function_var_declarations_list function_body END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locf(@3), "unclosed function declaration."); yynerrs++;} +| function_name_declaration ':' derived_type_name io_OR_function_var_declarations_list function_body END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed function declaration."); yynerrs++;} +| function_name_declaration error END_FUNCTION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in function declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +/* helper symbol for function_declaration */ +/* NOTE: due to reduce/reduce conflicts between identifiers + * being reduced to either a variable or an enumerator value, + * we were forced to keep a symbol table of the names + * of all declared variables. Variables are no longer + * created from simple identifier_token, but from + * prev_declared_variable_name_token. + * + * BUT, in functions the function name itself may be used as + * a variable! In order to be able to parse this correctly, + * the token parser (flex) must return a prev_declared_variable_name_token + * when it comes across the function name, while parsing + * the function itself. + * We do this by inserting the function name into the variable + * symbol table, and having flex return a prev_declared_variable_name_token + * whenever it comes across it. + * When we finish parsing the function the variable name + * symbol table is cleared of all entries, and the function + * name is inserted into the library element symbol table. This + * means that from then onwards flex will return a + * derived_function_name_token whenever it comes across the + * function name. + * + * In order to insert the function name into the variable_name + * symbol table BEFORE the function body gets parsed, we + * need the parser to reduce a construct that contains the + * the function name. That is why we created this extra + * construct (function_name_declaration), i.e. to force + * the parser to reduce it, before parsing the function body! + */ +function_name_declaration: + FUNCTION derived_function_name + {$$ = $2; + /* the function name functions as a + * variable within the function itself! + * + * Remember that the variable_name_symtable + * is cleared once the end of the function + * is parsed. + */ + variable_name_symtable.insert($2, prev_declared_variable_name_token); + } +/* ERROR_CHECK_BEGIN */ +| FUNCTION error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no function name defined in function declaration.");} + else {print_err_msg(locf(@2), locl(@2), "invalid function name in function declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +/* intermediate helper symbol for function_declaration */ +io_OR_function_var_declarations_list: + io_var_declarations + {$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);} +| function_var_decls + {$$ = new var_declarations_list_c(locloc(@1));$$->add_element($1);} +| io_OR_function_var_declarations_list io_var_declarations + {$$ = $1; $$->add_element($2);} +| io_OR_function_var_declarations_list function_var_decls + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| io_OR_function_var_declarations_list retentive_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected retentive variable(s) declaration in function declaration."); yynerrs++;} +| io_OR_function_var_declarations_list located_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected located variable(s) declaration in function declaration."); yynerrs++;} +| io_OR_function_var_declarations_list external_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected external variable(s) declaration in function declaration."); yynerrs++;} +| io_OR_function_var_declarations_list global_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function declaration."); yynerrs++;} +| io_OR_function_var_declarations_list incompl_located_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected incomplete located variable(s) declaration in function declaration."); yynerrs++;} +| io_OR_function_var_declarations_list temp_var_decls + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected temporary located variable(s) declaration in function declaration."); yynerrs++;} +| io_OR_function_var_declarations_list non_retentive_var_decls + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected non-retentive variable(s) declaration in function declaration."); yynerrs++;} +/*| io_OR_function_var_declarations_list access_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function declaration."); yynerrs++;}*/ +| io_OR_function_var_declarations_list instance_specific_initializations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +io_var_declarations: + input_declarations +| output_declarations +| input_output_declarations +; + + +function_var_decls: + VAR CONSTANT var2_init_decl_list END_VAR + {$$ = new function_var_decls_c(new constant_option_c(locloc(@2)), $3, locloc(@$));} +| VAR var2_init_decl_list END_VAR + {$$ = new function_var_decls_c(NULL, $2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR error var2_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR' in function variable(s) declaration."); yyerrok;} +| VAR CONSTANT error var2_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'CONSTANT' in constant function variable(s) declaration."); yyerrok;} +| VAR var2_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed function variable(s) declaration."); yyerrok;} +| VAR CONSTANT var2_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed constant function variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* intermediate helper symbol for function_var_decls */ +var2_init_decl_list: + var2_init_decl ';' + {$$ = new var2_init_decl_list_c(locloc(@$)); $$->add_element($1);} +| var2_init_decl_list var2_init_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| var2_init_decl error + {$$ = new var2_init_decl_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of function variable(s) declaration."); yyerrok;} +| var2_init_decl_list var2_init_decl error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of function variable(s) declaration."); yyerrok;} +| var2_init_decl_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid function variable(s) declaration."); yyerrok;} +| var2_init_decl_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after function variable(s) declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +function_body: + statement_list {$$ = $1;} /* if we leave it for the default action we get a type clash! */ +| instruction_list {$$ = $1;} /* if we leave it for the default action we get a type clash! */ +/* +| ladder_diagram +| function_block_diagram +*/ +; + + +var2_init_decl: + var1_init_decl +| array_var_init_decl +| structured_var_init_decl +| string_var_declaration +; + + + +/*****************************/ +/* B 1.5.2 - Function Blocks */ +/*****************************/ +function_block_type_name: + prev_declared_derived_function_block_name +| standard_function_block_name +; + + +standard_function_block_name: standard_function_block_name_token {$$ = new identifier_c($1, locloc(@$));}; + +derived_function_block_name: identifier; + + +function_block_declaration: + FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK + {$$ = new function_block_declaration_c($2, $3, $4, locloc(@$)); + add_en_eno_param_decl_c::add_to($$); /* add EN and ENO declarations, if not already there */ + library_element_symtable.insert($2, prev_declared_derived_function_block_name_token); + /* Clear the variable_name_symtable. Since + * we have finished parsing the function block, + * the variable names are now out of scope, so + * are no longer valid! + */ + variable_name_symtable.pop(); + direct_variable_symtable.pop(); + } +/* ERROR_CHECK_BEGIN */ +| FUNCTION_BLOCK io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in function block declaration."); yynerrs++;} +| FUNCTION_BLOCK error io_OR_other_var_declarations_list function_block_body END_FUNCTION_BLOCK + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name in function block declaration."); yyerrok;} +| FUNCTION_BLOCK derived_function_block_name function_block_body END_FUNCTION_BLOCK + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared in function declaration."); yynerrs++;} +| FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list END_FUNCTION_BLOCK + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in function block declaration."); yynerrs++;} +| FUNCTION_BLOCK derived_function_block_name END_FUNCTION_BLOCK + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared and body defined in function block declaration."); yynerrs++;} +| FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations_list function_block_body END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "no variable(s) declared and body defined in function block declaration."); yynerrs++;} +| FUNCTION_BLOCK error END_FUNCTION_BLOCK + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in function block declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +/* intermediate helper symbol for function_declaration */ +/* { io_var_declarations | other_var_declarations } */ +/* + * NOTE: we re-use the var_declarations_list_c + */ +io_OR_other_var_declarations_list: + io_var_declarations + {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);} +| other_var_declarations + {$$ = new var_declarations_list_c(locloc(@$));$$->add_element($1);} +| io_OR_other_var_declarations_list io_var_declarations + {$$ = $1; $$->add_element($2);} +| io_OR_other_var_declarations_list other_var_declarations + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| io_OR_other_var_declarations_list located_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected located variable(s) declaration in function block declaration."); yynerrs++;} +| io_OR_other_var_declarations_list global_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration."); yynerrs++;} +/*| io_OR_other_var_declarations_list access_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration."); yynerrs++;}*/ +| io_OR_other_var_declarations_list instance_specific_initializations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +/* NOTE: + * The IEC specification gives the following definition: + * other_var_declarations ::= + * external_var_declarations + * | var_declarations + * | retentive_var_declarations + * | non_retentive_var_declarations + * | temp_var_decls + * | incompl_located_var_declarations + * + * Nvertheless, the symbol non_retentive_var_declarations + * is not defined in the spec. This seems to me (Mario) + * to be a typo, so non_retentive_var_declarations + * has been replaced with non_retentive_var_decls + * in the following rule! + */ +other_var_declarations: + temp_var_decls +| non_retentive_var_decls +| external_var_declarations +| var_declarations +| retentive_var_declarations +| incompl_located_var_declarations +; + + +temp_var_decls: + VAR_TEMP temp_var_decls_list END_VAR + {$$ = new temp_var_decls_c($2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_TEMP END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in temporary variable(s) declaration."); yynerrs++;} +| VAR_TEMP temp_var_decls_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "unclosed temporary variable(s) declaration."); yyerrok;} +| VAR_TEMP error temp_var_decls_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_TEMP' in function variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* intermediate helper symbol for temp_var_decls */ +temp_var_decls_list: + temp_var_decl ';' + {$$ = new temp_var_decls_list_c(locloc(@$)); $$->add_element($1);} +| temp_var_decls_list temp_var_decl ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new temp_var_decls_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid temporary variable(s) declaration."); yyerrok;} +| temp_var_decl error + {$$ = new temp_var_decls_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at end of temporary variable(s) declaration."); yyerrok;} +| temp_var_decls_list temp_var_decl error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of temporary variable(s) declaration."); yyerrok;} +| temp_var_decls_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid temporary variable(s) declaration."); yyerrok;} +| temp_var_decls_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after temporary variable(s) declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +non_retentive_var_decls: + VAR NON_RETAIN var_init_decl_list END_VAR + {$$ = new non_retentive_var_decls_c($3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR NON_RETAIN var_init_decl_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unclosed non-retentive temporary variable(s) declaration."); yyerrok;} +| VAR NON_RETAIN error var_init_decl_list END_VAR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive temporary variable(s) declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +function_block_body: + statement_list {$$ = $1;} +| instruction_list {$$ = $1;} +| sequential_function_chart {$$ = $1;} +/* +| ladder_diagram +| function_block_diagram +| +*/ +; + + + + +/**********************/ +/* B 1.5.3 - Programs */ +/**********************/ +program_type_name: identifier; + + +program_declaration: + PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM + {$$ = new program_declaration_c($2, $3, $4, locloc(@$)); + library_element_symtable.insert($2, prev_declared_program_type_name_token); + /* Clear the variable_name_symtable. Since + * we have finished parsing the program declaration, + * the variable names are now out of scope, so + * are no longer valid! + */ + variable_name_symtable.pop(); + direct_variable_symtable.pop(); + } +/* ERROR_CHECK_BEGIN */ +| PROGRAM program_var_declarations_list function_block_body END_PROGRAM + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no program name defined in program declaration.");} +| PROGRAM error program_var_declarations_list function_block_body END_PROGRAM + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program name in program declaration."); yyerrok;} +| PROGRAM program_type_name function_block_body END_PROGRAM + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared in program declaration."); yynerrs++;} +| PROGRAM program_type_name program_var_declarations_list END_PROGRAM + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no body defined in program declaration."); yynerrs++;} +| PROGRAM program_type_name END_PROGRAM + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no variable(s) declared and body defined in program declaration."); yynerrs++;} +| PROGRAM program_type_name program_var_declarations_list function_block_body END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed program declaration."); yynerrs++;} +| PROGRAM error END_PROGRAM + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in program declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for program_declaration */ +/* + * NOTE: we re-use the var_declarations_list_c + */ +program_var_declarations_list: + io_var_declarations + {$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);} +| other_var_declarations + {$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);} +| located_var_declarations + {$$ = new var_declarations_list_c(locloc(@$)); $$->add_element($1);} +| program_var_declarations_list io_var_declarations + {$$ = $1; $$->add_element($2);} +| program_var_declarations_list other_var_declarations + {$$ = $1; $$->add_element($2);} +| program_var_declarations_list located_var_declarations + {$$ = $1; $$->add_element($2);} +/* +| program_var_declarations_list program_access_decls + {$$ = $1; $$->add_element($2);} +*/ +/* ERROR_CHECK_BEGIN */ +| program_var_declarations_list global_var_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected global variable(s) declaration in function block declaration."); yynerrs++;} +/*| program_var_declarations_list access_declarations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected access variable(s) declaration in function block declaration."); yynerrs++;}*/ +| program_var_declarations_list instance_specific_initializations + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected instance specific initialization(s) in function block declaration."); yynerrs++; + } +/* ERROR_CHECK_END */ +; + + +/* TODO ... */ +/* +program_access_decls: + VAR_ACCESS program_access_decl_list END_VAR +; +*/ + +/* helper symbol for program_access_decls */ +/* +program_access_decl_list: + program_access_decl ';' +| program_access_decl_list program_access_decl ';' +; +*/ + +/* +program_access_decl: + access_name ':' symbolic_variable ':' non_generic_type_name +| access_name ':' symbolic_variable ':' non_generic_type_name direction +; +*/ + + + +/********************************************/ +/* B 1.6 Sequential Function Chart elements * +/********************************************/ + +sequential_function_chart: + sfc_network + {$$ = new sequential_function_chart_c(locloc(@$)); $$->add_element($1);} +| sequential_function_chart sfc_network + {$$ = $1; $$->add_element($2);} +; + +sfc_network: + initial_step + {$$ = new sfc_network_c(locloc(@$)); $$->add_element($1);} +| sfc_network step + {$$ = $1; $$->add_element($2);} +| sfc_network transition + {$$ = $1; $$->add_element($2);} +| sfc_network action + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| sfc_network error + {$$ = $1; print_err_msg(locl(@1), locf(@2), "unexpected token after SFC network in sequencial function chart."); yyerrok;} +/* ERROR_CHECK_END */ +; + +initial_step: + INITIAL_STEP step_name ':' action_association_list END_STEP +// INITIAL_STEP identifier ':' action_association_list END_STEP + {$$ = new initial_step_c($2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| INITIAL_STEP ':' action_association_list END_STEP + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "no step name defined in initial step declaration."); yynerrs++;} +| INITIAL_STEP error ':' action_association_list END_STEP + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step name defined in initial step declaration."); yyerrok;} +| INITIAL_STEP step_name action_association_list END_STEP + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':' missing after step name in initial step declaration."); yynerrs++;} +| INITIAL_STEP step_name ':' error END_STEP + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid action association list in initial step declaration."); yyerrok;} +| INITIAL_STEP step_name ':' action_association_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed initial step declaration."); yynerrs++;} +| INITIAL_STEP error END_STEP + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in initial step declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +step: + STEP step_name ':' action_association_list END_STEP +// STEP identifier ':' action_association_list END_STEP + {$$ = new step_c($2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| STEP ':' action_association_list END_STEP + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no step name defined in step declaration."); yynerrs++;} +| STEP error ':' action_association_list END_STEP + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step name defined in step declaration."); yyerrok;} +| STEP step_name action_association_list END_STEP + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':' missing after step name in step declaration."); yynerrs++;} +| STEP step_name ':' error END_STEP + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid action association list in step declaration."); yyerrok;} +| STEP step_name ':' action_association_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "invalid action association list in step declaration."); yynerrs++;} +| STEP error END_STEP + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in step declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for: + * - initial_step + * - step + */ +action_association_list: + /* empty */ + {$$ = new action_association_list_c(locloc(@$));} +| action_association_list action_association ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| action_association_list action_association error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at end of action association declaration."); yyerrok;} +| action_association_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after action association declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +// step_name: identifier; +step_name: any_identifier; + +action_association: + action_name '(' {cmd_goto_sfc_qualifier_state();} action_qualifier {cmd_pop_state();} indicator_name_list ')' + {$$ = new action_association_c($1, $4, $6, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +/*| action_name '(' error ')' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid qualifier defined in action association."); yyerrok;}*/ +/* ERROR_CHECK_END */ +; + +/* helper symbol for action_association */ +indicator_name_list: + /* empty */ + {$$ = new indicator_name_list_c(locloc(@$));} +| indicator_name_list ',' indicator_name + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| indicator_name_list indicator_name + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing at end of action association declaration."); yynerrs++;} +| indicator_name_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no indicator defined in indicator list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid indicator in indicator list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +// action_name: identifier; +action_name: any_identifier; + +action_qualifier: + /* empty */ + {$$ = NULL;} +| qualifier + {$$ = new action_qualifier_c($1, NULL, locloc(@$));} +| timed_qualifier ',' action_time + {$$ = new action_qualifier_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| timed_qualifier action_time + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "',' missing between timed qualifier and action time in action qualifier."); yynerrs++;} +| timed_qualifier ',' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no action time defined in action qualifier.");} + else {print_err_msg(locf(@3), locl(@3), "invalid action time in action qualifier."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +qualifier: + N {$$ = new qualifier_c(strdup("N"), locloc(@$));} +| R {$$ = new qualifier_c(strdup("R"), locloc(@$));} +| S {$$ = new qualifier_c(strdup("S"), locloc(@$));} +| P {$$ = new qualifier_c(strdup("P"), locloc(@$));} +; + +timed_qualifier: + L {$$ = new timed_qualifier_c(strdup("L"), locloc(@$));} +| D {$$ = new timed_qualifier_c(strdup("D"), locloc(@$));} +| SD {$$ = new timed_qualifier_c(strdup("SD"), locloc(@$));} +| DS {$$ = new timed_qualifier_c(strdup("DS"), locloc(@$));} +| SL {$$ = new timed_qualifier_c(strdup("SL"), locloc(@$));} +; + +action_time: + duration +| variable +; + +indicator_name: variable; + +// transition_name: identifier; +transition_name: any_identifier; + + +steps: + step_name + {$$ = new steps_c($1, NULL, locloc(@$));} +| '(' step_name_list ')' + {$$ = new steps_c(NULL, $2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| '(' step_name_list error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ')' at the end of step list in transition declaration."); yyerrok;} +| '(' error ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid step list in transition declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +step_name_list: + step_name ',' step_name + {$$ = new step_name_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);} +| step_name_list ',' step_name + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| step_name_list step_name + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in step list."); yynerrs++;} +| step_name_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no step name defined in step list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid step name in step list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +/* NOTE: flex will automatically pop() out of body_state to previous state. + * We do not need to give a command from bison to return to previous flex state, + * after forcing flex to go to body_state. + */ +transition: + TRANSITION transition_priority + FROM steps TO steps + {cmd_goto_body_state();} transition_condition + END_TRANSITION + {$$ = new transition_c(NULL, $2, $4, $6, $8, locloc(@$));} +//| TRANSITION identifier FROM steps TO steps ... +| TRANSITION transition_name transition_priority + FROM steps TO steps + {cmd_goto_body_state();} transition_condition + END_TRANSITION + {$$ = new transition_c($2, $3, $5, $7, $9, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| TRANSITION error transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid transition name defined in transition declaration."); yyerrok;} +| TRANSITION transition_name error FROM steps TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid transition priority defined in transition declaration."); yyerrok;} +| TRANSITION transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no origin step(s) defined in transition declaration."); yynerrs++;} +| TRANSITION transition_name transition_priority FROM TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no origin step(s) defined in transition declaration."); yynerrs++;} +| TRANSITION transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid origin step(s) defined in transition declaration."); yyerrok;} +| TRANSITION transition_name transition_priority FROM error TO steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locf(@5), locl(@5), "invalid origin step(s) defined in transition declaration."); yyerrok;} +| TRANSITION transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); yynerrs++;} +| TRANSITION transition_name transition_priority FROM steps steps {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@5), locf(@6), "'TO' missing between origin step(s) and destination step(s) in transition declaration."); yynerrs++;} +| TRANSITION transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@5), locf(@7), "no destination step(s) defined in transition declaration."); yynerrs++;} +| TRANSITION transition_name transition_priority FROM steps TO {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@6), locf(@8), "no destination step(s) defined in transition declaration."); yynerrs++;} +| TRANSITION transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid destination step(s) defined in transition declaration."); yyerrok;} +| TRANSITION transition_name transition_priority FROM steps TO error {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locf(@7), locl(@7), "invalid destination step(s) defined in transition declaration."); yyerrok;} +| TRANSITION transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no origin and destination step(s) defined in transition declaration."); yynerrs++;} +| TRANSITION transition_name transition_priority {cmd_goto_body_state();} transition_condition END_TRANSITION + {$$ = NULL; print_err_msg(locl(@3), locf(@5), "no origin and destination step(s) defined in transition declaration."); yynerrs++;} +/*| TRANSITION transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@6), "unclosed transition declaration."); yyerrok;} +| TRANSITION transition_name transition_priority FROM steps TO steps {cmd_goto_body_state();} transition_condition error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@7), "unclosed transition declaration."); yyerrok;}*/ +| TRANSITION error END_TRANSITION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in transition declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +transition_priority: + /* empty */ + {$$ = NULL;} +| '(' {cmd_goto_sfc_priority_state();} PRIORITY {cmd_pop_state();} ASSIGN integer ')' + {$$ = $6;} +/* ERROR_CHECK_BEGIN +| '(' ASSIGN integer ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'PRIORITY' missing between '(' and ':=' in transition declaration with priority."); yynerrs++;} +| '(' error ASSIGN integer ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "expecting 'PRIORITY' between '(' and ':=' in transition declaration with priority."); yyerrok;} + ERROR_CHECK_END */ +; + + +transition_condition: + ':' eol_list simple_instr_list + {$$ = new transition_condition_c($3, NULL, locloc(@$));} +| ASSIGN expression ';' + {$$ = new transition_condition_c(NULL, $2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| eol_list simple_instr_list + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing before IL condition in transition declaration."); yynerrs++;} +| ':' eol_list error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no instructions defined in IL condition of transition declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid instructions in IL condition of transition declaration."); yyclearin;} + yyerrok; + } +| ASSIGN ';' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no expression defined in ST condition of transition declaration."); yynerrs++;} +| ASSIGN error ';' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid expression defined in ST condition of transition declaration."); yyerrok;} +| ASSIGN expression error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "expecting ';' after expression defined in ST condition of transition declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +action: +// ACTION identifier ':' ... + ACTION action_name {cmd_goto_body_state();} action_body END_ACTION + {$$ = new action_c($2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| ACTION {cmd_goto_body_state();} action_body END_ACTION + {$$ = NULL; print_err_msg(locl(@1), locf(@3), "no action name defined in action declaration."); yynerrs++;} +| ACTION error {cmd_goto_body_state();} action_body END_ACTION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid action name defined in action declaration."); yyerrok;} +| ACTION action_name {cmd_goto_body_state();} function_block_body END_ACTION + {$$ = NULL; print_err_msg(locl(@2), locf(@4), "':' missing after action name in action declaration."); yynerrs++;} +/*| ACTION action_name {cmd_goto_body_state();} action_body END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed action declaration."); yyerrok;}*/ +| ACTION error END_ACTION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in action declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +action_body: + ':' function_block_body + {$$ = $2;} +/* ERROR_CHECK_BEGIN */ +| ':' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no body defined in action declaration.");} + else {print_err_msg(locf(@2), locl(@2), "invalid body defined in action declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +/********************************/ +/* B 1.7 Configuration elements */ +/********************************/ +/* NOTE: + * It is not clear from reading the specification to which namespace + * the names of resources, tasks and programs belong to. + * + * The following syntax assumes that resource and program names belong to the + * same namespace as the variables defined within + * the resource/configuration (i.e. VAR_GLOBAL). + * Task names belong to a namespace all of their own, since they don't + * produce conflicts in the syntax parser, so we might just as well + * leave them be! ;-) + * The above decision was made taking into + * account that inside a VAR_CONFIG declaration global variables + * may be referenced starting off from the resource name as: + * resource_name.program_name.variable_name + * Notice how resource names and program names are used in a very similar + * manner as are variable names. + * Using a single namespace for all the above mentioned names + * also makes it easier to write the syntax parser!! ;-) Using a private + * namespace for each of the name types (resource names, program names, + * global varaiable names), i.e. letting the names be re-used across + * each of the groups (resource, program, global variables), produces + * reduce/reduce conflicts in the syntax parser. Actually, it is only + * the resource names that need to be distinguished into a + * prev_declared_resource_name so as not to conflict with [gloabl] variable + * names in the 'data' construct. + * The program names are only tracked to make sure that two programs do not + * get the same name. + * + * Using a single namespace does have the drawback that the user will + * not be able to re-use names for resources or programs if these + * have already been used to name a variable! + * + * If it ever becomes necessary to change this interpretation of + * the syntax, then this section of the syntax parser must be updated! + */ +prev_declared_global_var_name: prev_declared_global_var_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_resource_name: prev_declared_resource_name_token {$$ = new identifier_c($1, locloc(@$));}; +prev_declared_program_name: prev_declared_program_name_token {$$ = new identifier_c($1, locloc(@$));}; +// prev_declared_task_name: prev_declared_task_name_token {$$ = new identifier_c($1, locloc(@$));}; + + + + + + +configuration_name: identifier; + +/* NOTE: The specification states that valid resource type names + * are implementation defined, i.e. each implementaion will define + * what resource types it supports. + * We are implementing this syntax parser to be used by any + * implementation, so at the moment we accept any identifier + * as a resource type name. + * This implementation should probably be changed in the future. We + * should probably have a resource_type_name_token, and let the + * implementation load the global symbol library with the + * accepted resource type names before parsing the code. + * + */ +resource_type_name: any_identifier; + +configuration_declaration: + CONFIGURATION configuration_name + optional_global_var_declarations + single_resource_declaration + {variable_name_symtable.pop(); + direct_variable_symtable.pop();} + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = new configuration_declaration_c($2, $3, $4, $6, $7, locloc(@$)); + library_element_symtable.insert($2, prev_declared_configuration_name_token); + variable_name_symtable.pop(); + direct_variable_symtable.pop(); + } +| CONFIGURATION configuration_name + optional_global_var_declarations + resource_declaration_list + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = new configuration_declaration_c($2, $3, $4, $5, $6, locloc(@$)); + library_element_symtable.insert($2, prev_declared_configuration_name_token); + variable_name_symtable.pop(); + direct_variable_symtable.pop(); +} +/* ERROR_CHECK_BEGIN */ +| CONFIGURATION + optional_global_var_declarations + single_resource_declaration + {variable_name_symtable.pop(); + direct_variable_symtable.pop();} + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no configuration name defined in configuration declaration."); yynerrs++;} +| CONFIGURATION + optional_global_var_declarations + resource_declaration_list + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no configuration name defined in configuration declaration."); yynerrs++;} +| CONFIGURATION error + optional_global_var_declarations + single_resource_declaration + {variable_name_symtable.pop(); + direct_variable_symtable.pop();} + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid configuration name defined in configuration declaration."); yyerrok;} +| CONFIGURATION error + optional_global_var_declarations + resource_declaration_list + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid configuration name defined in configuration declaration."); yyerrok;} +| CONFIGURATION configuration_name + optional_global_var_declarations + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no resource(s) defined in configuration declaration."); yynerrs++;} +| CONFIGURATION configuration_name + optional_global_var_declarations + error + optional_access_declarations + optional_instance_specific_initializations + END_CONFIGURATION + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid resource(s) defined in configuration declaration."); yyerrok;} +/*| CONFIGURATION configuration_name + optional_global_var_declarations + single_resource_declaration + {variable_name_symtable.pop(); + direct_variable_symtable.pop();} + optional_access_declarations + optional_instance_specific_initializations + END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed configuration declaration."); yyerrok;}*/ +| CONFIGURATION configuration_name + optional_global_var_declarations + resource_declaration_list + optional_access_declarations + optional_instance_specific_initializations + END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed configuration declaration."); yyerrok;} +| CONFIGURATION error END_CONFIGURATION + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in configuration declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + +// helper symbol for +// - configuration_declaration +// - resource_declaration +// +optional_global_var_declarations: + // empty + {$$ = NULL;} +| global_var_declarations +; + + +// helper symbol for configuration_declaration // +optional_access_declarations: + // empty + {$$ = NULL;} +//| access_declarations +; + +// helper symbol for configuration_declaration // +optional_instance_specific_initializations: + // empty + {$$ = NULL;} +| instance_specific_initializations +; + +// helper symbol for configuration_declaration // +resource_declaration_list: + resource_declaration + {$$ = new resource_declaration_list_c(locloc(@$)); $$->add_element($1);} +| resource_declaration_list resource_declaration + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| resource_declaration_list error + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected token after resource declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +resource_declaration: + RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name ON resource_type_name + optional_global_var_declarations + single_resource_declaration + END_RESOURCE + {$$ = new resource_declaration_c($3, $5, $6, $7, locloc(@$)); + variable_name_symtable.pop(); + direct_variable_symtable.pop(); + variable_name_symtable.insert($3, prev_declared_resource_name_token); + } +/* ERROR_CHECK_BEGIN */ +| RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} ON resource_type_name + optional_global_var_declarations + single_resource_declaration + END_RESOURCE + {$$ = NULL; print_err_msg(locl(@1), locf(@3), "no resource name defined in resource declaration."); yynerrs++;} +/*| RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name ON resource_type_name + optional_global_var_declarations + single_resource_declaration + END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@5), "unclosed resource declaration."); yyerrok;}*/ +| RESOURCE error END_RESOURCE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in resource declaration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +single_resource_declaration: + task_configuration_list program_configuration_list + {$$ = new single_resource_declaration_c($1, $2, locloc(@$));} +; + + +// helper symbol for single_resource_declaration // +task_configuration_list: + // empty + {$$ = new task_configuration_list_c(locloc(@$));} +| task_configuration_list task_configuration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| task_configuration_list task_configuration error + {$$ = $1; print_err_msg(locl(@1), locf(@2), "';' missing at the end of task configuration in resource declaration."); yyerrok;} +| task_configuration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after task configuration in resource declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +// helper symbol for single_resource_declaration // +program_configuration_list: + program_configuration ';' + {$$ = new program_configuration_list_c(locloc(@$)); $$->add_element($1);} +| program_configuration_list program_configuration ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| program_configuration error + {$$ = new program_configuration_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of program configuration in resource declaration."); yyerrok;} +| program_configuration_list program_configuration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of program configuration in resource declaration."); yyerrok;} +| program_configuration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid program configuration in resource declaration."); yyerrok;} +| program_configuration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after program configuration in resource declaration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +resource_name: identifier; + +/* +access_declarations: + VAR_ACCESS access_declaration_list END_VAR + {$$ = NULL;} +// ERROR_CHECK_BEGIN // +| VAR_ACCESS END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in access variable(s) declaration."); yynerrs++;} +| VAR_ACCESS error access_declaration_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_ACCESS' in access variable(s) declaration."); yyerrok;} +| VAR_ACCESS access_declaration_list error END_VAR + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed access variable(s) declaration."); yyerrok;} +| VAR_ACCESS error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in access variable(s) declaration."); yyerrok;} +// ERROR_CHECK_END // +; + +// helper symbol for access_declarations // +access_declaration_list: + access_declaration ';' +| access_declaration_list access_declaration ';' +// ERROR_CHECK_BEGIN // +| error ';' + {$$ = // create a new list //; + print_err_msg(locf(@1), locl(@1), "invalid access variable declaration."); yyerrok;} +| access_declaration error + {$$ = // create a new list //; + print_err_msg(locl(@1), locf(@2), "';' missing at the end of access variable declaration."); yyerrok;} +| access_declaration_list access_declaration error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of access variable declaration."); yyerrok;} +| access_declaration_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid access variable declaration."); yyerrok;} +| access_declaration_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after access variable declaration."); yynerrs++;} +// ERROR_CHECK_END // +; + + +access_declaration: + access_name ':' access_path ':' non_generic_type_name +| access_name ':' access_path ':' non_generic_type_name direction +; + + +access_path: + prev_declared_direct_variable +| prev_declared_resource_name '.' prev_declared_direct_variable +| any_fb_name_list symbolic_variable +| prev_declared_resource_name '.' any_fb_name_list symbolic_variable +| prev_declared_program_name '.' any_fb_name_list symbolic_variable +| prev_declared_resource_name '.' prev_declared_program_name '.' any_fb_name_list symbolic_variable +; +*/ + +// helper symbol for +// - access_path +// - instance_specific_init +// +/* NOTE: The fb_name_list refers to funtion block variables + * that have been declared in a scope outside the one we are + * currently parsing, so we must accept them to be any_identifier! + * + * Beware that other locations of this syntax parser also require + * a fb_name_list. In those locations the function blocks are being declared, + * so only currently un-used identifiers (i.e. identifier) may be accepted. + * + * In order to distinguish the two, here we use any_fb_name_list, while + * in the the locations we simply use fb_name_list! + */ +any_fb_name_list: + // empty + {$$ = new any_fb_name_list_c(locloc(@$));} +//| fb_name_list fb_name '.' +| any_fb_name_list any_identifier '.' + {$$ = $1; $$->add_element($2);} +; + + + +global_var_reference: +// [resource_name '.'] global_var_name ['.' structure_element_name] // + prev_declared_global_var_name + {$$ = new global_var_reference_c(NULL, $1, NULL, locloc(@$));} +| prev_declared_global_var_name '.' structure_element_name + {$$ = new global_var_reference_c(NULL, $1, $3, locloc(@$));} +| prev_declared_resource_name '.' prev_declared_global_var_name + {$$ = new global_var_reference_c($1, $3, NULL, locloc(@$));} +| prev_declared_resource_name '.' prev_declared_global_var_name '.' structure_element_name + {$$ = new global_var_reference_c($1, $3, $5, locloc(@$));} +; + + +//access_name: identifier; + + +program_output_reference: +/* NOTE: + * program_output_reference is merely used within data_source. + * data_source is merely used within task_initialization + * task_initialization appears in a configuration declaration + * _before_ the programs are declared, so we cannot use + * prev_declared_program_name, as what might seem correct at first. + * + * The semantic checker must later check whether the identifier + * used really refers to a program declared after the task + * initialization! + */ +// prev_declared_program_name '.' symbolic_variable + program_name '.' symbolic_variable + {$$ = new program_output_reference_c($1, $3, locloc(@$));} +; + +program_name: identifier; + +/* +direction: + READ_WRITE + {$$ = NULL;} +| READ_ONLY + {$$ = NULL;} +; +*/ + +task_configuration: + TASK task_name task_initialization + {$$ = new task_configuration_c($2, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| TASK task_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no task name defined in task declaration."); yynerrs++;} +| TASK error task_initialization + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid task name defined in task declaration."); yyerrok;} +| TASK task_name error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no task initialization defined in task declaration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid task initialization in task declaration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* NOTE: The specification does not mention the namespace to which task names + * should belong to. Unlike resource and program names, for the moment we + * let the task names belong to their own private namespace, as they do not + * produce any conflicts in the syntax parser. + * If in the future our interpretation of the spec. turns out to be incorrect, + * the definition of task_name may have to be changed! + */ +task_name: any_identifier; + + +task_initialization: +// '(' [SINGLE ASSIGN data_source ','] [INTERVAL ASSIGN data_source ','] PRIORITY ASSIGN integer ')' // + '(' {cmd_goto_task_init_state();} task_initialization_single task_initialization_interval task_initialization_priority ')' + {$$ = new task_initialization_c($3, $4, $5, locloc(@$));} +; + + +task_initialization_single: +// [SINGLE ASSIGN data_source ','] + /* empty */ + {$$ = NULL;} +| SINGLE ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} + {$$ = $4;} +/* ERROR_CHECK_BEGIN */ +| SINGLE {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} + {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'SINGLE' in task initialization."); yynerrs++;} +| SINGLE ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();} + {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no data source defined in 'SINGLE' statement of task initialization."); yynerrs++;} +| SINGLE ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();} + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid data source defined in 'SINGLE' statement of task initialization."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +task_initialization_interval: +// [INTERVAL ASSIGN data_source ','] + /* empty */ + {$$ = NULL;} +| INTERVAL ASSIGN {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} + {$$ = $4;} +/* ERROR_CHECK_BEGIN */ +| INTERVAL {cmd_pop_state();} data_source ',' {cmd_goto_task_init_state();} + {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'INTERVAL' in task initialization.");} +| INTERVAL ASSIGN {cmd_pop_state();} ',' {cmd_goto_task_init_state();} + {$$ = NULL; print_err_msg(locl(@2), locf(@4), "no data source defined in 'INTERVAL' statement of task initialization."); yynerrs++;} +| INTERVAL ASSIGN {cmd_pop_state();} error ',' {cmd_goto_task_init_state();} + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid data source defined in 'INTERVAL' statement of task initialization."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +task_initialization_priority: +// PRIORITY ASSIGN integer + PRIORITY ASSIGN {cmd_pop_state();} integer + {$$ = $4;} +/* ERROR_CHECK_BEGIN */ +| PRIORITY {cmd_pop_state();} integer + {$$ = NULL; print_err_msg(locl(@1), locf(@3), "':=' missing after 'PRIORITY' in task initialization."); yynerrs++;} +| PRIORITY ASSIGN {cmd_pop_state();} error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@4), "no priority number defined in 'PRIORITY' statement of task initialization.");} + else {print_err_msg(locf(@4), locl(@4), "invalid priority number in 'PRIORITY' statement of task initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +data_source: + constant +| global_var_reference +| program_output_reference +| prev_declared_direct_variable +; + +program_configuration: +// PROGRAM [RETAIN | NON_RETAIN] program_name [WITH task_name] ':' program_type_name ['(' prog_conf_elements ')'] // + PROGRAM program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = new program_configuration_c(NULL, $2, $3, $5, $6, locloc(@$)); + variable_name_symtable.insert($2, prev_declared_program_name_token); + } +| PROGRAM RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = new program_configuration_c(new retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$)); + variable_name_symtable.insert($3, prev_declared_program_name_token); + } +| PROGRAM NON_RETAIN program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = new program_configuration_c(new non_retain_option_c(locloc(@2)), $3, $4, $6, $7, locloc(@$)); + variable_name_symtable.insert($3, prev_declared_program_name_token); + } +/* ERROR_CHECK_BEGIN */ +| PROGRAM program_name optional_task_name ':' identifier optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@5), locl(@5), "invalid program type name after ':' in program configuration."); yynerrs++;} +| PROGRAM RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid program type name after ':' in program configuration."); yynerrs++;} +| PROGRAM NON_RETAIN program_name optional_task_name ':' identifier optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid program type name after ':' in program configuration."); yynerrs++;} +| PROGRAM error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'PROGRAM' in program configuration."); yyerrok;} +| PROGRAM RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'RETAIN' in retentive program configuration."); yyerrok;} +| PROGRAM NON_RETAIN error program_name optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "unexpected token after 'NON_RETAIN' in non-retentive program configuration."); yyerrok;} +| PROGRAM optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no program name defined in program configuration."); yynerrs++;} +| PROGRAM RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no program name defined in retentive program configuration."); yynerrs++;} +| PROGRAM NON_RETAIN optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no program name defined in non-retentive program configuration."); yynerrs++;} +| PROGRAM error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program name defined in program configuration."); yyerrok;} +| PROGRAM RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid program name defined in retentive program configuration."); yyerrok;} +| PROGRAM NON_RETAIN error optional_task_name ':' prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid program name defined in non-retentive program configuration."); yyerrok;} +| PROGRAM program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "':' missing after program name or optional task name in program configuration."); yynerrs++;} +| PROGRAM RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':' missing after program name or optional task name in retentive program configuration."); yynerrs++;} +| PROGRAM NON_RETAIN program_name optional_task_name prev_declared_program_type_name optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "':' missing after program name or optional task name in non-retentive program configuration."); yynerrs++;} +| PROGRAM program_name optional_task_name ':' optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "no program type defined in program configuration."); yynerrs++;} +| PROGRAM RETAIN program_name optional_task_name ':' optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no program type defined in retentive program configuration."); yynerrs++;} +| PROGRAM NON_RETAIN program_name optional_task_name ':' optional_prog_conf_elements + {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no program type defined in non-retentive program configuration."); yynerrs++;} +/* ERROR_CHECK_END */ +; + +// helper symbol for program_configuration // +optional_task_name: + // empty // + {$$ = NULL;} +| WITH task_name + {$$ = $2;} +/* ERROR_CHECK_BEGIN */ +| WITH error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no task name defined in optional task name of program configuration.");} + else {print_err_msg(locf(@2), locl(@2), "invalid task name in optional task name of program configuration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +// helper symbol for program_configuration // +optional_prog_conf_elements: + // empty // + {$$ = NULL;} +| '(' prog_conf_elements ')' + {$$ = $2;} +/* ERROR_CHECK_BEGIN */ +| '(' error ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid program configuration elements in program configuration."); yyerrok;} +| '(' prog_conf_elements error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of program configuration elements in program configuration."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +prog_conf_elements: + prog_conf_element + {$$ = new prog_conf_elements_c(locloc(@$)); $$->add_element($1);} +| prog_conf_elements ',' prog_conf_element + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| prog_conf_elements prog_conf_element + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in program configuration elements list."); yynerrs++;} +| prog_conf_elements ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value defined for program configuration element in program configuration list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value for program configuration element in program configuration list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +prog_conf_element: + fb_task +| prog_cnxn +; + + +fb_task: + // fb_name WITH task_name +/* NOTE: The fb_name refers to funtion block variables + * that have been declared in a scope outside the one we are + * currently parsing, so we must accept them to be any_identifier! + */ + any_identifier WITH task_name + {$$ = new fb_task_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| any_identifier WITH error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no task name defined in function block configuration.");} + else {print_err_msg(locf(@3), locl(@3), "invalid task name in function block configuration."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +/* NOTE: + * The semantics of configuring a program are rather confusing, so here is + * my (Mario) understanding on the issue... + * + * A function/program may have as its input variables a simple variable + * (BYTE, WORD, etc...), an array (ARRAY [1 .. 3] OF BYTE, ...) , or a structure. + * Nevertheless, when calling this function from within a st or il language statement + * it is not possible to allocate a value to a single element of the array or structure + * typed input variable, as the accepted syntax is simply '(' variable_name ':=' variable ')' + * Notice how the variable_name does not include things such as 'a.elem1' or 'a[1]'! + * + * Nevertheless, when configuring a program from within a configuration, + * it becomes possible to allocate values to individual elements of the + * array or structured type input variable, as the syntax is now + * '(' symbolic_variable ':=' data_sink|prog_data_source ')' + * Notice how the symbolic_variable _does_ include things such as 'a.elem1' or 'a[1]'! + * + * Conclusion: Unlike other locations in the syntax where SENDTO appears, + * here it is not valid to replace symbolic_variable with any_identifier! + * Nevertheless, it is also not correct to leave symbolic_variable as it is, + * as we have defined it to only include previously declared variables, + * which is not the case in this situation. Here symbolic_variable is refering + * to variables that were defined within the scope of the program that is being + * called, and _not_ within the scope of the configuration that is calling the + * program, so the variables in question are not declared in the current scope! + * + * We therefore need to define a new symbolic_variable, that accepts any_identifier + * instead of previosuly declared variable names, to be used in the definition of + * prog_cnxn! + */ +prog_cnxn: + any_symbolic_variable ASSIGN prog_data_source + {$$ = new prog_cnxn_assign_c($1, $3, locloc(@$));} +| any_symbolic_variable SENDTO data_sink + {$$ = new prog_cnxn_sendto_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| any_symbolic_variable constant + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element."); yynerrs++;} +| any_symbolic_variable enumerated_value + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between parameter and value in program configuration element."); yynerrs++;} +| any_symbolic_variable data_sink + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' or '=>' missing between parameter and variable in program configuration element."); yynerrs++;} +| any_symbolic_variable ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no value or variable defined in program configuration assignment element.");} + else {print_err_msg(locf(@3), locl(@3), "invalid value or variable in program configuration assignment element."); yyclearin;} + yyerrok; + } +| any_symbolic_variable SENDTO error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no variable defined in program configuration sendto element.");} + else {print_err_msg(locf(@3), locl(@3), "invalid variable in program configuration sendto element."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +prog_data_source: + constant +| enumerated_value +| global_var_reference +| prev_declared_direct_variable +; + +data_sink: + global_var_reference +| prev_declared_direct_variable +; + +instance_specific_initializations: + VAR_CONFIG instance_specific_init_list END_VAR + {$$ = new instance_specific_initializations_c($2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| VAR_CONFIG END_VAR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no variable declared in configuration variable(s) initialization."); yynerrs++;} +| VAR_CONFIG error instance_specific_init_list END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unexpected token after 'VAR_CONFIG' in configuration variable(s) initialization."); yyerrok;} +| VAR_CONFIG instance_specific_init_list error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed configuration variable(s) initialization."); yyerrok;} +| VAR_CONFIG error END_VAR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in configuration variable(s) initialization."); yyerrok;} +/* ERROR_CHECK_END */ +; + +// helper symbol for instance_specific_initializations // +instance_specific_init_list: + instance_specific_init ';' + {$$ = new instance_specific_init_list_c(locloc(@$)); $$->add_element($1);} +| instance_specific_init_list instance_specific_init ';' + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| error ';' + {$$ = new instance_specific_init_list_c(locloc(@$)); print_err_msg(locf(@1), locl(@1), "invalid configuration variable initialization."); yyerrok;} +| instance_specific_init error + {$$ = new instance_specific_init_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of configuration variable initialization."); yyerrok;} +| instance_specific_init_list instance_specific_init error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of configuration variable initialization."); yyerrok;} +| instance_specific_init_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid configuration variable initialization."); yyerrok;} +| instance_specific_init_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after configuration variable initialization."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +instance_specific_init: +// +// resource_name '.' program_name '.' {fb_name '.'} +// ((variable_name [location] ':' located_var_spec_init) | (fb_name ':' function_block_type_name ':=' structure_initialization)) +// +// prev_declared_resource_name '.' prev_declared_program_name '.' any_fb_name_list variable_name ':' located_var_spec_init +/* NOTE: variable_name has been changed to any_identifier (and not simply identifier) because the + * variables being referenced have been declared outside the scope currently being parsed! + */ +/* NOTE: program_name has not been changed to prev_declared_program_name because the + * programs being referenced have been declared outside the scope currently being parsed! + * The programs are only kept inside the scope of the resource in which they are defined. + */ + prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier ':' located_var_spec_init + {$$ = new instance_specific_init_c($1, $3, $5, $6, NULL, $8, locloc(@$));} +| prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier location ':' located_var_spec_init + {$$ = new instance_specific_init_c($1, $3, $5, $6, $7, $9, locloc(@$));} +| prev_declared_resource_name '.' program_name '.' any_fb_name_list any_identifier ':' fb_initialization + {$5->add_element($6); $$ = new instance_specific_init_c($1, $3, $5, NULL, NULL, $8, locloc(@$));} +; + + +/* helper symbol for instance_specific_init */ +fb_initialization: + function_block_type_name ASSIGN structure_initialization + {$$ = new fb_initialization_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| function_block_type_name structure_initialization + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':=' missing between function block name and initialization in function block initialization."); yynerrs++;} +| function_block_type_name ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no initial value defined in function block initialization.");} + else {print_err_msg(locf(@3), locl(@3), "invalid initial value in function block initialization."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/***********************************/ +/* B 2.1 Instructions and Operands */ +/***********************************/ +/* helper symbol for many IL instructions, etc... */ +/* eat up any extra EOL tokens... */ + +eol_list: + EOL +| eol_list EOL +; + + + +instruction_list: + il_instruction + {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} +| any_pragma eol_list + {$$ = new instruction_list_c(locloc(@$)); $$->add_element($1);} +| instruction_list il_instruction + {$$ = $1; $$->add_element($2);} +| instruction_list any_pragma + {$$ = $1; $$->add_element($2);} +; + + + +il_instruction: + il_incomplete_instruction eol_list + {$$ = new il_instruction_c(NULL, $1, locloc(@$));} +| label ':' il_incomplete_instruction eol_list + {$$ = new il_instruction_c($1, $3, locloc(@$));} +| label ':' eol_list + {$$ = new il_instruction_c($1, NULL, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| error eol_list + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid IL instruction."); yyerrok;} +| il_incomplete_instruction error + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of IL instruction."); yyerrok;} +| error ':' il_incomplete_instruction eol_list + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid label in IL instruction."); yyerrok;} +| label il_incomplete_instruction eol_list + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after label in IL instruction."); yynerrs++;} +| label ':' error eol_list + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid IL instruction."); yyerrok;} +| label ':' il_incomplete_instruction error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "EOL missing at the end of IL instruction."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for il_instruction */ +il_incomplete_instruction: + il_simple_operation +| il_expression +| il_jump_operation +| il_fb_call +| il_formal_funct_call +| il_return_operator +; + + +label: identifier; + + + +il_simple_operation: +// (il_simple_operator [il_operand]) | (function_name [il_operand_list]) + il_simple_operator + {$$ = new il_simple_operation_c($1, NULL, locloc(@$));} +/* + * Note: Bison is getting confused with the following rule, + * i.e. it is finding conflicts where there seemingly are really none. + * The rule was therefore replaced by the equivalent following + * two rules. + */ +/* +| il_simple_operator il_operand + {$$ = new il_simple_operation_c($1, $2, locloc(@$));} +*/ +| il_simple_operator_noclash il_operand + {$$ = new il_simple_operation_c($1, $2, locloc(@$));} +| il_simple_operator_clash il_operand + {$$ = new il_simple_operation_c($1, $2, locloc(@$));} +/* NOTE: the line + * | il_simple_operator + * already contains the 'NOT' operator, as well as all the + * expression operators ('MOD', 'AND', etc...), all of which + * may also be a function name! This means that these operators/functions, + * without any operands, could be reduced to either an operator or a + * function call. + * + * I (Mario) have chosen to reduce it to an operator. + * In order to do this, we must remove from the syntax that defines + * function calls all the functions whose names clash with the IL operators. + * + * The line + * | function_name + * has been replaced with the lines + * | function_name_no_clashes + * in order to include all possible function names except + * those whose names coincide with operators !! + */ +| function_name_no_clashes + {$$ = new il_function_call_c($1, NULL, locloc(@$));} +/* NOTE: the line + * | il_simple_operator il_operand + * already contains the 'NOT', 'MOD', etc. operators, followed by a single il_operand. + * However, this same code (MOD x) may also be reduced to a function call to the MOD + * function. This means that (MOD, AND,...) could be interpret as a function name + * or as an IL operator! This would lead us to a reduce/reduce conflict! + * + * I (Mario) have chosen to reduce it to an operand, rather than a function call. + * In order to do this, we must remove from the syntax that defines + * function calls all the functions whose names clash with the IL operators. + * + * The line + * | function_name il_operand_list + * has been replaced with the line + * | function_name_no_clashes il_operand_list + * in order to include all possible function names except + * for the function names which clash with expression and simple operators. + * + * Note that: + * this alternative syntax does not cover the possibility of + * the function 'NOT', 'MOD', etc... being called with more than one il_operand, + * in which case it is always a function call, and not an IL instruction. + * We therefore need to include an extra rule where the + * function_name_expression_clashes and function_name_simpleop_clashes + * are followed by a il_operand_list with __two__ or more il_operands!! + */ +| function_name_no_clashes il_operand_list + {$$ = new il_function_call_c($1, $2, locloc(@$));} +| il_simple_operator_clash il_operand_list2 + {$$ = new il_function_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));} +; + + + +il_expression: +// il_expr_operator '(' [il_operand] EOL {EOL} [simple_instr_list] ')' +/* + * Note: Bison is getting confused with the use of il_expr_operator, + * i.e. it is finding conflicts where there seemingly are really none. + * il_expr_operator was therefore replaced by the equivalent + * il_expr_operator_noclash | il_expr_operator_clash. + */ + 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(@$));} +| 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(@$));} +| 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(@$));} +| il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')' + {$$ = 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 */ +| il_expr_operator_noclash '(' eol_list error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of IL expression."); yyerrok;} +| il_expr_operator_noclash '(' il_operand eol_list error + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;} +| il_expr_operator_noclash '(' eol_list simple_instr_list error + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;} +| il_expr_operator_noclash '(' il_operand eol_list simple_instr_list error + {$$ = NULL; print_err_msg(locl(@5), locf(@6), "')' missing at the end of IL expression."); yyerrok;} +| il_expr_operator_clash '(' il_operand eol_list error + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL expression."); yyerrok;} +| il_expr_operator_clash '(' il_operand eol_list simple_instr_list error + {$$ = NULL; print_err_msg(locl(@5), locf(@6), "')' missing at the end of IL expression."); yyerrok;} +| il_expr_operator_clash_eol_list simple_instr_list error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of IL expression."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_jump_operation: + il_jump_operator label + {$$ = new il_jump_operation_c($1, $2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| il_jump_operator error + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid label defined in IL jump operation."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_fb_call: +// il_call_operator fb_name ['(' (EOL {EOL} [il_param_list]) | [il_operand_list] ')'] + il_call_operator prev_declared_fb_name + {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} +| il_call_operator prev_declared_fb_name '(' ')' + {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} +| il_call_operator prev_declared_fb_name '(' eol_list ')' + {$$ = new il_fb_call_c($1, $2, NULL, NULL, locloc(@$));} +| il_call_operator prev_declared_fb_name '(' il_operand_list ')' + {$$ = new il_fb_call_c($1, $2, $4, NULL, locloc(@$));} +| il_call_operator prev_declared_fb_name '(' eol_list il_param_list ')' + {$$ = new il_fb_call_c($1, $2, NULL, $5, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| il_call_operator error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call.");} + else {print_err_msg(locf(@2), locl(@2), "invalid function block name in IL function block call."); yyclearin;} + yyerrok; + } +| il_call_operator '(' ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} +| il_call_operator '(' eol_list ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} +| il_call_operator '(' il_operand_list ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} +| il_call_operator '(' eol_list il_param_list ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no function block name defined in IL function block call."); yynerrs++;} +| il_call_operator error '(' ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} +| il_call_operator error '(' eol_list ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} +| il_call_operator error '(' il_operand_list ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} +| il_call_operator error '(' eol_list il_param_list ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid function block name defined in IL function block call."); yyerrok;} +| il_call_operator prev_declared_fb_name ')' + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call."); yynerrs++;} +| il_call_operator prev_declared_fb_name il_operand_list ')' + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "'(' missing after function block name defined in IL function block call."); yynerrs++;} +| il_call_operator prev_declared_fb_name '(' error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of IL function block call."); yyerrok;} +| il_call_operator prev_declared_fb_name '(' eol_list error + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL function block call."); yyerrok;} +| il_call_operator prev_declared_fb_name '(' il_operand_list error + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of IL function block call."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: Please read note above the definition of function_name_without_clashes */ +il_formal_funct_call: +// function_name '(' EOL {EOL} [il_param_list] ')' +/* function_name '(' eol_list ')' */ +/* NOTE: il_formal_funct_call is only used in the definition of + * - il_incomplete_instruction + * - il_simple_instruction + * In both of the above, il_expression also + * shows up as another option. This means that the functions whose + * names clash with expressions, followed by '(' eol_list ')', are + * already included. We must therefore leave them out in this + * definition in order to remove reduce/reduce conflicts. + * + * In summary: 'MOD' '(' eol_list ')', and all other functions whose + * names clash with expressions may be interpreted by the syntax by + * two different routes. I (Mario) chose to interpret them + * as operators, rather than as function calls! + * (AND MOD OR XOR ADD DIV EQ GT GE LT LE MUL NE SUB) + */ + function_name_no_clashes '(' eol_list ')' + {$$ = new il_formal_funct_call_c($1, NULL, locloc(@$));} +| function_name_simpleop_clashes '(' eol_list ')' + {$$ = new il_formal_funct_call_c($1, NULL, locloc(@$));} +/* | function_name '(' eol_list il_param_list ')' */ +/* For the above syntax, we no longer have two ways of interpreting the + * same syntax. The above is always a function call! + * However, some of the functions that we may be calling + * may have the same name as an IL operator. This means that + * flex will be parsing them and handing them over to bison as + * IL operator tokens, and not as function name tokens. + * (when parsing ST, flex no longer recognizes IL operators, + * so will always return the correct function name, unless that + * name also coincides with an operator used in ST -> XOR, OR, MOD, AND, NOT) + * + * We must therefore interpret the IL operators as function names! + */ +| function_name_no_clashes '(' eol_list il_param_list ')' + {$$ = new il_formal_funct_call_c($1, $4, locloc(@$));} +| function_name_simpleop_clashes '(' eol_list il_param_list ')' + {$$ = new il_formal_funct_call_c($1, $4, locloc(@$));} +/* The following line should read: + * + * | function_name_expression_clashes '(' eol_list il_param_list ')' + * + * but the function_name_expression_clashes had to be first reduced to + * an intermediary symbol in order to remove a reduce/reduce conflict. + * In essence, the syntax requires more than one look ahead token + * in order to be parsed. We resolve this by reducing a collection of + * symbols into a temporary symbol (il_expr_operator_clash_eol_list), that + * will later be replaced by the correct symbol. The correct symbol will + * now be determined by a single look ahead token, as all the common + * symbols have been reduced to the temporary symbol + * il_expr_operator_clash_eol_list ! + * + * Unfortunately, this work around results in the wrong symbol + * being created for the abstract syntax tree. + * We need to figure out which symbol was created, destroy it, + * and create the correct symbol for our case. + * This is a lot of work, so I put it in a function + * at the end of this file... il_operator_c_2_identifier_c() + */ +| il_expr_operator_clash_eol_list il_param_list ')' + {$$ = new il_formal_funct_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| function_name_no_clashes '(' eol_list error ')' + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid parameter list defined in IL formal function call."); yyerrok;} +| function_name_simpleop_clashes '(' eol_list error ')' + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid parameter list defined in IL formal function call."); yyerrok;} +| il_expr_operator_clash_eol_list error ')' + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter list defined in IL formal function call."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_expr_operator_clash_eol_list: + il_expr_operator_clash '(' eol_list + {$$ = $1;} +/* ERROR_CHECK_BEGIN */ +| il_expr_operator_clash '(' error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "EOL missing after '(' in IL instruction."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_operand: + variable +| enumerated_value +| constant +; + + +il_operand_list: + il_operand + {$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1);} +| il_operand_list2 +; + + +/* List with 2 or more il_operands */ +il_operand_list2: + il_operand ',' il_operand + {$$ = new il_operand_list_c(locloc(@$)); $$->add_element($1); $$->add_element($3);} +| il_operand_list2 ',' il_operand + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| il_operand_list2 il_operand + {$$ = $1; print_err_msg(locl(@1), locf(@2), "',' missing in IL operand list."); yynerrs++;} +| il_operand ',' error + {$$ = new il_operand_list_c(locloc(@$)); + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no operand defined in IL operand list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid operand name in IL operand list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +simple_instr_list: + il_simple_instruction + {$$ = new simple_instr_list_c(locloc(@$)); $$->add_element($1);} +| simple_instr_list il_simple_instruction + {$$ = $1; $$->add_element($2);} +; + + +il_simple_instruction: + il_simple_operation eol_list +| il_expression eol_list +| il_formal_funct_call eol_list +/* ERROR_CHECK_BEGIN */ +| il_expression error + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing after expression IL instruction."); yyerrok;} +| il_formal_funct_call error + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing after formal function call IL instruction."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* NOTE: the correct definition of il_param_list is + * il_param_list ::= {il_param_instruction} il_param_last_instruction + * + * where {...} denotes zero or many il_param_instruction's. + * + * We could do this by defining the following: + * il_param_list: il_param_instruction_list il_param_last_instruction; + * il_param_instruction_list : ** empty ** | il_param_instruction_list il_param_instruction; + * + * Unfortunately, the above leads to reduce/reduce conflicts. + * The chosen alternative (as follows) does not have any conflicts! + * il_param_list: il_param_last_instruction | il_param_instruction_list il_param_last_instruction; + * il_param_instruction_list : il_param_instruction_list | il_param_instruction_list il_param_instruction; + */ +il_param_list: + il_param_instruction_list il_param_last_instruction + {$$ = $1; $$->add_element($2);} +| il_param_last_instruction + {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} +/* ERROR_CHECK_BEGIN */ +| il_param_instruction_list error + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid parameter assignment in parameter assignment list."); yyerrok;} +| il_param_last_instruction il_param_last_instruction + {$$ = new il_param_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} +| il_param_instruction_list il_param_last_instruction il_param_last_instruction + {$$ = $1; print_err_msg(locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +/* Helper symbol for il_param_list */ +il_param_instruction_list: + il_param_instruction + {$$ = new il_param_list_c(locloc(@$)); $$->add_element($1);} +| il_param_instruction_list il_param_instruction + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| il_param_last_instruction il_param_instruction + {$$ = new il_param_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} +| il_param_instruction_list il_param_last_instruction il_param_instruction + {$$ = $1; print_err_msg(locl(@2), locf(@3), "',' missing at the end of parameter assignment in parameter assignment list."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +il_param_instruction: + il_param_assignment ',' eol_list +| il_param_out_assignment ',' eol_list +/* ERROR_CHECK_BEGIN */ +| il_param_assignment ',' error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "EOL missing at the end of parameter assignment in parameter assignment list."); yyerrok;} +| il_param_out_assignment ',' error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "EOL missing at the end of parameter out assignment in parameter assignment list."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_param_last_instruction: + il_param_assignment eol_list +| il_param_out_assignment eol_list +/* ERROR_CHECK_BEGIN */ +| il_param_assignment error + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of last parameter assignment in parameter assignment list."); yyerrok;} +| il_param_out_assignment error + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "EOL missing at the end of last parameter out assignment in parameter assignment list."); yyerrok;} +/* ERROR_CHECK_END */ + +; + + +il_param_assignment: + il_assign_operator il_operand + {$$ = new il_param_assignment_c($1, $2, NULL, locloc(@$));} +| il_assign_operator '(' eol_list simple_instr_list ')' + {$$ = new il_param_assignment_c($1, NULL, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| error il_operand + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid operator in parameter assignment."); yyerrok;} +| error '(' eol_list simple_instr_list ')' + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid operator in parameter assignment."); yyerrok;} +| il_assign_operator error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no operand defined in parameter assignment.");} + else {print_err_msg(locf(@2), locl(@2), "invalid operand in parameter assignment."); yyclearin;} + yyerrok; + } +| il_assign_operator '(' eol_list ')' + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no instruction list defined in parameter assignment."); yynerrs++;} +| il_assign_operator '(' eol_list error ')' + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid instruction list defined in parameter assignment."); yyerrok;} +| il_assign_operator '(' eol_list simple_instr_list error + {$$ = NULL; print_err_msg(locl(@4), locf(@5), "')' missing at the end of instruction list defined in parameter assignment."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_param_out_assignment: + il_assign_out_operator variable + {$$ = new il_param_out_assignment_c($1, $2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| il_assign_out_operator error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no variable defined in IL operand list.");} + else {print_err_msg(locf(@2), locl(@2), "invalid variable in IL operand list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + +/*******************/ +/* B 2.2 Operators */ +/*******************/ +sendto_identifier: sendto_identifier_token {$$ = new identifier_c($1, locloc(@$));}; + + +/* NOTE: + * The spec includes the operator 'EQ ' + * Note that EQ is followed by a space. + * I am considering this a typo, and defining the operator + * as 'EQ' + * (Mario) + */ +LD_operator: LD {$$ = new LD_operator_c(locloc(@$));}; +LDN_operator: LDN {$$ = new LDN_operator_c(locloc(@$));}; +ST_operator: ST {$$ = new ST_operator_c(locloc(@$));}; +STN_operator: STN {$$ = new STN_operator_c(locloc(@$));}; +NOT_operator: NOT {$$ = new NOT_operator_c(locloc(@$));}; +S_operator: S {$$ = new S_operator_c(locloc(@$));}; +R_operator: R {$$ = new R_operator_c(locloc(@$));}; +S1_operator: S1 {$$ = new S1_operator_c(locloc(@$));}; +R1_operator: R1 {$$ = new R1_operator_c(locloc(@$));}; +CLK_operator: CLK {$$ = new CLK_operator_c(locloc(@$));}; +CU_operator: CU {$$ = new CU_operator_c(locloc(@$));}; +CD_operator: CD {$$ = new CD_operator_c(locloc(@$));}; +PV_operator: PV {$$ = new PV_operator_c(locloc(@$));}; +IN_operator: IN {$$ = new IN_operator_c(locloc(@$));}; +PT_operator: PT {$$ = new PT_operator_c(locloc(@$));}; +AND_operator: AND {$$ = new AND_operator_c(locloc(@$));}; +AND2_operator: AND2 {$$ = new AND_operator_c(locloc(@$));}; /* '&' in the source code! */ +OR_operator: OR {$$ = new OR_operator_c(locloc(@$));}; +XOR_operator: XOR {$$ = new XOR_operator_c(locloc(@$));}; +ANDN_operator: ANDN {$$ = new ANDN_operator_c(locloc(@$));}; +ANDN2_operator: ANDN2 {$$ = new ANDN_operator_c(locloc(@$));}; /* '&N' in the source code! */ +ORN_operator: ORN {$$ = new ORN_operator_c(locloc(@$));}; +XORN_operator: XORN {$$ = new XORN_operator_c(locloc(@$));}; +ADD_operator: ADD {$$ = new ADD_operator_c(locloc(@$));}; +SUB_operator: SUB {$$ = new SUB_operator_c(locloc(@$));}; +MUL_operator: MUL {$$ = new MUL_operator_c(locloc(@$));}; +DIV_operator: DIV {$$ = new DIV_operator_c(locloc(@$));}; +MOD_operator: MOD {$$ = new MOD_operator_c(locloc(@$));}; +GT_operator: GT {$$ = new GT_operator_c(locloc(@$));}; +GE_operator: GE {$$ = new GE_operator_c(locloc(@$));}; +EQ_operator: EQ {$$ = new EQ_operator_c(locloc(@$));}; +LT_operator: LT {$$ = new LT_operator_c(locloc(@$));}; +LE_operator: LE {$$ = new LE_operator_c(locloc(@$));}; +NE_operator: NE {$$ = new NE_operator_c(locloc(@$));}; +CAL_operator: CAL {$$ = new CAL_operator_c(locloc(@$));}; +CALC_operator: CALC {$$ = new CALC_operator_c(locloc(@$));}; +CALCN_operator: CALCN {$$ = new CALCN_operator_c(locloc(@$));}; +RET_operator: RET {$$ = new RET_operator_c(locloc(@$));}; +RETC_operator: RETC {$$ = new RETC_operator_c(locloc(@$));}; +RETCN_operator: RETCN {$$ = new RETCN_operator_c(locloc(@$));}; +JMP_operator: JMP {$$ = new JMP_operator_c(locloc(@$));}; +JMPC_operator: JMPC {$$ = new JMPC_operator_c(locloc(@$));}; +JMPCN_operator: JMPCN {$$ = new JMPCN_operator_c(locloc(@$));}; + + +il_simple_operator: + il_simple_operator_clash +| il_simple_operator_noclash +; + + +il_simple_operator_noclash: + LD_operator +| LDN_operator +| ST_operator +| STN_operator +| S_operator +| R_operator +| S1_operator +| R1_operator +| CLK_operator +| CU_operator +| CD_operator +| PV_operator +| IN_operator +| PT_operator +| il_expr_operator_noclash +; + + +il_simple_operator_clash: + il_simple_operator_clash1 +| il_simple_operator_clash2 +; + +il_simple_operator_clash1: + NOT_operator +; + +il_simple_operator_clash2: + il_expr_operator_clash +; + + +/* +il_expr_operator: + il_expr_operator_noclash +| il_expr_operator_clash +; +*/ + +il_expr_operator_clash: + AND_operator +| OR_operator +| XOR_operator +| ADD_operator +| SUB_operator +| MUL_operator +| DIV_operator +| MOD_operator +| GT_operator +| GE_operator +| EQ_operator +| LT_operator +| LE_operator +| NE_operator +; + + +il_expr_operator_noclash: + ANDN_operator +| ANDN2_operator /* string '&N' in source code! */ +| AND2_operator /* string '&' in source code! */ +| ORN_operator +| XORN_operator +; + + + + +il_assign_operator: +/* variable_name ASSIGN */ + any_identifier ASSIGN + {$$ = new il_assign_operator_c($1, locloc(@$));} +| en_identifier ASSIGN + {$$ = new il_assign_operator_c($1, locloc(@$));} +| S1_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| R1_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| CLK_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| CU_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| CD_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| PV_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| IN_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +| PT_operator ASSIGN + {$$ = new il_assign_operator_c(il_operator_c_2_identifier_c($1), locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| error ASSIGN + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid parameter defined in parameter assignment."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_assign_out_operator: +/* variable_name SENDTO */ +/* any_identifier SENDTO */ + sendto_identifier SENDTO + {$$ = new il_assign_out_operator_c(NULL, $1, locloc(@$));} +/* The following is not required, as the sendto_identifier_token returned by flex will + * also include the 'ENO' identifier. + * The resulting abstract syntax tree is identical with or without this following rule, + * as both the eno_identifier and the sendto_identifier are stored as + * an identifier_c !! + * + * To understand why we must even explicitly consider the use of ENO here, + * please read the comment above the definition of 'variable' in section B1.4 for details. + */ +/* +| eno_identifier SENDTO + {$$ = new il_assign_out_operator_c(NULL, $1, locloc(@$));} +*/ +/*| NOT variable_name SENDTO */ +| NOT sendto_identifier SENDTO + {$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));} +/* The following is not required, as the sendto_identifier_token returned by flex will + * also include the 'ENO' identifier. + * The resulting abstract syntax tree is identical with or without this following rule, + * as both the eno_identifier and the sendto_identifier are stored as + * an identifier_c !! + * + * To understand why we must even explicitly consider the use of ENO here, + * please read the comment above the definition of 'variable' in section B1.4 for details. + * + * NOTE: Removing the following rule also removes a shift/reduce conflict from the parser. + * This conflict is not really an error/ambiguity in the syntax, but rather + * due to the fact that more than a single look-ahead token would be required + * to correctly parse the syntax, something that bison does not support. + * + * The shift/reduce conflict arises because bison does not know whether + * to parse the 'NOT ENO' in the following code + * LD 1 + * funct_name ( + * NOT ENO => bool_var, + * EN := TRUE + * ) + * as either a il_param_assignment (wrong!) or an il_param_out_assignment.(correct). + * The '=>' delimiter (known as SEND_TO in this iec.y file) is a dead giveaway that + * it should be parsed as an il_param_out_assignment, but still, bison gets confused! + * Bison considers the possibility of reducing the 'NOT ENO' as an NOT_operator with + * the 'ENO' operand + * (NOT_operator -> il_simple_operator -> il_simple_operation -> il_simple_instruction -> + * -> simple_instr_list -> il_param_assignment) + * instead of reducing it to an il_param_out_operator. + * ( il_param_out_operator -> il_param_out_assignment) + * + * Note that the shift/reduce conflict only manifests itself in the il_formal_funct_call, + * where both the il_param_out_assignment and il_param_assignment are used! + * + * il_param_out_assignment --+--> il_param_instruction -> il_param_instruction_list --+ + * | | + * il_param_assignment --+ | + * | + * il_formal_funct_call <- il_param_list <-+ + * + */ +/* +| NOT eno_identifier SENDTO + {$$ = new il_assign_out_operator_c(new not_paramassign_c(locloc(@1)), $2, locloc(@$));} +*/ +/* ERROR_CHECK_BEGIN */ +| error SENDTO + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid parameter defined in parameter out assignment."); yyerrok;} +| NOT SENDTO + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no parameter defined in parameter out assignment."); yynerrs++;} +| NOT error SENDTO + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter defined in parameter out assignment."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +il_call_operator: + CAL_operator +| CALC_operator +| CALCN_operator +; + + +il_return_operator: + RET_operator +| RETC_operator +| RETCN_operator +; + + +il_jump_operator: + JMP_operator +| JMPC_operator +| JMPCN_operator +; + + +/***********************/ +/* B 3.1 - Expressions */ +/***********************/ +expression: + xor_expression +| expression OR xor_expression + {$$ = new or_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| expression OR error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'OR' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'OR' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +xor_expression: + and_expression +| xor_expression XOR and_expression + {$$ = new xor_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| xor_expression XOR error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'XOR' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'XOR' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +and_expression: + comparison +| and_expression '&' comparison + {$$ = new and_expression_c($1, $3, locloc(@$));} +| and_expression AND comparison + {$$ = new and_expression_c($1, $3, locloc(@$));} +/* NOTE: The lexical parser never returns the token '&'. + * The '&' string is interpreted by the lexcial parser as the token + * AND2! + * This means that the first rule with '&' is actually not required, + * but we leave it in nevertheless just in case we later decide + * to remove the AND2 token... + */ +| and_expression AND2 comparison + {$$ = new and_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| and_expression '&' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '&' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '&' in ST expression."); yyclearin;} + yyerrok; + } +| and_expression AND error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'AND' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'AND' in ST expression."); yyclearin;} + yyerrok; + } +| and_expression AND2 error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '&' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '&' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +comparison: + equ_expression +| comparison '=' equ_expression + {$$ = new equ_expression_c($1, $3, locloc(@$));} +| comparison OPER_NE equ_expression + {$$ = new notequ_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| comparison '=' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '=' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '=' in ST expression."); yyclearin;} + yyerrok; + } +| comparison OPER_NE error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<>' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<>' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +equ_expression: + add_expression +| equ_expression '<' add_expression + {$$ = new lt_expression_c($1, $3, locloc(@$));} +| equ_expression '>' add_expression + {$$ = new gt_expression_c($1, $3, locloc(@$));} +| equ_expression OPER_LE add_expression + {$$ = new le_expression_c($1, $3, locloc(@$));} +| equ_expression OPER_GE add_expression + {$$ = new ge_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| equ_expression '<' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<' in ST expression."); yyclearin;} + yyerrok; + } +| equ_expression '>' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '>' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '>' in ST expression."); yyclearin;} + yyerrok; + } +| equ_expression OPER_LE error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '<=' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '<=' in ST expression."); yyclearin;} + yyerrok; + } +| equ_expression OPER_GE error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '>=' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '>=' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* Not required... +comparison_operator: '<' | '>' | '>=' '<=' +*/ + +add_expression: + term +| add_expression '+' term + {$$ = new add_expression_c($1, $3, locloc(@$));} +| add_expression '-' term + {$$ = new sub_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| add_expression '+' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '+' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '+' in ST expression."); yyclearin;} + yyerrok; + } +| add_expression '-' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '-' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '-' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* Not required... +add_operator: '+' | '-' +*/ + +term: + power_expression +| term '*' power_expression + {$$ = new mul_expression_c($1, $3, locloc(@$));} +| term '/' power_expression + {$$ = new div_expression_c($1, $3, locloc(@$));} +| term MOD power_expression + {$$ = new mod_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| term '*' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '*' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '*' in ST expression."); yyclearin;} + yyerrok; + } +| term '/' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '/' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '/' in ST expression."); yyclearin;} + yyerrok; + } +| term MOD error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after 'MOD' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after 'MOD' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* Not required... +multiply_operator: '*' | '/' | 'MOD' +*/ + +power_expression: + unary_expression +| power_expression OPER_EXP unary_expression + {$$ = new power_expression_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| power_expression OPER_EXP error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after '**' in ST expression.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after '**' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +unary_expression: + non_negative_primary_expression +| '-' non_negative_primary_expression + {$$ = new neg_expression_c($2, locloc(@$));} +| NOT primary_expression + {$$ = new not_expression_c($2, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| '-' error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no expression defined after '-' in ST expression.");} + else {print_err_msg(locf(@2), locl(@2), "invalid expression after '-' in ST expression."); yyclearin;} + yyerrok; + } +| NOT error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@1), locf(@2), "no expression defined after 'NOT' in ST expression.");} + else {print_err_msg(locf(@2), locl(@2), "invalid expression after 'NOT' in ST expression."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* Not required... +unary_operator: '-' | 'NOT' +*/ + + +/* NOTE: using constant as a possible symbol for primary_expression + * leads to a reduce/reduce conflict. + * + * The text '-9' may be parsed as either a + * expression<-primary_expression<-constant<-signed_integer + * (i.e. the constant 9 negative) + * OR + * expression<-unary_expression<-constant<-integer + * (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 + * (i.e. as a parameter to the unary negation operator) + */ +/* NOTE: We use enumerated_value_without_identifier instead of enumerated_value + * in order to remove a reduce/reduce conflict between reducing an + * identifier to a variable or an enumerated_value. + * + * This change follows the IEC specification. The specification seems to + * imply (by introducing syntax that allows to unambiguosly reference an + * enumerated value - enum_type#enum_value) that in case the same identifier is used + * for a variable and an enumerated value, then the variable shall be + * considered. + */ +non_negative_primary_expression: + non_negative_constant +//| enumerated_value_without_identifier +| enumerated_value +| variable +| '(' expression ')' + {$$ = $2;} +| function_invocation +/* ERROR_CHECK_BEGIN */ +| '(' expression error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of expression in ST expression."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +primary_expression: + constant +//| enumerated_value_without_identifier +| enumerated_value +| variable +| '(' expression ')' + {$$ = $2;} +| function_invocation +/* ERROR_CHECK_BEGIN */ +| '(' expression error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing at the end of expression in ST expression."); yyerrok;} +/* ERROR_CHECK_END */ +; + + + +/* intermediate helper symbol for primary_expression */ +/* NOTE: function_name includes the standard function name 'NOT' ! + * This introduces a reduce/reduce conflict, as NOT(var) + * may be parsed as either a function_invocation, or a + * unary_expression. + * + * I (Mario) have opted to remove the possible reduction + * to function invocation, which means replacing the rule + * function_name '(' param_assignment_list ')' + * with + * function_name_no_NOT_clashes '(' param_assignment_list ')' + * + * Notice how the new rule does not include the situation where + * the function NOT is called with more than one parameter, which + * the original rule does include! Callinf the NOT function with more + * than one argument is probably a semantic error anyway, so it + * doesn't make much sense to take it into account. + * + * Nevertheless, if we were to to it entirely correctly, + * leaving the semantic checks for the next compiler stage, + * this syntax parser would need to include such a possibility. + * + * We will leave this out for now. No need to complicate the syntax + * more than the specification does by contradicting itself, and + * letting names clash! + */ +function_invocation: +/* function_name '(' [param_assignment_list] ')' */ + function_name_no_NOT_clashes '(' param_assignment_formal_list ')' + {$$ = new function_invocation_c($1, $3, NULL, locloc(@$));} +| function_name_no_NOT_clashes '(' param_assignment_nonformal_list ')' + {$$ = new function_invocation_c($1, NULL, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| function_name_no_NOT_clashes param_assignment_formal_list ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function name in ST expression."); yynerrs++;} +| function_name_no_NOT_clashes '(' ')' + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "no parameter defined in function invocation of ST expression."); yynerrs++;} +| function_name_no_NOT_clashes '(' error ')' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid parameter(s) defined in function invocation of ST expression."); yyerrok;} +| function_name_no_NOT_clashes '(' param_assignment_formal_list error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression."); yyerrok;} +| function_name_no_NOT_clashes '(' param_assignment_nonformal_list error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing at the end of function invocation in ST expression."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/********************/ +/* B 3.2 Statements */ +/********************/ +statement_list: + statement ';' + {$$ = new statement_list_c(locloc(@$)); $$->add_element($1);} +| any_pragma + {$$ = new statement_list_c(locloc(@$)); $$->add_element($1);} +| statement_list statement ';' + {$$ = $1; $$->add_element($2);} +| statement_list any_pragma + {$$ = $1; $$->add_element($2);} +/* ERROR_CHECK_BEGIN */ +| statement error + {$$ = new statement_list_c(locloc(@$)); print_err_msg(locl(@1), locf(@2), "';' missing at the end of statement in ST statement."); yyerrok;} +| statement_list statement error + {$$ = $1; print_err_msg(locl(@2), locf(@3), "';' missing at the end of statement in ST statement."); yyerrok;} +| statement_list error ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "invalid statement in ST statement."); yyerrok;} +| statement_list ';' + {$$ = $1; print_err_msg(locf(@2), locl(@2), "unexpected ';' after statement in ST statement."); yynerrs++;} +/* ERROR_CHECK_END */ +; + + +statement: + assignment_statement +| subprogram_control_statement +| selection_statement +| iteration_statement +; + + +/*********************************/ +/* B 3.2.1 Assignment Statements */ +/*********************************/ +assignment_statement: + variable ASSIGN expression + {$$ = new assignment_statement_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| error ASSIGN expression + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "invalid variable before ':=' in ST assignment statement."); yyerrok;} +| variable ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined after ':=' in ST assignment statement.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression after ':=' in ST assignment statement."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + + + +/*****************************************/ +/* B 3.2.2 Subprogram Control Statements */ +/*****************************************/ +subprogram_control_statement: + fb_invocation +| return_statement +; + +return_statement: + RETURN {$$ = new return_statement_c(locloc(@$));} +; + + + +fb_invocation: + prev_declared_fb_name '(' ')' + {$$ = new fb_invocation_c($1, NULL, NULL, locloc(@$)); } +| prev_declared_fb_name '(' param_assignment_formal_list ')' + {$$ = new fb_invocation_c($1, $3, NULL, locloc(@$));} +| prev_declared_fb_name '(' param_assignment_nonformal_list ')' + {$$ = new fb_invocation_c($1, NULL, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| prev_declared_fb_name ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function block name in ST statement."); yynerrs++;} +| prev_declared_fb_name param_assignment_formal_list ')' + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "'(' missing after function block name in ST statement."); yynerrs++;} +| prev_declared_fb_name '(' error ')' + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid parameter list in function block invocation in ST statement."); yyerrok;} +| prev_declared_fb_name '(' error + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;} +| prev_declared_fb_name '(' param_assignment_formal_list error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;} +| prev_declared_fb_name '(' param_assignment_nonformal_list error + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "')' missing after parameter list of function block invocation in ST statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for + * - fb_invocation + * - function_invocation + */ +param_assignment_formal_list: + param_assignment_formal + {$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);} +| param_assignment_formal_list ',' param_assignment_formal + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| param_assignment_formal_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no parameter assignment defined in ST parameter assignment list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + +/* helper symbol for + * - fb_invocation + * - function_invocation + */ +param_assignment_nonformal_list: + param_assignment_nonformal + {$$ = new param_assignment_list_c(locloc(@$)); $$->add_element($1);} +| param_assignment_nonformal_list ',' param_assignment_nonformal + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| param_assignment_nonformal_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no parameter assignment defined in ST parameter assignment list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid parameter assignment in ST parameter assignment list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +/* NOTE: According to the IEC 61131-3 standard, there are two possible + * syntaxes for calling function blocks within ST. + * The formal method has the form: + * fb ( invar := x, inoutvar := var1, outvar => var2); + * The non-formal method has the form: + * fb (x, var1, var2); + * In the text of IEC 61131-3 (where the semantics are defined), + * it is obvious that mixing the two syntaxes is considered incorrect. + * The following should therefore be incorrect: + * fb ( invar := x, var1, var2); + * However, according to the syntax definition, as defined in IEC 61131-3, + * mixing the formal and non-formal methods of invocation is allowed. + * We have two alternatives: + * (a) implement the syntax here in iec.y according to the standard, + * and leave it to the semantic analyser stage to find this error + * (b) or implement the syntax in iec.y correctly, not allowing + * the mixing of formal and non-formal invocation syntaxes. + * Considering that this is a syntax issue, and not semantic issue, + * I (Mario) have decided to go with alternative (a). + * In other words, in iec.y we do not follow the syntax as defined in + * Annex B of the IEC 61131-3 standard, but rather implement + * the syntax also taking into account the textual part of the standard too. + */ +/* +param_assignment: + variable_name ASSIGN expression +*/ +param_assignment_nonformal: + expression +; + + +param_assignment_formal: + any_identifier ASSIGN expression + {$$ = new input_variable_param_assignment_c($1, $3, locloc(@$));} +| en_identifier ASSIGN expression + {$$ = new input_variable_param_assignment_c($1, $3, locloc(@$));} +/*| variable_name SENDTO variable */ +/*| any_identifier SENDTO variable */ +| sendto_identifier SENDTO variable + {$$ = new output_variable_param_assignment_c(NULL, $1, $3, locloc(@$));} +/* The following is not required, as the sendto_identifier_token returned by flex will + * also include the 'ENO' identifier. + * The resulting abstract syntax tree is identical with or without this following rule, + * as both the eno_identifier and the sendto_identifier are stored as + * an identifier_c !! + * + * To understand why we must even explicitly consider the use of ENO here, + * please read the comment above the definition of 'variable' in section B1.4 for details. + */ +/* +| eno_identifier SENDTO variable + {$$ = new output_variable_param_assignment_c(NULL, $1, $3, locloc(@$));} +*/ +/*| NOT variable_name SENDTO variable */ +/*| NOT any_identifier SENDTO variable*/ +| NOT sendto_identifier SENDTO variable + {$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)), $2, $4, locloc(@$));} +/* The following is not required, as the sendto_identifier_token returned by flex will + * also include the 'ENO' identifier. + * The resulting abstract syntax tree is identical with or without this following rule, + * as both the eno_identifier and the sendto_identifier are stored as + * an identifier_c !! + * + * To understand why we must even explicitly consider the use of ENO here, + * please read the comment above the definition of 'variable' in section B1.4 for details. + */ +/* +| NOT eno_identifier SENDTO variable + {$$ = new output_variable_param_assignment_c(new not_paramassign_c(locloc(@$)), $2, $4, locloc(@$));} +*/ +/* ERROR_CHECK_BEGIN */ +| any_identifier ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter assignment.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter assignment."); yyclearin;} + yyerrok; + } +| en_identifier ASSIGN error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter assignment.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter assignment."); yyclearin;} + yyerrok; + } +| sendto_identifier SENDTO error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter out assignment.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter out assignment."); yyclearin;} + yyerrok; + } +/* +| eno_identifier SENDTO error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no expression defined in ST formal parameter out assignment.");} + else {print_err_msg(locf(@3), locl(@3), "invalid expression in ST formal parameter out assignment."); yyclearin;} + yyerrok; + } +*/ +| NOT SENDTO variable + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no parameter name defined in ST formal parameter out negated assignment."); yynerrs++;} +| NOT error SENDTO variable + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid parameter name defined in ST formal parameter out negated assignment."); yyerrok;} +| NOT sendto_identifier SENDTO error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no expression defined in ST formal parameter out negated assignment.");} + else {print_err_msg(locf(@4), locl(@4), "invalid expression in ST formal parameter out negated assignment."); yyclearin;} + yyerrok; + } +/* +| NOT eno_identifier SENDTO error + {$$ = NULL; + if (is_current_syntax_token()) {print_err_msg(locl(@3), locf(@4), "no expression defined in ST formal parameter out negated assignment.");} + else {print_err_msg(locf(@4), locl(@4), "invalid expression in ST formal parameter out negated assignment."); yyclearin;} + yyerrok; + } +*/ +/* ERROR_CHECK_END */ +; + + + + + +/********************************/ +/* B 3.2.3 Selection Statements */ +/********************************/ +selection_statement: + if_statement +| case_statement +; + + +if_statement: + IF expression THEN statement_list elseif_statement_list END_IF + {$$ = new if_statement_c($2, $4, $5, NULL, locloc(@$));} +| IF expression THEN statement_list elseif_statement_list ELSE statement_list END_IF + {$$ = new if_statement_c($2, $4, $5, $7, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| IF THEN statement_list elseif_statement_list END_IF + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'IF' statement."); yynerrs++;} +| IF THEN statement_list elseif_statement_list ELSE statement_list END_IF + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'IF' statement."); yynerrs++;} +| IF error THEN statement_list elseif_statement_list END_IF + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement."); yyerrok;} +| IF error THEN statement_list elseif_statement_list ELSE statement_list END_IF + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'IF' statement."); yyerrok;} +| IF expression error statement_list elseif_statement_list END_IF + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement."); yyerrok;} +| IF expression error statement_list elseif_statement_list ELSE statement_list END_IF + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in ST 'IF' statement."); yyerrok;} +| IF expression THEN elseif_statement_list END_IF + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement."); yynerrs++;} +| IF expression THEN elseif_statement_list ELSE statement_list END_IF + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement defined after 'THEN' in ST 'IF' statement."); yynerrs++;} +| IF expression THEN statement_list elseif_statement_list ELSE END_IF + {$$ = NULL; print_err_msg(locl(@6), locf(@7), "no statement defined after 'ELSE' in ST 'IF' statement."); yynerrs++;} +| IF expression THEN statement_list elseif_statement_list ELSE error END_IF + {$$ = NULL; print_err_msg(locf(@7), locl(@7), "invalid statement defined after 'ELSE' in ST 'IF' statement."); yynerrs++; yyerrok;} +| IF expression error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed 'IF' statement in ST."); yyerrok;} +| IF expression THEN statement_list elseif_statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'IF' statement in ST."); yynerrs++;} +| IF expression THEN statement_list elseif_statement_list ELSE statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'IF' statement in ST."); yynerrs++;} +| IF error END_IF + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'IF' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* helper symbol for if_statement */ +elseif_statement_list: + /* empty */ + {$$ = new elseif_statement_list_c(locloc(@$));} +| elseif_statement_list elseif_statement + {$$ = $1; $$->add_element($2);} +; + +/* helper symbol for elseif_statement_list */ +elseif_statement: + ELSIF expression THEN statement_list + {$$ = new elseif_statement_c($2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| ELSIF THEN statement_list + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined for 'ELSEIF' statement in ST 'IF' statement."); yynerrs++;} +| ELSIF error THEN statement_list + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for 'ELSEIF' statement in ST 'IF' statement."); yyerrok;} +| ELSIF expression error statement_list + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'THEN' after test expression in 'ELSEIF' statement of ST 'IF' statement."); yyerrok;} +| ELSIF expression THEN error + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid statement list in 'ELSEIF' statement of ST 'IF' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +case_statement: + CASE expression OF case_element_list END_CASE + {$$ = new case_statement_c($2, $4, NULL, locloc(@$));} +| CASE expression OF case_element_list ELSE statement_list END_CASE + {$$ = new case_statement_c($2, $4, $6, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| CASE OF case_element_list END_CASE + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement."); yynerrs++;} +| CASE OF case_element_list ELSE statement_list END_CASE + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'CASE' statement."); yynerrs++;} +| CASE error OF case_element_list END_CASE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement."); yyerrok;} +| CASE error OF case_element_list ELSE statement_list END_CASE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'CASE' statement."); yyerrok;} +| CASE expression error case_element_list END_CASE + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement."); yyerrok;} +| CASE expression error case_element_list ELSE statement_list END_CASE + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'OF' after test expression in ST 'CASE' statement."); yyerrok;} +| CASE expression OF END_CASE + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); yynerrs++;} +| CASE expression OF ELSE statement_list END_CASE + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no case element(s) defined after 'OF' in ST 'CASE' statement."); yynerrs++;} +| CASE expression OF error END_CASE + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); yyerrok;} +| CASE expression OF error ELSE statement_list END_CASE + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid case element(s) defined after 'OF' in ST 'CASE' statement."); yyerrok;} +| CASE expression OF case_element_list ELSE END_CASE + {$$ = NULL; print_err_msg(locl(@5), locf(@6), "no statement defined after 'ELSE' in ST 'CASE' statement."); yynerrs++;} +| CASE expression OF case_element_list ELSE error END_CASE + {$$ = NULL; print_err_msg(locf(@6), locl(@6), "invalid statement defined after 'ELSE' in ST 'CASE' statement."); yyerrok;} +| CASE expression error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@2), "unclosed 'CASE' statement in ST."); yyerrok;} +| CASE expression OF case_element_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'CASE' statement in ST."); yynerrs++;} +| CASE expression OF case_element_list ELSE statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@3), "unclosed 'CASE' statement in ST."); yynerrs++;} +| CASE error END_CASE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'CASE' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +/* helper symbol for case_statement */ +case_element_list: + case_element + {$$ = new case_element_list_c(locloc(@$)); $$->add_element($1);} +| case_element_list case_element + {$$ = $1; $$->add_element($2);} +; + + +case_element: + case_list ':' statement_list + {$$ = new case_element_c($1, $3, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| case_list statement_list + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "':' missing after case list in ST 'CASE' statement."); yynerrs++;} +| case_list ':' error + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "invalid statement in case element of ST 'CASE' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +case_list: + case_list_element + {$$ = new case_list_c(locloc(@$)); $$->add_element($1);} +| case_list ',' case_list_element + {$$ = $1; $$->add_element($3);} +/* ERROR_CHECK_BEGIN */ +| case_list ',' error + {$$ = $1; + if (is_current_syntax_token()) {print_err_msg(locl(@2), locf(@3), "no case defined in case list of ST parameter assignment list.");} + else {print_err_msg(locf(@3), locl(@3), "invalid case in case list of ST parameter assignment list."); yyclearin;} + yyerrok; + } +/* ERROR_CHECK_END */ +; + + +case_list_element: + signed_integer +| subrange +| enumerated_value +; + + + + + +/********************************/ +/* B 3.2.4 Iteration Statements */ +/********************************/ +iteration_statement: + for_statement +| while_statement +| repeat_statement +| exit_statement +; + + +for_statement: + FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_FOR + {$$ = new for_statement_c($2, $4, $6, $8, $10, locloc(@$));} +| FOR control_variable ASSIGN expression TO expression DO statement_list END_FOR + {$$ = new for_statement_c($2, $4, $6, NULL, $8, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| FOR ASSIGN expression TO expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement."); yynerrs++;} +| FOR ASSIGN expression TO expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no control variable defined in ST 'FOR' statement."); yynerrs++;} +| FOR error ASSIGN expression TO expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement."); yyerrok;} +| FOR error ASSIGN expression TO expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid control variable defined for ST 'FOR' statement."); yyerrok;} +| FOR control_variable expression TO expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); yynerrs++;} +| FOR control_variable expression TO expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locl(@2), locf(@3), "':=' missing between control variable and start expression in ST 'FOR' statement."); yynerrs++;} +| FOR control_variable error expression TO expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable error expression TO expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting ':=' between control variable and start expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN TO expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement."); yynerrs++;} +| FOR control_variable ASSIGN TO expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no start expression defined in ST 'FOR' statement."); yynerrs++;} +| FOR control_variable ASSIGN error TO expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid start expression defined in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN error TO expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid start expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression error expression BY expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression error expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@5), locl(@5), "expecting 'TO' between start expression and end expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression error expression DO statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@7), locl(@7), "expecting 'BY' between end expression and step expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression BY expression error statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@9), locl(@9), "expecting 'DO' after step expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression error statement_list END_FOR + {$$ = NULL; print_err_msg(locf(@7), locl(@7), "expecting 'DO' after end expression in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression BY expression DO END_FOR + {$$ = NULL; print_err_msg(locl(@9), locf(@10), "no statement(s) defined after 'DO' in ST 'FOR' statement."); yynerrs++;} +| FOR control_variable ASSIGN expression TO expression DO END_FOR + {$$ = NULL; print_err_msg(locl(@7), locf(@8), "no statement(s) defined after 'DO' in ST 'FOR' statement."); yynerrs++;} +| FOR control_variable ASSIGN expression TO expression BY expression DO error END_FOR + {$$ = NULL; print_err_msg(locf(@10), locl(@10), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression DO error END_FOR + {$$ = NULL; print_err_msg(locf(@8), locl(@8), "invalid statement(s) defined after 'DO' in ST 'FOR' statement."); yyerrok;} +| FOR control_variable error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;} +| FOR control_variable ASSIGN expression error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression DO statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yynerrs++;} +| FOR control_variable ASSIGN expression TO expression BY expression error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yyerrok;} +| FOR control_variable ASSIGN expression TO expression BY expression DO statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'FOR' statement in ST."); yynerrs++;} +| FOR error END_FOR + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'FOR' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + +/* The spec has the syntax + * control_variable: identifier; + * but then defines the semantics of control_variable + * (Section 3.3.2.4) as being of an integer type + * (e.g., SINT, INT, or DINT). + * + * Obviously this presuposes that the control_variable + * must have been declared in some VAR .. END_VAR + * We must therefore change the syntax to read + * control_variable: prev_declared_variable_name; + * + * If we don't, then the correct use of any previosuly declared + * variable would result in an incorrect syntax error +*/ +control_variable: + prev_declared_variable_name + {$$ = new symbolic_variable_c($1,locloc(@$));}; +// control_variable: identifier {$$ = $1;}; + +/* Integrated directly into for_statement */ +/* +for_list: + expression TO expression [BY expression] +; +*/ + + +while_statement: + WHILE expression DO statement_list END_WHILE + {$$ = new while_statement_c($2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| WHILE DO statement_list END_WHILE + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no test expression defined in ST 'WHILE' statement."); yynerrs++;} +| WHILE error DO statement_list END_WHILE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid test expression defined for ST 'WHILE' statement."); yyerrok;} +| WHILE expression error statement_list END_WHILE + {$$ = NULL; print_err_msg(locf(@3), locl(@3), "expecting 'DO' after test expression in ST 'WHILE' statement."); yyerrok;} +| WHILE expression DO END_WHILE + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no statement(s) defined after 'DO' in ST 'WHILE' statement."); yynerrs++;} +| WHILE expression DO error END_WHILE + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid statement(s) defined after 'DO' in ST 'WHILE' statement."); yyerrok;} +| WHILE expression error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'WHILE' statement in ST."); yyerrok;} +| WHILE expression DO statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'WHILE' statement in ST."); yynerrs++;} +| WHILE error END_WHILE + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'WHILE' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +repeat_statement: + REPEAT statement_list UNTIL expression END_REPEAT + {$$ = new repeat_statement_c($2, $4, locloc(@$));} +/* ERROR_CHECK_BEGIN */ +| REPEAT UNTIL expression END_REPEAT + {$$ = NULL; print_err_msg(locl(@1), locf(@2), "no statement(s) defined after 'REPEAT' in ST 'REPEAT' statement."); yynerrs++;} +| REPEAT error UNTIL expression END_REPEAT + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "invalid statement(s) defined after 'REPEAT' for ST 'REPEAT' statement."); yyerrok;} +| REPEAT statement_list UNTIL END_REPEAT + {$$ = NULL; print_err_msg(locl(@3), locf(@4), "no test expression defined after 'UNTIL' in ST 'REPEAT' statement.");} +| REPEAT statement_list UNTIL error END_REPEAT + {$$ = NULL; print_err_msg(locf(@4), locl(@4), "invalid test expression defined after 'UNTIL' in ST 'REPEAT' statement."); yyerrok;} +| REPEAT statement_list END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'REPEAT' statement in ST."); yynerrs++;} +| REPEAT statement_list UNTIL expression error END_OF_INPUT + {$$ = NULL; print_err_msg(locf(@1), locl(@1), "unclosed 'REPEAT' statement in ST."); yyerrok;} +| REPEAT error END_REPEAT + {$$ = NULL; print_err_msg(locf(@2), locl(@2), "unknown error in ST 'REPEAT' statement."); yyerrok;} +/* ERROR_CHECK_END */ +; + + +exit_statement: + EXIT {$$ = new exit_statement_c(locloc(@$));} +; + + + + + +%% + +#include /* required for printf() */ +#include +#include "../util/symtable.hh" + +/* variables defined in code generated by flex... */ +extern FILE *yyin; +extern int yylineno; +extern tracking_t* current_tracking; + + + + +/*************************************************************************************************/ +/* NOTE: These variables are really parameters we would like the stage2__ function to pass */ +/* to the yyparse() function. However, the yyparse() function is created automatically */ +/* by bison, so we cannot add parameters to this function. The only other */ +/* option is to use global variables! yuck! */ +/*************************************************************************************************/ + +/* A global flag used to tell the parser if overloaded funtions should be allowed. + * The IEC 61131-3 standard allows overloaded funtions in the standard library, + * but disallows them in user code... + * + * In essence, a parameter we would like to pass to the yyparse() function but + * have to do it using a global variable, as the yyparse() prototype is fixed by bison. + */ +bool allow_function_overloading = false; + +/* | [var1_list ','] variable_name '..' */ +/* NOTE: This is an extension to the standard!!! */ +/* In order to be able to handle extensible standard functions + * (i.e. standard functions that may have a variable number of + * input parameters, such as AND(word#33, word#44, word#55, word#66), + * we have extended the acceptable syntax to allow var_name '..' + * in an input variable declaration. + * + * This allows us to parse the declaration of standard + * extensible functions and load their interface definition + * into the abstract syntax tree just like we do to other + * user defined functions. + * This has the advantage that we can later do semantic + * checking of calls to functions (be it a standard or user defined + * function) in (almost) exactly the same way. + * + * Of course, we have a flag that disables this syntax when parsing user + * written code, so we only allow this extra syntax while parsing the + * 'header' file that declares all the standard IEC 61131-3 functions. + */ +bool allow_extensible_function_parameters = false; + +/* A global flag used to tell the parser whether to include the full variable location + * when printing out error messages... + */ +bool full_token_loc; + +/* A pointer to the root of the parsing tree that will be generated + * by bison. + */ +symbol_c *tree_root; + + + +/* The following function is called automatically by bison whenever it comes across + * an error. Unfortunately it calls this function before executing the code that handles + * the error itself, so we cannot print out the correct line numbers of the error location + * over here. + * Our solution is to store the current error message in a global variable, and have all + * error action handlers call the function print_err_msg() after setting the location + * (line number) variable correctly. + */ +const char *current_error_msg; +void yyerror (const char *error_msg) { + current_error_msg = error_msg; +/* fprintf(stderr, "error %d: %s\n", yynerrs // global variable //, error_msg); */ +/* print_include_stack(); */ +} + + +/* ERROR_CHECK_BEGIN */ +bool is_current_syntax_token() { + switch (yychar) { + case ';': + case ',': + case ')': + case ']': + case '+': + case '*': + case '-': + case '/': + case '<': + case '>': + case '=': + case '&': + case OR: + case XOR: + case AND: + case AND2: + case OPER_NE: + case OPER_LE: + case OPER_GE: + case MOD: + case OPER_EXP: + case NOT: + return true; + default: + return false; + } +} +/* ERROR_CHECK_END */ + + +void print_err_msg(int first_line, + int first_column, + const char *first_filename, + long int first_order, + int last_line, + int last_column, + const char *last_filename, + long int last_order, + const char *additional_error_msg) { + + const char *unknown_file = ""; + if (first_filename == NULL) first_filename = unknown_file; + if ( last_filename == NULL) last_filename = unknown_file; + + if (full_token_loc) { + if (first_filename == last_filename) + fprintf(stderr, "%s:%d-%d..%d-%d: error : %s\n", first_filename, first_line, first_column, last_line, last_column, additional_error_msg); + else + fprintf(stderr, "%s:%d-%d..%s:%d-%d: error : %s\n", first_filename, first_line, first_column, last_filename, last_line, last_column, additional_error_msg); + } else { + fprintf(stderr, "%s:%d: error : %s\n", first_filename, first_line, additional_error_msg); + } + //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); +} + + + +/* If function overloading is on, we allow several functions with the same name. + * + * However, to support standard functions, we also allow functions named + * AND, MOD, NOT, OR, XOR, ADD, ... + */ +/* +identifier_c *token_2_identifier_c(char *value, ) { + identifier_c tmp = new identifier_c(value, locloc(@$)); + if (!allow_function_overloading) { + fprintf(stderr, "Function overloading not allowed. Invalid identifier %s\n", ((token_c *)($$))->value); + ERROR; + } + } +} +*/ + +/* convert between an il_operator to a function name */ +/* This a kludge! + * It is required because our language requires more than one + * look ahead token, and bison only works with one! + */ +#define op_2_str(op, str) {\ + op ## _operator_c *ptr = dynamic_cast(il_operator); \ + if (ptr != NULL) name = str; \ +} + +/* NOTE: this code is very ugly and un-eficient, but I (Mario) have many + * more things to worry about right now, so just let it be... + */ +symbol_c *il_operator_c_2_identifier_c(symbol_c *il_operator) { + const char *name = NULL; + identifier_c *res; + + op_2_str(NOT, "NOT"); + + op_2_str(AND, "AND"); + op_2_str(OR, "OR"); + op_2_str(XOR, "XOR"); + op_2_str(ADD, "ADD"); + op_2_str(SUB, "SUB"); + op_2_str(MUL, "MUL"); + op_2_str(DIV, "DIV"); + op_2_str(MOD, "MOD"); + op_2_str(GT, "GT"); + op_2_str(GE, "GE"); + op_2_str(EQ, "EQ"); + op_2_str(LT, "LT"); + op_2_str(LE, "LE"); + op_2_str(NE, "NE"); + + op_2_str(LD, "LD"); + op_2_str(LDN, "LDN"); + op_2_str(ST, "ST"); + op_2_str(STN, "STN"); + + op_2_str(S, "S"); + op_2_str(R, "R"); + op_2_str(S1, "S1"); + op_2_str(R1, "R1"); + + op_2_str(CLK, "CLK"); + op_2_str(CU, "CU"); + op_2_str(CD, "CD"); + op_2_str(PV, "PV"); + op_2_str(IN, "IN"); + op_2_str(PT, "PT"); + + op_2_str(ANDN, "ANDN"); + op_2_str(ORN, "ORN"); + op_2_str(XORN, "XORN"); + + op_2_str(ADD, "ADD"); + op_2_str(SUB, "SUB"); + op_2_str(MUL, "MUL"); + op_2_str(DIV, "DIV"); + + op_2_str(GT, "GT"); + op_2_str(GE, "GE"); + op_2_str(EQ, "EQ"); + op_2_str(LT, "LT"); + op_2_str(LE, "LE"); + op_2_str(NE, "NE"); + + op_2_str(CAL, "CAL"); + op_2_str(CALC, "CALC"); + op_2_str(CALCN, "CALCN"); + op_2_str(RET, "RET"); + op_2_str(RETC, "RETC"); + op_2_str(RETCN, "RETCN"); + op_2_str(JMP, "JMP"); + op_2_str(JMPC, "JMPC"); + op_2_str(JMPCN, "JMPCN"); + + if (name == NULL) + ERROR; + + res = new identifier_c(strdup(name), + il_operator->first_line, + il_operator->first_column, + il_operator->first_file, + il_operator->first_order, + il_operator->last_line, + il_operator->last_column, + il_operator->last_file, + il_operator->last_order + ); + free(il_operator); + return res; +} + + +#include "standard_function_names.c" + +const char *standard_function_block_names[] = { +// 2.5.2.3.1 Bistable elements +// Table 34 - Standard bistable function blocks +"SR","RS", +// 2.5.2.3.2 Edge detection +// Table 35 - Standard edge detection function blocks +"R_TRIG","F_TRIG", +// 2.5.2.3.3 Counters +// Table 36 - Standard counter function blocks +"CTU","CTU_DINT","CTU_LINT","CTU_UDINT","CTU_ULINT", +"CTD","CTD_DINT","CTD_LINT","CTD_UDINT","CTD_ULINT", +"CTUD","CTUD_DINT","CTUD_LINT","CTUD_ULINT", +// 2.5.2.3.4 Timers +// Table 37 - Standard timer function blocks +"TP","TON","TOF", +/* end of array marker! Do not remove! */ +NULL +}; + + +#define LIBFILE "ieclib.txt" +#define DEF_LIBFILENAME LIBDIRECTORY "/" LIBFILE + +extern const char *INCLUDE_DIRECTORIES[]; + + + +int stage2__(const char *filename, + const char *includedir, /* Include directory, where included files will be searched for... */ + symbol_c **tree_root_ref, + 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... */ + /* + #if YYDEBUG + yydebug = 1; + #endif + */ + yyin = lib_file; + 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; + + if (yynerrs > 0) { + fprintf (stderr, "\nFound %d error(s) 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!!! + */ + for(int i = 0; standard_function_block_names[i] != NULL; i++) + if (library_element_symtable.find_value(standard_function_block_names[i]) == + library_element_symtable.end_value()) + library_element_symtable.insert(standard_function_block_names[i], standard_function_block_name_token); + + + /* now parse the input file... */ + #if YYDEBUG + yydebug = 1; + #endif + yyin = in_file; + 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 (yynerrs > 0) { + fprintf (stderr, "\nFound %d error(s). Bailing out!\n", yynerrs /* global variable */); + exit(EXIT_FAILURE); + } + + if (tree_root_ref != NULL) + *tree_root_ref = tree_root; + + fclose(in_file); + return 0; +} + + + diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/iec_flex.ll --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage1_2/iec_flex.ll Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,1719 @@ +/* + * matiec - a compiler for the programming languages defined in IEC 61131-3 + * + * Copyright (C) 2003-2011 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 . + * + * + * 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) + * + */ + +/* + * Stage 1 + * ======= + * + * This file contains the lexical tokens definitions, from which + * the flex utility will generate a lexical parser function. + */ + + + + +/*****************************/ +/* Lexical Parser Options... */ +/*****************************/ + +/* The lexical analyser will never work in interactive mode, + * i.e., it will only process programs saved to files, and never + * programs being written inter-actively by the user. + * This option saves the resulting parser from calling the + * isatty() function, that seems to be generating some compile + * errors under some (older?) versions of flex. + */ +%option never-interactive + +/* Have the lexical analyser use a 'char *yytext' instead of an + * array of char 'char yytext[??]' to store the lexical token. + */ +%pointer + + +/* Have the lexical analyser ignore the case of letters. + * This will occur for all the tokens and keywords, but + * the resulting text handed up to the syntax parser + * will not be changed, and keep the original case + * of the letters in the input file. + */ +%option case-insensitive + +/* Have the generated lexical analyser keep track of the + * line number it is currently analysing. + * This is used to pass up to the syntax parser + * the number of the line on which the current + * token was found. It will enable the syntax parser + * to generate more informatve error messages... + */ +%option yylineno + +/* required for the use of the yy_pop_state() and + * yy_push_state() functions + */ +%option stack + +/* The '%option stack' also requests the inclusion of + * the yy_top_state(), however this function is not + * currently being used. This means that the compiler + * is complaining about the existance of this function. + * The following option removes the yy_top_state() + * function from the resulting c code, so the compiler + * no longer complains. + */ +%option noyy_top_state + +/* We will not be using unput() in our flex code... */ +%option nounput + +/**************************************************/ +/* External Variable and Function declarations... */ +/**************************************************/ + + +%{ +/* Define TEST_MAIN to include a main() function. + * Useful for testing the parser generated by flex. + */ +/* +#define TEST_MAIN +*/ +/* If lexical parser is compiled by itself, we need to define the following + * constant to some string. Under normal circumstances LIBDIRECTORY is set + * in the syntax parser header file... + */ +#ifdef TEST_MAIN +#define DEFAULT_LIBDIR "just_testing" +#endif + + + +/* Required for strdup() */ +#include + +/* Required only for the declaration of abstract syntax classes + * (class symbol_c; class token_c; class list_c;) + * These will not be used in flex, but the token type union defined + * in iec_bison.h contains pointers to these classes, so we must include + * it here. + */ +#include "../absyntax/absyntax.hh" + + +/* iec_bison.h is generated by bison. + * Contains the definition of the token constants, and the + * token value type YYSTYPE (in our case, a 'const char *') + */ +#include "iec_bison.h" +#include "stage1_2_priv.hh" + + +/* Variable defined by the bison parser, + * where the value of the tokens will be stored + */ +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 *) + * directive... + */ +/* + NOTE: already defined in iec_bison.h +extern const char *current_filename; +*/ + + +/* We will not be using unput() in our flex code... */ +/* NOTE: it seems that this #define is no longer needed, It has been + * replaced by %option nounput. + * Should we simply delete it? + * For now leave it in, in case someone is using an old version of flex. + * In any case, the most harm that can result in a warning message + * when compiling iec.flex.c: + * warning: ‘void yyunput(int, char*)’ defined but not used + */ +#define YY_NO_UNPUT + +/* Variable defined by the bison parser. + * It must be initialised with the location + * of the token being parsed. + * This is only needed if we want to keep + * track of the locations, in order to give + * more meaningful error messages! + */ +extern YYLTYPE yylloc; + +#define YY_INPUT(buf,result,max_size) {\ + result = GetNextChar(buf, max_size);\ + if ( result <= 0 )\ + result = YY_NULL;\ + } + + +/* A counter to track the order by which each token is processed. + * NOTE: This counter is not exactly linear (i.e., it does not get incremented by 1 for each token). + * i.e.. it may get incremented by more than one between two consecutive tokens. + * This is due to the fact that the counter gets incremented every 'user action' in flex, + * however not every user action will result in a token being passed to bison. + * Nevertheless this is still OK, as we are only interested in the relative + * ordering of tokens... + */ +static long int current_order = 0; + + +/* Macro that is executed for every action. + * We use it to pass the location of the token + * back to the bison parser... + */ +#define YY_USER_ACTION {\ + yylloc.first_line = current_tracking->lineNumber; \ + yylloc.first_column = current_tracking->currentTokenStart; \ + yylloc.first_file = current_filename; \ + yylloc.first_order = current_order; \ + yylloc.last_line = current_tracking->lineNumber; \ + yylloc.last_column = current_tracking->currentChar - 1; \ + yylloc.last_file = current_filename; \ + yylloc.last_order = current_order; \ + current_tracking->currentTokenStart = current_tracking->currentChar; \ + current_order++; \ + } + + +/* Since this lexical parser we defined only works in ASCII based + * systems, we might as well make sure it is being compiled on + * one... + * Lets check a few random characters... + */ +#if (('a' != 0x61) || ('A' != 0x41) || ('z' != 0x7A) || ('Z' != 0x5A) || \ + ('0' != 0x30) || ('9' != 0x39) || ('(' != 0x28) || ('[' != 0x5B)) +#error This lexical analyser is not portable to a non ASCII based system. +#endif + + +/* Function only called from within flex, but defined + * in iec.y! + * We declare it here... + * + * Search for a symbol in either of the two symbol tables + * and return the token id of the first symbol found. + * Searches first in the variables, and only if not found + * does it continue searching in the library elements + */ +//token_id_t get_identifier_token(const char *identifier_str); +int get_identifier_token(const char *identifier_str); +%} + + +/***************************************************/ +/* Forward Declaration of functions defined later. */ +/***************************************************/ + +%{ +/* return all the text in the current token back to the input stream. */ +void unput_text(unsigned int n); +%} + + + +/****************************/ +/* Lexical Parser States... */ +/****************************/ + +/* NOTE: Our psrser can parse st or il code, intermixed + * within the same file. + * With IL we come across the issue of the EOL (end of line) token. + * ST, and the declaration parts of IL do not use this token! + * If the lexical analyser were to issue this token during ST + * language parsing, or during the declaration of data types, + * function headers, etc. in IL, the syntax parser would crash. + * + * We can solve this issue using one of three methods: + * (1) Augment all the syntax that does not accept the EOL + * token to simply ignore it. This makes the syntax + * definition (in iec.y) very cluttered! + * (2) Let the lexical parser figure out which language + * it is parsing, and decide whether or not to issue + * the EOL token. This requires the lexical parser + * to have knowledge of the syntax!, making for a poor + * overall organisation of the code. It would also make it + * very difficult to understand the lexical parser as it + * would use several states, and a state machine to transition + * between the states. The state transitions would be + * intermingled with the lexical parser defintion! + * (3) Use a mixture of (1) and (2). The lexical analyser + * merely distinguishes between function headers and function + * bodies, but no longer makes a distinction between il and + * st language bodies. When parsing a body, it will return + * the EOL token. In other states '\n' will be ignored as + * whitespace. + * The ST language syntax has been augmented in the syntax + * parser configuration to ignore any EOL tokens that it may + * come across! + * This option has both drawbacks of option (1) and (2), but + * much less intensely. + * The syntax that gets cluttered is limited to the ST statements + * (which is rather limited, compared to the function headers and + * data type declarations, etc...), while the state machine in + * the lexical parser becomes very simple. All state transitions + * can be handled within the lexical parser by itself, and can be + * easily identified. Thus knowledge of the syntax required by + * the lexical parser is very limited! + * + * Amazingly enough, I (Mario) got to implement option (3) + * at first, requiring two basic states, decl and body. + * The lexical parser will enter the body state when + * it is parsing the body of a function/program/function block. The + * state transition is done when we find a VAR_END that is not followed + * by a VAR! This is the syntax knowledge that gets included in the + * lexical analyser with this option! + * Unfortunately, getting the st syntax parser to ignore EOL anywhere + * where they might appear leads to conflicts. This is due to the fact + * that the syntax parser uses the single look-ahead token to remove + * possible conflicts. When we insert a possible EOL, the single + * look ahead token becomes the EOL, which means the potential conflicts + * could no longer be resolved. + * Removing these conflicts would make the st syntax parser very convoluted, + * and adding the extraneous EOL would make it very cluttered. + * This option was therefore dropped in favour of another! + * + * I ended up implementing (2). Unfortunately the lexical analyser can + * not easily distinguish between il and st code, since function + * calls in il are very similar to function block calls in st. + * We therefore use an extra 'body' state. When the lexical parser + * finds that last END_VAR, it enters the body state. This state + * must figure out what language is being parsed from the first few + * tokens, and switch to the correct state (st, il or sfc) according to the + * language. This means that we insert quite a bit of knowledge of the + * syntax of the languages into the lexical parser. This is ugly, but it + * works, and at least it is possible to keep all the state changes together + * to make it easier to remove them later on if need be. + * Once the language being parsed has been identified, + * the body state returns any matched text back to the buffer with unput(), + * to be later matched correctly by the apropriate language parser (st, il or sfc). + * + * Aditionally, in sfc state it may further recursively enter the body state + * once again. This is because an sfc body may contain ACTIONS, which are then + * written in one of the three languages (ST, IL or SFC), so once again we need + * to figure out which language the ACTION in the SFC was written in. We already + * ahve all that done in the body state, so we recursively transition to the body + * state once again. + * Note that in this case, when coming out of the st/il state (whichever language + * the action was written in) the sfc state will become active again. This is done by + * pushing and poping the previously active state! + * + * The sfc_qualifier_state is required because when parsing actions within an + * sfc, we will be expecting action qualifiers (N, P, R, S, DS, SD, ...). In order + * to bison to work correctly, these qualifiers must be returned as tokens. However, + * these tokens are not reserved keywords, which means it should be possible to + * define variables/functions/FBs with any of these names (including + * S and R which are special because they are also IL operators). So, when we are not + * expecting any action qualifiers, flex does not return these tokens, and is free + * to interpret them as previously defined variables/functions/... as the case may be. + * + * The state machine has 7 possible states (INITIAL, config, decl, body, st, il, sfc) + * Possible state changes are: + * INITIAL -> goto(decl_state) + * (when a FUNCTION, FUNCTION_BLOCK, or PROGRAM is found, + * and followed by a VAR declaration) + * INITIAL -> goto(body_state) + * (when a FUNCTION, FUNCTION_BLOCK, or PROGRAM is found, + * and _not_ followed by a VAR declaration) + * (This transition is actually commented out, since the syntax + * does not allow the declaration of functions, FBs, or programs + * without any VAR declaration!) + * INITIAL -> goto(config_state) + * (when a CONFIGURATION is found) + * decl_state -> push(decl_state); goto(body_state) + * (when the last END_VAR is found, i.e. the function body starts) + * decl_state -> push(decl_state); goto(sfc_state) + * (when it figures out it is parsing sfc language) + * body_state -> goto(st_state) + * (when it figures out it is parsing st language) + * body_state -> goto(il_state) + * (when it figures out it is parsing il language) + * st_state -> pop() + * (when a END_FUNCTION, END_FUNCTION_BLOCK, END_PROGRAM, + * END_ACTION or END_TRANSITION is found) + * il_state -> pop() + * (when a END_FUNCTION, END_FUNCTION_BLOCK, END_PROGRAM, + * END_ACTION or END_TRANSITION is found) + * decl_state -> goto(INITIAL) + * (when a END_FUNCTION, END_FUNCTION_BLOCK, or END_PROGRAM is found) + * sfc_state -> goto(INITIAL) + * (when a END_FUNCTION, END_FUNCTION_BLOCK, or END_PROGRAM is found) + * config_state -> goto(INITIAL) + * (when a END_CONFIGURATION is found) + * sfc_state -> push(sfc_state); goto(body_state) + * (when parsing an action. This transition is requested by bison) + * sfc_state -> push(sfc_state); goto(sfc_qualifier_state) + * (when expecting an action qualifier. This transition is requested by bison) + * sfc_qualifier_state -> pop() + * (when no longer expecting an action qualifier. This transition is requested by bison) + * config_state -> push(config_state); goto(task_init_state) + * (when parsing a task initialisation. This transition is requested by bison) + * task_init_state -> pop() + * (when no longer parsing task initialisation parameters. This transition is requested by bison) + * + */ + + +/* we are parsing a configuration. */ +%s config_state + +/* Inside a configuration, we are parsing a task initialisation parameters */ +/* This means that PRIORITY, SINGLE and INTERVAL must be handled as + * tokens, and not as possible identifiers. Note that the above words + * are not keywords. + */ +%s task_init_state + +/* 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 */ +%x body_state + +/* we are parsing il code -> flex must return the EOL tokens! */ +%s il_state + +/* we are parsing st code -> flex must not return the EOL tokens! */ +%s st_state + +/* we are parsing sfc code -> flex must not return the EOL tokens! */ +%s sfc_state + +/* we are parsing sfc code, and expecting an action qualifier. */ +%s sfc_qualifier_state + +/* we are parsing sfc code, and expecting the priority token. */ +%s sfc_priority_state + + + + +/*******************/ +/* File #include's */ +/*******************/ + +/* We extend the IEC 61131-3 standard syntax to allow inclusion + * of other files, using the IEC 61131-3 pragma directive... + * The accepted syntax is: + * {#include ""} + */ + +/* the "include" states are used for picking up the name of an include file */ +%x include_beg +%x include_filename +%x include_end + + +file_include_pragma_filename [^\"]* +file_include_pragma_beg "{#include"{st_whitespace_only}\" +file_include_pragma_end \"{st_whitespace_only}"}" +file_include_pragma {file_include_pragma_beg}{file_include_pragma_filename}{file_include_pragma_end} + + +%{ +#define MAX_INCLUDE_DEPTH 16 + +typedef struct { + YY_BUFFER_STATE buffer_state; + tracking_t* env; + const char *filename; + } include_stack_t; + +tracking_t* current_tracking; +include_stack_t include_stack[MAX_INCLUDE_DEPTH]; +int include_stack_ptr = 0; + +const char *INCLUDE_DIRECTORIES[] = { + DEFAULT_LIBDIR, + ".", + "/lib", + "/usr/lib", + "/usr/lib/iec", + NULL /* must end with NULL!! */ + }; + +%} + + + +/*****************************/ +/* Prelimenary constructs... */ +/*****************************/ + +/* In order to allow the declaration of POU prototypes (Function, FB, Program, ...), + * especially the prototypes of Functions and FBs defined in the standard + * (i.e. standard functions and FBs), we extend the IEC 61131-3 standard syntax + * with two pragmas to indicate that the code is to be parsed (going through the + * lexical, syntactical, and semantic analysers), but no code is to be generated. + * + * The accepted syntax is: + * {no_code_generation begin} + * ... prototypes ... + * {no_code_generation end} + * + * When parsing these prototypes the abstract syntax tree will be populated as usual, + * allowing the semantic analyser to correctly analyse the semantics of calls to these + * functions/FBs. However, stage4 will simply ignore all IEC61131-3 code + * between the above two pragmas. + */ + +disable_code_generation_pragma "{disable code generation}" +enable_code_generation_pragma "{enable code generation}" + + +/* Any other pragma... */ + +pragma "{"[^}]*"}" + +/* NOTE: this seemingly unnecessary complex definition is required + * to be able to eat up comments such as: + * '(* Testing... ! ***** ******)' + * without using the trailing context command in flex (/{context}) + * since {comment} itself will later be used with + * trailing context ({comment}/{context}) + */ +not_asterisk [^*] +not_close_parenthesis_nor_asterisk [^*)] +asterisk "*" +comment_text {not_asterisk}|(({asterisk}+){not_close_parenthesis_nor_asterisk}) + +comment "(*"({comment_text}*)({asterisk}+)")" + + +/* +3.1 Whitespace + (NOTE: Whitespace IS clearly defined, to include newline!!! See section 2.1.4!!!) + No definition of whitespace is given, in other words, the characters that may be used to seperate language tokens are not pecisely defined. One may nevertheless make an inteligent guess of using the space (' '), and other characters also commonly considered whitespace in other programming languages (horizontal tab, vertical tab, form feed, etc.). + The main question is whether the newline character should be considered whitespace. IL language statements use an EOL token (End Of Line) to distinguish between some language constructs. The EOL token itself is openly defined as "normally consist[ing] of the 'paragraph separator' ", leaving the final choice open to each implemention. If we choose the newline character to represent the EOL token, it may then not be considered whitespace. + On the other hand, some examples that come in a non-normative annex of the specification allow function declarations to span multiple3.1 Whitespace + (NOTE: Whitespace IS clearly defined, to include newline!!! See section 2.1.4!!!) + No definition of whitespace is given, in other words, the characters that may be used to seperate language tokens are not pecisely defined. One may nevertheless make an inteligent guess of using the space (' '), and other characters also commonly considered whitespace in other programming languages (horizontal tab, vertical tab, form feed, etc.). + The main question is whether the newline character should be considered whitespace. IL language statements use an EOL token (End Of Line) to distinguish between some language constructs. The EOL token itself is openly defined as "normally consist[ing] of the 'paragraph separator' ", leaving the final choice open to each implemention. If we choose the newline character to represent the EOL token, it may then not be considered whitespace. + On the other hand, some examples that come in a non-normative annex of the specification allow function declarations to span multiple lines, which means that the newline character is being considered as whitespace. + Our implementation works around this issue by including the new line character in the whitespace while parsing function declarations and the ST language, and parsing it as the EOL token only while parsing IL language statements. This requires the use of a state machine in the lexical parser that needs at least some knowledge of the syntax itself. +*/ +/* NOTE: Our definition of whitespace will only work in ASCII! + * + * Since the IL language needs to know the location of newline + * (token EOL -> '\n' ), we need one definition of whitespace + * for each language... + */ +/* + * NOTE: we cannot use + * st_whitespace [:space:]* + * since we use {st_whitespace} as trailing context. In our case + * this would not constitute "dangerous trailing context", but the + * lexical generator (i.e. flex) does not know this (since it does + * not know which characters belong to the set [:space:]), and will + * generate a "dangerous trailing context" warning! + * We use this alternative just to stop the flex utility from + * generating the invalid (in this case) warning... + */ + +st_whitespace_only [ \f\n\r\t\v]* +il_whitespace_only [ \f\r\t\v]* + +st_whitespace_text {st_whitespace_only}|{comment}|{pragma} +il_whitespace_text {il_whitespace_only}|{comment}|{pragma} + +st_whitespace {st_whitespace_text}* +il_whitespace {il_whitespace_text}* + +st_whitespace_text_no_pragma {st_whitespace_only}|{comment} +il_whitespace_text_no_pragma {il_whitespace_only}|{comment} + +st_whitespace_no_pragma {st_whitespace_text_no_pragma}* +il_whitespace_no_pragma {il_whitespace_text_no_pragma}* + +qualified_identifier {identifier}(\.{identifier})* + + + +/*****************************************/ +/* B.1.1 Letters, digits and identifiers */ +/*****************************************/ +/* NOTE: The following definitions only work if the host computer + * is using the ASCII maping. For e.g., with EBCDIC [A-Z] + * contains non-alphabetic characters! + * The correct way of doing it would be to use + * the [:upper:] etc... definitions. + * + * Unfortunately, further on we need all printable + * characters (i.e. [:print:]), but excluding '$'. + * Flex does not allow sets to be composed by excluding + * elements. Sets may only be constructed by adding new + * elements, which means that we have to revert to + * [\x20\x21\x23\x25\x26\x28-x7E] for the definition + * of the printable characters with the required exceptions. + * The above also implies the use of ASCII, but now we have + * no way to work around it| + * + * The conclusion is that our parser is limited to ASCII + * based host computers!! + */ +letter [A-Za-z] +digit [0-9] +octal_digit [0-7] +hex_digit {digit}|[A-F] +identifier ({letter}|(_({letter}|{digit})))((_?({letter}|{digit}))*) + +/*******************/ +/* B.1.2 Constants */ +/*******************/ + +/******************************/ +/* B.1.2.1 Numeric literals */ +/******************************/ +integer {digit}((_?{digit})*) +binary_integer 2#{bit}((_?{bit})*) +bit [0-1] +octal_integer 8#{octal_digit}((_?{octal_digit})*) +hex_integer 16#{hex_digit}((_?{hex_digit})*) +exponent [Ee]([+-]?){integer} +/* The correct definition for real would be: + * real {integer}\.{integer}({exponent}?) + * + * Unfortunately, the spec also defines fixed_point (B 1.2.3.1) as: + * fixed_point {integer}\.{integer} + * + * This means that {integer}\.{integer} could be interpreted + * as either a fixed_point or a real. + * I have opted to interpret {integer}\.{integer} as a fixed_point. + * In order to do this, the definition of real has been changed to: + * real {integer}\.{integer}{exponent} + * + * This means that the syntax parser now needs to define a real to be + * either a real_token or a fixed_point_token! + */ +real {integer}\.{integer}{exponent} + + +/*******************************/ +/* B.1.2.2 Character Strings */ +/*******************************/ +/* +common_character_representation := + +|'$$' +|'$L'|'$N'|'$P'|'$R'|'$T' +|'$l'|'$n'|'$p'|'$r'|'$t' + +NOTE: $ = 0x24 + " = 0x22 + ' = 0x27 + + printable chars in ASCII: 0x20-0x7E +*/ + +esc_char_u $L|$N|$P|$R|$T +esc_char_l $l|$n|$p|$r|$t +esc_char $$|{esc_char_u}|{esc_char_l} +double_byte_char (${hex_digit}{hex_digit}{hex_digit}{hex_digit}) +single_byte_char (${hex_digit}{hex_digit}) + +/* WARNING: + * This definition is only valid in ASCII... + * + * Flex includes the function print_char() that defines + * all printable characters portably (i.e. whatever character + * encoding is currently being used , ASCII, EBCDIC, etc...) + * Unfortunately, we cannot generate the definition of + * common_character_representation portably, since flex + * does not allow definition of sets by subtracting + * elements in one set from another set. + * This means we must build up the defintion of + * common_character_representation using only set addition, + * which leaves us with the only choice of defining the + * characters non-portably... + */ +common_character_representation [\x20\x21\x23\x25\x26\x28-\x7E]|{esc_char} +double_byte_character_representation $\"|'|{double_byte_char}|{common_character_representation} +single_byte_character_representation $'|\"|{single_byte_char}|{common_character_representation} + + +double_byte_character_string \"({double_byte_character_representation}*)\" +single_byte_character_string '({single_byte_character_representation}*)' + + +/************************/ +/* B 1.2.3.1 - Duration */ +/************************/ +fixed_point {integer}\.{integer} + +fixed_point_d {fixed_point}d +integer_d {integer}d + +fixed_point_h {fixed_point}h +integer_h {integer}h + +fixed_point_m {fixed_point}m +integer_m {integer}m + +fixed_point_s {fixed_point}s +integer_s {integer}s + +fixed_point_ms {fixed_point}ms +integer_ms {integer}ms + + +/********************************************/ +/* B.1.4.1 Directly Represented Variables */ +/********************************************/ +/* The correct definition, if the standard were to be followed... */ + +location_prefix [IQM] +size_prefix [XBWDL] +direct_variable_standard %{location_prefix}({size_prefix}?){integer}((.{integer})*) + + +/* For the MatPLC, we will accept % + * as a direct variable, this being mapped onto the MatPLC point + * named + */ +/* TODO: we should not restrict it to only the accepted syntax + * of as specified by the standard. MatPLC point names + * have a more permissive syntax. + * + * e.g. "P__234" + * Is a valid MatPLC point name, but not a valid !! + * The same happens with names such as "333", "349+23", etc... + * How can we handle these more expressive names in our case? + * Remember that some direct variable may remain anonymous, with + * declarations such as: + * VAR + * AT %I3 : BYTE := 255; + * END_VAR + * in which case we are currently using "%I3" as the variable + * name. + */ +direct_variable_matplc %{identifier} + +direct_variable {direct_variable_standard}|{direct_variable_matplc} + +/******************************************/ +/* B 1.4.3 - Declaration & Initialisation */ +/******************************************/ +incompl_location %[IQM]\* + + + + +%% + /* fprintf(stderr, "flex: state %d\n", YY_START); */ + + /*****************************************************/ + /*****************************************************/ + /*****************************************************/ + /***** *****/ + /***** *****/ + /***** F I R S T T H I N G S F I R S T *****/ + /***** *****/ + /***** *****/ + /*****************************************************/ + /*****************************************************/ + /*****************************************************/ + + /***********************************************************/ + /* Handle requests sent by bison for flex to change state. */ + /***********************************************************/ + if (get_goto_body_state()) { + yy_push_state(body_state); + rst_goto_body_state(); + } + + if (get_goto_sfc_qualifier_state()) { + yy_push_state(sfc_qualifier_state); + rst_goto_sfc_qualifier_state(); + } + + if (get_goto_sfc_priority_state()) { + yy_push_state(sfc_priority_state); + rst_goto_sfc_priority_state(); + } + + if (get_goto_task_init_state()) { + yy_push_state(task_init_state); + rst_goto_task_init_state(); + } + + if (get_pop_state()) { + yy_pop_state(); + rst_pop_state(); + } + + /***************************/ + /* Handle the pragmas! */ + /***************************/ + + /* We start off by searching for the pragmas we handle in the lexical parser. */ +{file_include_pragma} unput_text(0); yy_push_state(include_beg); + + /* Pragmas sent to syntax analyser (bison) */ +{disable_code_generation_pragma} return disable_code_generation_pragma_token; +{enable_code_generation_pragma} return enable_code_generation_pragma_token; +{disable_code_generation_pragma} return disable_code_generation_pragma_token; +{enable_code_generation_pragma} return enable_code_generation_pragma_token; + + /* Any other pragma we find, we just pass it up to the syntax parser... */ + /* Note that the state is exclusive, so we have to include it here too. */ +{pragma} {/* return the pragmma without the enclosing '{' and '}' */ + yytext[strlen(yytext)-1] = '\0'; + yylval.ID=strdup(yytext+1); + return pragma_token; + } +{pragma} {/* return the pragmma without the enclosing '{' and '}' */ + yytext[strlen(yytext)-1] = '\0'; + yylval.ID=strdup(yytext+1); + return pragma_token; + } + + + /*********************************/ + /* Handle the file includes! */ + /*********************************/ +{file_include_pragma_beg} BEGIN(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)); + /* switch to whatever state was active before the include file */ + yy_pop_state(); + /* now process the new file... */ + } + + +<> { /* 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!) + */ + free(current_tracking); + if (include_stack_ptr == 0) { + /* yyterminate() terminates the scanner and returns a 0 to the + * scanner's caller, indicating "all done". + * + * Our syntax parser (written with bison) has the token + * END_OF_INPUT associated to the value 0, so even though + * we don't explicitly return the token END_OF_INPUT + * calling yyterminate() is equivalent to doing that. + */ + yyterminate(); + } + else { + --include_stack_ptr; + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer((include_stack[include_stack_ptr]).buffer_state); + current_tracking = include_stack[include_stack_ptr].env; + /* removing constness of char *. This is safe actually, + * since the only real const char * that is stored on the stack is + * the first one (i.e. the one that gets stored in include_stack[0], + * which is never free'd! + */ + /* NOTE: We do __NOT__ free the malloc()'d memory since + * pointers to this filename will be kept by many objects + * in the abstract syntax tree. + * This will later be used to provide correct error + * messages during semantic analysis (stage 3) + */ + /* free((char *)current_filename); */ + current_filename = include_stack[include_stack_ptr].filename; + yy_push_state(include_end); + } + } + +{file_include_pragma_end} yy_pop_state(); + + + /*********************************/ + /* Handle all the state changes! */ + /*********************************/ + + /* INITIAL -> decl_state */ +{ + /* NOTE: how about functions that do not declare variables, and go directly to the body_state??? + * - According to Section 2.5.1.3 (Function Declaration), item 2 in the list, a FUNCTION + * must have at least one input argument, so a correct declaration will have at least + * one VAR_INPUT ... VAR_END construct! + * - According to Section 2.5.2.2 (Function Block Declaration), a FUNCTION_BLOCK + * must have at least one input argument, so a correct declaration will have at least + * one VAR_INPUT ... VAR_END construct! + * - According to Section 2.5.3 (Programs), a PROGRAM must have at least one input + * argument, so a correct declaration will have at least one VAR_INPUT ... VAR_END + * construct! + * + * All the above means that we needn't worry about PROGRAMs, FUNCTIONs or + * FUNCTION_BLOCKs that do not have at least one VAR_END before the body_state. + * If the code has an error, and no VAR_END before the body, we will simply + * continue in the state, untill the end of the FUNCTION, FUNCTION_BLOCK + * or PROGAM. + */ +FUNCTION BEGIN(decl_state); return FUNCTION; +FUNCTION_BLOCK BEGIN(decl_state); return FUNCTION_BLOCK; +PROGRAM BEGIN(decl_state); return PROGRAM; +CONFIGURATION BEGIN(config_state); return CONFIGURATION; +} + + /* INITIAL -> body_state */ + /* required if the function, program, etc.. has no VAR block! */ + /* We comment it out since the standard does not allow this. */ + /* NOTE: Even if we were to include the following code, it */ + /* would have no effect whatsoever since the above */ + /* rules will take precendence! */ + /* +{ +FUNCTION BEGIN(body_state); return FUNCTION; +FUNCTION_BLOCK BEGIN(body_state); return FUNCTION_BLOCK; +PROGRAM BEGIN(body_state); return PROGRAM; +} + */ + + /* decl_state -> (body_state | sfc_state) */ +{ +END_VAR{st_whitespace}VAR {unput_text(strlen("END_VAR")); + return END_VAR; + } +END_VAR{st_whitespace}INITIAL_STEP {unput_text(strlen("END_VAR")); + yy_push_state(sfc_state); + return END_VAR; + } +END_VAR{st_whitespace} {unput_text(strlen("END_VAR")); + cmd_goto_body_state(); + return END_VAR; + } +} + + /* body_state -> (il_state | st_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}"[" 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); +WHILE 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); + + /* Hopefully, the above rules (along with the last one), + * used to distinguish ST from IL, are + * enough to handle all ocurrences. However, if + * there is some situation where the compiler is getting confused, + * we add the following rule to detect 'label:' in IL code. This will + * allow the user to insert a label right at the beginning (which + * will probably not be used further by his code) simply as a way + * to force the compiler to interpret his code as IL code. + */ +{identifier}{st_whitespace}":"{st_whitespace} unput_text(0); BEGIN(il_state); + +{identifier} {int token = get_identifier_token(yytext); + if (token == prev_declared_fb_name_token) { + /* the code has a call to a function block */ + /* NOTE: if we ever decide to allow the user to use IL operator tokens + * (LD, ST, ...) as identifiers for variable names (including + * function block instances), then the above inference/conclusion + * may be incorrect, and this condition may have to be changed! + */ + BEGIN(st_state); + } else { + BEGIN(il_state); + } + unput_text(0); + } + +. unput_text(0); BEGIN(il_state); +} /* end of body_state lexical parser */ + + /* (il_state | st_state) -> $previous_state (decl_state or sfc_state) */ +{ +END_FUNCTION yy_pop_state(); unput_text(0); +END_FUNCTION_BLOCK yy_pop_state(); unput_text(0); +END_PROGRAM yy_pop_state(); unput_text(0); +END_TRANSITION yy_pop_state(); unput_text(0); +END_ACTION yy_pop_state(); unput_text(0); +} + + /* sfc_state -> INITIAL */ +{ +END_FUNCTION yy_pop_state(); unput_text(0); +END_FUNCTION_BLOCK yy_pop_state(); unput_text(0); +END_PROGRAM yy_pop_state(); unput_text(0); +} + + /* decl_state -> INITIAL */ +{ +END_FUNCTION BEGIN(INITIAL); return END_FUNCTION; +END_FUNCTION_BLOCK BEGIN(INITIAL); return END_FUNCTION_BLOCK; +END_PROGRAM BEGIN(INITIAL); return END_PROGRAM; +} + /* config -> INITIAL */ +END_CONFIGURATION BEGIN(INITIAL); return END_CONFIGURATION; + + + + /***************************************/ + /* Next is to to remove all whitespace */ + /***************************************/ + /* NOTE: pragmas are handled right at the beginning... */ + +{st_whitespace_no_pragma} /* Eat any whitespace */ +{il_whitespace_no_pragma} /* Eat any whitespace */ + + + + /*****************************************/ + /* B.1.1 Letters, digits and identifiers */ + /*****************************************/ + /* NOTE: 'R1', 'IN', etc... are IL operators, and therefore tokens + * On the other hand, the spec does not define them as keywords, + * which means they may be re-used for variable names, etc...! + * The syntax parser already caters for the possibility of these + * tokens being used for variable names in their declarations. + * When they are declared, they will be added to the variable symbol table! + * Further appearances of these tokens must no longer be parsed + * as R1_tokens etc..., but rather as variable_name_tokens! + * + * That is why the first thing we do with identifiers, even before + * checking whether they may be a 'keyword', is to check whether + * they have been previously declared as a variable name, + * + * However, we have a dilema! Should we here also check for + * prev_declared_derived_function_name_token? + * If we do, then the 'MOD' default library function (defined in + * the standard) will always be returned as a function name, and + * it will therefore not be possible to use it as an operator as + * in the following ST expression 'X := Y MOD Z;' ! + * If we don't, then even it will not be possible to use 'MOD' + * as a funtion as in 'X := MOD(Y, Z);' + * We solve this by NOT testing for function names here, and + * handling this function and keyword clash in bison! + */ + /* +{identifier} {int token = get_identifier_token(yytext); + // fprintf(stderr, "flex: analysing identifier '%s'...", yytext); + if ((token == prev_declared_variable_name_token) || +// (token == prev_declared_derived_function_name_token) || // DO NOT add this condition! + (token == prev_declared_fb_name_token)) { + // if (token != identifier_token) + // * NOTE: if we replace the above uncommented conditions with + * the simple test of (token != identifier_token), then + * 'MOD' et al must be removed from the + * library_symbol_table as a default function name! + * // + yylval.ID=strdup(yytext); + // fprintf(stderr, "returning token %d\n", token); + return token; + } + // otherwise, leave it for the other lexical parser rules... + // fprintf(stderr, "rejecting\n"); + REJECT; + } + */ + + /******************************************************/ + /******************************************************/ + /******************************************************/ + /***** *****/ + /***** *****/ + /***** N O W D O T H E K E Y W O R D S *****/ + /***** *****/ + /***** *****/ + /******************************************************/ + /******************************************************/ + /******************************************************/ + + +EN return EN; /* Keyword */ +ENO return ENO; /* Keyword */ + + + /******************************/ + /* B 1.2.1 - Numeric Literals */ + /******************************/ +TRUE return TRUE; /* Keyword */ +BOOL#1 return boolean_true_literal_token; +BOOL#TRUE return boolean_true_literal_token; +SAFEBOOL#1 {if (get_opt_safe_extensions()) {return safeboolean_true_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ +SAFEBOOL#TRUE {if (get_opt_safe_extensions()) {return safeboolean_true_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ + +FALSE return FALSE; /* Keyword */ +BOOL#0 return boolean_false_literal_token; +BOOL#FALSE return boolean_false_literal_token; +SAFEBOOL#0 {if (get_opt_safe_extensions()) {return safeboolean_false_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ +SAFEBOOL#FALSE {if (get_opt_safe_extensions()) {return safeboolean_false_literal_token;} else{REJECT;}} /* Keyword (Data Type) */ + + + /************************/ + /* B 1.2.3.1 - Duration */ + /************************/ +t# return T_SHARP; /* Delimiter */ +T# return T_SHARP; /* Delimiter */ +TIME return TIME; /* Keyword (Data Type) */ + + + /************************************/ + /* B 1.2.3.2 - Time of day and Date */ + /************************************/ +TIME_OF_DAY return TIME_OF_DAY; /* Keyword (Data Type) */ +TOD return TIME_OF_DAY; /* Keyword (Data Type) */ +DATE return DATE; /* Keyword (Data Type) */ +d# return D_SHARP; /* Delimiter */ +D# return D_SHARP; /* Delimiter */ +DATE_AND_TIME return DATE_AND_TIME; /* Keyword (Data Type) */ +DT return DATE_AND_TIME; /* Keyword (Data Type) */ + + + /***********************************/ + /* B 1.3.1 - Elementary Data Types */ + /***********************************/ +BOOL return BOOL; /* Keyword (Data Type) */ + +BYTE return BYTE; /* Keyword (Data Type) */ +WORD return WORD; /* Keyword (Data Type) */ +DWORD return DWORD; /* Keyword (Data Type) */ +LWORD return LWORD; /* Keyword (Data Type) */ + +SINT return SINT; /* Keyword (Data Type) */ +INT return INT; /* Keyword (Data Type) */ +DINT return DINT; /* Keyword (Data Type) */ +LINT return LINT; /* Keyword (Data Type) */ + +USINT return USINT; /* Keyword (Data Type) */ +UINT return UINT; /* Keyword (Data Type) */ +UDINT return UDINT; /* Keyword (Data Type) */ +ULINT return ULINT; /* Keyword (Data Type) */ + +REAL return REAL; /* Keyword (Data Type) */ +LREAL return LREAL; /* Keyword (Data Type) */ + +WSTRING return WSTRING; /* Keyword (Data Type) */ +STRING return STRING; /* Keyword (Data Type) */ + +TIME return TIME; /* Keyword (Data Type) */ +DATE return DATE; /* Keyword (Data Type) */ +DT return DT; /* Keyword (Data Type) */ +TOD return TOD; /* Keyword (Data Type) */ +DATE_AND_TIME return DATE_AND_TIME; /* Keyword (Data Type) */ +TIME_OF_DAY return TIME_OF_DAY; /* Keyword (Data Type) */ + + /*****************************************************************/ + /* Keywords defined in "Safety Software Technical Specification" */ + /*****************************************************************/ + /* + * NOTE: The following keywords are define in + * "Safety Software Technical Specification, + * Part 1: Concepts and Function Blocks, + * Version 1.0 – Official Release" + * written by PLCopen - Technical Committee 5 + * + * We only support these extensions and keywords + * if the apropriate command line option is given. + */ +SAFEBOOL {if (get_opt_safe_extensions()) {return SAFEBOOL;} else {REJECT;}} + +SAFEBYTE {if (get_opt_safe_extensions()) {return SAFEBYTE;} else {REJECT;}} +SAFEWORD {if (get_opt_safe_extensions()) {return SAFEWORD;} else {REJECT;}} +SAFEDWORD {if (get_opt_safe_extensions()) {return SAFEDWORD;} else{REJECT;}} +SAFELWORD {if (get_opt_safe_extensions()) {return SAFELWORD;} else{REJECT;}} + +SAFEREAL {if (get_opt_safe_extensions()) {return SAFESINT;} else{REJECT;}} +SAFELREAL {if (get_opt_safe_extensions()) {return SAFELREAL;} else{REJECT;}} + +SAFESINT {if (get_opt_safe_extensions()) {return SAFESINT;} else{REJECT;}} +SAFEINT {if (get_opt_safe_extensions()) {return SAFEINT;} else{REJECT;}} +SAFEDINT {if (get_opt_safe_extensions()) {return SAFEDINT;} else{REJECT;}} +SAFELINT {if (get_opt_safe_extensions()) {return SAFELINT;} else{REJECT;}} + +SAFEUSINT {if (get_opt_safe_extensions()) {return SAFEUSINT;} else{REJECT;}} +SAFEUINT {if (get_opt_safe_extensions()) {return SAFEUINT;} else{REJECT;}} +SAFEUDINT {if (get_opt_safe_extensions()) {return SAFEUDINT;} else{REJECT;}} +SAFEULINT {if (get_opt_safe_extensions()) {return SAFEULINT;} else{REJECT;}} + + /* SAFESTRING and SAFEWSTRING are not yet supported, i.e. checked correctly, in the semantic analyser (stage 3) */ + /* so it is best not to support them at all... */ + /* +SAFEWSTRING {if (get_opt_safe_extensions()) {return SAFEWSTRING;} else{REJECT;}} +SAFESTRING {if (get_opt_safe_extensions()) {return SAFESTRING;} else{REJECT;}} + */ + +SAFETIME {if (get_opt_safe_extensions()) {return SAFETIME;} else{REJECT;}} +SAFEDATE {if (get_opt_safe_extensions()) {return SAFEDATE;} else{REJECT;}} +SAFEDT {if (get_opt_safe_extensions()) {return SAFEDT;} else{REJECT;}} +SAFETOD {if (get_opt_safe_extensions()) {return SAFETOD;} else{REJECT;}} +SAFEDATE_AND_TIME {if (get_opt_safe_extensions()) {return SAFEDATE_AND_TIME;} else{REJECT;}} +SAFETIME_OF_DAY {if (get_opt_safe_extensions()) {return SAFETIME_OF_DAY;} else{REJECT;}} + + /********************************/ + /* B 1.3.2 - Generic data types */ + /********************************/ + /* Strangely, the following symbols do not seem to be required! */ + /* But we include them so they become reserved words, and do not + * get passed up to bison as an identifier... + */ +ANY return ANY; /* Keyword (Data Type) */ +ANY_DERIVED return ANY_DERIVED; /* Keyword (Data Type) */ +ANY_ELEMENTARY return ANY_ELEMENTARY; /* Keyword (Data Type) */ +ANY_MAGNITUDE return ANY_MAGNITUDE; /* Keyword (Data Type) */ +ANY_NUM return ANY_NUM; /* Keyword (Data Type) */ +ANY_REAL return ANY_REAL; /* Keyword (Data Type) */ +ANY_INT return ANY_INT; /* Keyword (Data Type) */ +ANY_BIT return ANY_BIT; /* Keyword (Data Type) */ +ANY_STRING return ANY_STRING; /* Keyword (Data Type) */ +ANY_DATE return ANY_DATE; /* Keyword (Data Type) */ + + + /********************************/ + /* B 1.3.3 - Derived data types */ + /********************************/ +":=" return ASSIGN; /* Delimiter */ +".." return DOTDOT; /* Delimiter */ +TYPE return TYPE; /* Keyword */ +END_TYPE return END_TYPE; /* Keyword */ +ARRAY return ARRAY; /* Keyword */ +OF return OF; /* Keyword */ +STRUCT return STRUCT; /* Keyword */ +END_STRUCT return END_STRUCT; /* Keyword */ + + + /*********************/ + /* B 1.4 - Variables */ + /*********************/ + + /******************************************/ + /* B 1.4.3 - Declaration & Initialisation */ + /******************************************/ +VAR_INPUT return VAR_INPUT; /* Keyword */ +VAR_OUTPUT return VAR_OUTPUT; /* Keyword */ +VAR_IN_OUT return VAR_IN_OUT; /* Keyword */ +VAR_EXTERNAL return VAR_EXTERNAL; /* Keyword */ +VAR_GLOBAL return VAR_GLOBAL; /* Keyword */ +END_VAR return END_VAR; /* Keyword */ +RETAIN return RETAIN; /* Keyword */ +NON_RETAIN return NON_RETAIN; /* Keyword */ +R_EDGE return R_EDGE; /* Keyword */ +F_EDGE return F_EDGE; /* Keyword */ +AT return AT; /* Keyword */ + + + /***********************/ + /* B 1.5.1 - Functions */ + /***********************/ +FUNCTION return FUNCTION; /* Keyword */ +END_FUNCTION return END_FUNCTION; /* Keyword */ +VAR return VAR; /* Keyword */ +CONSTANT return CONSTANT; /* Keyword */ + + + /*****************************/ + /* B 1.5.2 - Function Blocks */ + /*****************************/ +FUNCTION_BLOCK return FUNCTION_BLOCK; /* Keyword */ +END_FUNCTION_BLOCK return END_FUNCTION_BLOCK; /* Keyword */ +VAR_TEMP return VAR_TEMP; /* Keyword */ +VAR return VAR; /* Keyword */ +NON_RETAIN return NON_RETAIN; /* Keyword */ +END_VAR return END_VAR; /* Keyword */ + + + /**********************/ + /* B 1.5.3 - Programs */ + /**********************/ +PROGRAM return PROGRAM; /* Keyword */ +END_PROGRAM return END_PROGRAM; /* Keyword */ + + + /********************************************/ + /* B 1.6 Sequential Function Chart elements */ + /********************************************/ + /* NOTE: the following identifiers/tokens clash with the R and S IL operators, as well + .* as other identifiers that may be used as variable names inside IL and ST programs. + * They will have to be handled when we include parsing of SFC... For now, simply + * ignore them! + */ + +ACTION return ACTION; /* Keyword */ +END_ACTION return END_ACTION; /* Keyword */ + +TRANSITION return TRANSITION; /* Keyword */ +END_TRANSITION return END_TRANSITION; /* Keyword */ +FROM return FROM; /* Keyword */ +TO return TO; /* Keyword */ + +INITIAL_STEP return INITIAL_STEP; /* Keyword */ +STEP return STEP; /* Keyword */ +END_STEP return END_STEP; /* Keyword */ + + /* PRIORITY is not a keyword, so we only return it when + * it is explicitly required and we are not expecting any identifiers + * that could also use the same letter sequence (i.e. an identifier: piority) + */ +PRIORITY return PRIORITY; + +{ +L return L; +D return D; +SD return SD; +DS return DS; +SL return SL; +N return N; +P return P; +R return R; +S return S; +} + + + /********************************/ + /* B 1.7 Configuration elements */ + /********************************/ +CONFIGURATION return CONFIGURATION; /* Keyword */ +END_CONFIGURATION return END_CONFIGURATION; /* Keyword */ +TASK return TASK; /* Keyword */ +RESOURCE return RESOURCE; /* Keyword */ +ON return ON; /* Keyword */ +END_RESOURCE return END_RESOURCE; /* Keyword */ +VAR_CONFIG return VAR_CONFIG; /* Keyword */ +VAR_ACCESS return VAR_ACCESS; /* Keyword */ +END_VAR return END_VAR; /* Keyword */ +WITH return WITH; /* Keyword */ +PROGRAM return PROGRAM; /* Keyword */ +RETAIN return RETAIN; /* Keyword */ +NON_RETAIN return NON_RETAIN; /* Keyword */ +READ_WRITE return READ_WRITE; /* Keyword */ +READ_ONLY return READ_ONLY; /* Keyword */ + + /* PRIORITY, SINGLE and INTERVAL are not a keywords, so we only return them when + * it is explicitly required and we are not expecting any identifiers + * that could also use the same letter sequence (i.e. an identifier: piority, ...) + */ +{ +PRIORITY return PRIORITY; +SINGLE return SINGLE; +INTERVAL return INTERVAL; +} + + /***********************************/ + /* B 2.1 Instructions and Operands */ + /***********************************/ +\n return EOL; + + + /*******************/ + /* B 2.2 Operators */ + /*******************/ + /* NOTE: we can't have flex return the same token for + * ANDN and &N, neither for AND and &, since + * AND and ANDN are considered valid variable + * function or functionblock type names! + * This means that the parser may decide that the + * AND or ANDN strings found in the source code + * are being used as variable names + * and not as operators, and will therefore transform + * these tokens into indentifier tokens! + * We can't have the parser thinking that the source + * code contained the string AND (which may be interpreted + * as a vairable name) when in reality the source code + * merely contained the character &, so we use two + * different tokens for & and AND (and similarly + * ANDN and &N)! + */ + /* The following tokens clash with ST expression operators and Standard Functions */ + /* They are also keywords! */ +AND return AND; /* Keyword */ +MOD return MOD; /* Keyword */ +OR return OR; /* Keyword */ +XOR return XOR; /* Keyword */ +NOT return NOT; /* Keyword */ + + /* The following tokens clash with Standard Functions */ + /* They are keywords because they are a function name */ +{ +ADD return ADD; /* Keyword (Standard Function) */ +DIV return DIV; /* Keyword (Standard Function) */ +EQ return EQ; /* Keyword (Standard Function) */ +GE return GE; /* Keyword (Standard Function) */ +GT return GT; /* Keyword (Standard Function) */ +LE return LE; /* Keyword (Standard Function) */ +LT return LT; /* Keyword (Standard Function) */ +MUL return MUL; /* Keyword (Standard Function) */ +NE return NE; /* Keyword (Standard Function) */ +SUB return SUB; /* Keyword (Standard Function) */ +} + + /* The following tokens clash with SFC action qualifiers */ + /* They are not keywords! */ +{ +S return S; +R return R; +} + + /* The following tokens clash with ST expression operators */ +& return AND2; /* NOT a Delimiter! */ + + /* The following tokens have no clashes */ + /* They are not keywords! */ +{ +LD return LD; +LDN return LDN; +ST return ST; +STN return STN; +S1 return S1; +R1 return R1; +CLK return CLK; +CU return CU; +CD return CD; +PV return PV; +IN return IN; +PT return PT; +ANDN return ANDN; +&N return ANDN2; +ORN return ORN; +XORN return XORN; +CAL return CAL; +CALC return CALC; +CALCN return CALCN; +RET return RET; +RETC return RETC; +RETCN return RETCN; +JMP return JMP; +JMPC return JMPC; +JMPCN return JMPCN; +} + + /***********************/ + /* B 3.1 - Expressions */ + /***********************/ +"**" return OPER_EXP; /* NOT a Delimiter! */ +"<>" return OPER_NE; /* NOT a Delimiter! */ +">=" return OPER_GE; /* NOT a Delimiter! */ +"<=" return OPER_LE; /* NOT a Delimiter! */ +& return AND2; /* NOT a Delimiter! */ +AND return AND; /* Keyword */ +XOR return XOR; /* Keyword */ +OR return OR; /* Keyword */ +NOT return NOT; /* Keyword */ +MOD return MOD; /* Keyword */ + + + /*****************************************/ + /* B 3.2.2 Subprogram Control Statements */ + /*****************************************/ +:= return ASSIGN; /* Delimiter */ +=> return SENDTO; /* Delimiter */ +RETURN return RETURN; /* Keyword */ + + + /********************************/ + /* B 3.2.3 Selection Statements */ + /********************************/ +IF return IF; /* Keyword */ +THEN return THEN; /* Keyword */ +ELSIF return ELSIF; /* Keyword */ +ELSE return ELSE; /* Keyword */ +END_IF return END_IF; /* Keyword */ + +CASE return CASE; /* Keyword */ +OF return OF; /* Keyword */ +ELSE return ELSE; /* Keyword */ +END_CASE return END_CASE; /* Keyword */ + + + /********************************/ + /* B 3.2.4 Iteration Statements */ + /********************************/ +FOR return FOR; /* Keyword */ +TO return TO; /* Keyword */ +BY return BY; /* Keyword */ +DO return DO; /* Keyword */ +END_FOR return END_FOR; /* Keyword */ + +WHILE return WHILE; /* Keyword */ +DO return DO; /* Keyword */ +END_WHILE return END_WHILE; /* Keyword */ + +REPEAT return REPEAT; /* Keyword */ +UNTIL return UNTIL; /* Keyword */ +END_REPEAT return END_REPEAT; /* Keyword */ + +EXIT return EXIT; /* Keyword */ + + + + + + + /********************************************************/ + /********************************************************/ + /********************************************************/ + /***** *****/ + /***** *****/ + /***** N O W W O R K W I T H V A L U E S *****/ + /***** *****/ + /***** *****/ + /********************************************************/ + /********************************************************/ + /********************************************************/ + + + /********************************************/ + /* B.1.4.1 Directly Represented Variables */ + /********************************************/ +{direct_variable} {yylval.ID=strdup(yytext); return get_direct_variable_token(yytext);} + + + /******************************************/ + /* B 1.4.3 - Declaration & Initialisation */ + /******************************************/ +{incompl_location} {yylval.ID=strdup(yytext); return incompl_location_token;} + + + /************************/ + /* B 1.2.3.1 - Duration */ + /************************/ +{fixed_point} {yylval.ID=strdup(yytext); return fixed_point_token;} + +{fixed_point_d} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_d_token;} +{integer_d} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_d_token;} + +{fixed_point_h} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_h_token;} +{integer_h} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_h_token;} + +{fixed_point_m} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_m_token;} +{integer_m} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_m_token;} + +{fixed_point_s} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return fixed_point_s_token;} +{integer_s} {yylval.ID=strdup(yytext); yylval.ID[yyleng-1] = '\0'; return integer_s_token;} + +{fixed_point_ms} {yylval.ID=strdup(yytext); yylval.ID[yyleng-2] = '\0'; return fixed_point_ms_token;} +{integer_ms} {yylval.ID=strdup(yytext); yylval.ID[yyleng-2] = '\0'; return integer_ms_token;} + + + /*******************************/ + /* B.1.2.2 Character Strings */ + /*******************************/ +{double_byte_character_string} {yylval.ID=strdup(yytext); return double_byte_character_string_token;} +{single_byte_character_string} {yylval.ID=strdup(yytext); return single_byte_character_string_token;} + + + /******************************/ + /* B.1.2.1 Numeric literals */ + /******************************/ +{integer} {yylval.ID=strdup(yytext); return integer_token;} +{real} {yylval.ID=strdup(yytext); return real_token;} +{binary_integer} {yylval.ID=strdup(yytext); return binary_integer_token;} +{octal_integer} {yylval.ID=strdup(yytext); return octal_integer_token;} +{hex_integer} {yylval.ID=strdup(yytext); return hex_integer_token;} + + + /*****************************************/ + /* B.1.1 Letters, digits and identifiers */ + /*****************************************/ +{identifier}/({st_whitespace})"=>" {yylval.ID=strdup(yytext); return sendto_identifier_token;} +{identifier}/({il_whitespace})"=>" {yylval.ID=strdup(yytext); return sendto_identifier_token;} +{identifier} {yylval.ID=strdup(yytext); + // printf("returning identifier...: %s, %d\n", yytext, get_identifier_token(yytext)); + return get_identifier_token(yytext);} + + + + + + + /************************************************/ + /************************************************/ + /************************************************/ + /***** *****/ + /***** *****/ + /***** T H E L E F T O V E R S . . . *****/ + /***** *****/ + /***** *****/ + /************************************************/ + /************************************************/ + /************************************************/ + + /* do the single character tokens... + * + * e.g.: ':' '(' ')' '+' '*' ... + */ +. {return yytext[0];} + + +%% + + +/***********************************/ +/* Utility function definitions... */ +/***********************************/ + +/* print the include file stack to stderr... */ +void print_include_stack(void) { + int i; + + if ((include_stack_ptr - 1) >= 0) + fprintf (stderr, "in file "); + for (i = include_stack_ptr - 1; i >= 0; i--) + fprintf (stderr, "included from file %s:%d\n", include_stack[i].filename, include_stack[i].env->lineNumber); +} + + +/* 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 + * if we return newlines back to the input stream. These newlines will be re-counted + * a second time when they are processed again by flex. + * We therefore determine how many newlines are in the text we are returning, + * and decrement the line counter acordingly... + */ + /*unsigned int i; + + for (i = n; i < strlen(yytext); i++) + if (yytext[i] == '\n') + current_tracking->lineNumber--;*/ + + /* now return all the text back to the input stream... */ + yyless(n); +} + + +/* Called by flex when it reaches the end-of-file */ +int yywrap(void) +{ + /* We reached the end of the input file... */ + + /* Should we continue with another file? */ + /* If so: + * open the new file... + * return 0; + */ + + /* to we stop processing... + * + * return 1; + */ + + + return 1; /* Stop scanning at end of input file. */ +} + + + +/*************************************/ +/* Include a main() function to test */ +/* the token parsing by flex.... */ +/*************************************/ +#ifdef TEST_MAIN + +#include "../util/symtable.hh" + +yystype yylval; +YYLTYPE yylloc; + +const char *current_filename; + + + +int get_identifier_token(const char *identifier_str) {return 0;} +int get_direct_variable_token(const char *direct_variable_str) {return 0;} + + +int main(int argc, char **argv) { + + FILE *in_file; + int res; + + if (argc == 1) { + /* Work as an interactive (command line) parser... */ + while((res=yylex())) + fprintf(stderr, "(line %d)token: %d\n", yylineno, res); + } else { + /* Work as non-interactive (file) parser... */ + if((in_file = fopen(argv[1], "r")) == NULL) { + char *errmsg = strdup2("Error opening main file ", argv[1]); + perror(errmsg); + free(errmsg); + return -1; + } + + /* parse the file... */ + yyin = in_file; + current_filename = argv[1]; + while(1) { + res=yylex(); + fprintf(stderr, "(line %d)token: %d (%s)\n", yylineno, res, yylval.ID); + } + } + + return 0; + +} +#endif diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/stage1_2.cc --- a/stage1_2/stage1_2.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage1_2/stage1_2.cc Thu Sep 08 20:25:00 2011 +0200 @@ -44,7 +44,7 @@ #include "stage1_2.hh" -#include "iec.y.hh" +#include "iec_bison.h" #include "stage1_2_priv.hh" @@ -127,14 +127,14 @@ /* NOTE: only accessed indirectly by the lexical parser (flex) * through the function get_identifier_token() */ -/* NOTE: BOGUS_TOKEN_ID is defined in the bison generated file iec.y.hh. +/* NOTE: BOGUS_TOKEN_ID is defined in the bison generated file iec_bison.h. * We need this constant defined before we can declare the symbol tables. - * However, we cannot #include "iec.y.hh" in this file (stage1_2_priv.hh) directly + * However, we cannot #include "iec_bison.h" in this file (stage1_2_priv.hh) directly * because of the way bison ver. 3.2 is copying all declarations in the prologue - * of iec.y to the iec.y.hh file (including an #include stage1_2_priv.hh). - * So, if we were to include "iec.y.hh" here, we would get a circular include. + * of iec.y to the iec_bison.h file (including an #include stage1_2_priv.hh). + * So, if we were to include "iec_bison.h" here, we would get a circular include. * All this means that whoever includes this file (stage1_2_priv.hh) will need - * to take care to first inlcude iec.y.hh !! + * to take care to first inlcude iec_bison.h !! */ /* A symbol table to store all the library elements */ /* e.g.: diff -r b826f13c260e -r 7a11f9e9e703 stage1_2/stage1_2_priv.hh --- a/stage1_2/stage1_2_priv.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/stage1_2/stage1_2_priv.hh Thu Sep 08 20:25:00 2011 +0200 @@ -40,10 +40,10 @@ /* !!! WARNING !!! * * Whoever includes this file (stage1_2_priv.hh) will need - * to first inlcude iec.y.hh !! + * to first inlcude iec_bison.h !! * * Read other comments further down to understand why we don't - * include iec.y.hh in this file. + * include iec_bison.h in this file. */ @@ -186,14 +186,14 @@ * * In essence, they are a data passing mechanism between Bison and Flex. */ -/* NOTE: BOGUS_TOKEN_ID is defined in the bison generated file iec.y.hh. +/* NOTE: BOGUS_TOKEN_ID is defined in the bison generated file iec_bison.h. * We need this constant defined before we can declare the symbol tables. - * However, we cannot #include "iec.y.hh" in this file (stage1_2_priv.hh) directly + * However, we cannot #include "iec_bison.h" in this file (stage1_2_priv.hh) directly * because of the way bison ver. 2.3 is copying all declarations in the prologue - * of iec.y to the iec.y.hh file (including an #include stage1_2_priv.hh). - * So, if we were to include "iec.y.hh" here, we would get a circular include. + * of iec.y to the iec_bison.h file (including an #include stage1_2_priv.hh). + * So, if we were to include "iec_bison.h" here, we would get a circular include. * All this means that whoever includes this file (stage1_2_priv.hh) will need - * to take care to first inlcude iec.y.hh !! + * to take care to first inlcude iec_bison.h !! */ /* A symbol table to store all the library elements */ /* e.g.: diff -r b826f13c260e -r 7a11f9e9e703 stage3/Makefile --- a/stage3/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +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 . - -# include the system specific Makefile -include ../Makefile.$(shell uname) - -STAGE3_FILES = stage3.o -STAGE3_FILES += visit_expression_type.o - -default: all - -all: $(STAGE3_FILES) - - - -clean: - rm -f *.o Makefile.depend - - -CXXFLAGS += -I. -I../* - - - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend diff -r b826f13c260e -r 7a11f9e9e703 stage3/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage3/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,8 @@ +include ../common.mk + +lib_LIBRARIES = libstage3.a + +libstage3_a_SOURCES = \ + stage3.cc \ + visit_expression_type.cc + diff -r b826f13c260e -r 7a11f9e9e703 stage3/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage3/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,488 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 = 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__installdirs = "$(DESTDIR)$(libdir)" +LIBRARIES = $(lib_LIBRARIES) +AR = ar +ARFLAGS = cru +libstage3_a_AR = $(AR) $(ARFLAGS) +libstage3_a_LIBADD = +am_libstage3_a_OBJECTS = stage3.$(OBJEXT) \ + visit_expression_type.$(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 \ + visit_expression_type.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; + +$(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|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ + cd "$(DESTDIR)$(libdir)" && rm -f $$files + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libstage3.a: $(libstage3_a_OBJECTS) $(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)/stage3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visit_expression_type.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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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: diff -r b826f13c260e -r 7a11f9e9e703 stage3/visit_expression_type.cc --- a/stage3/visit_expression_type.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage3/visit_expression_type.cc Thu Sep 08 20:25:00 2011 +0200 @@ -605,39 +605,6 @@ -#define is_num_type is_ANY_NUM_compatible -#define is_integer_type is_ANY_INT_compatible -#define is_real_type is_ANY_REAL_compatible -#define is_binary_type is_ANY_BIT_compatible - /* actually the ROR, ROL, SHL, and SHR function also accept boolean type! */ -#define is_nbinary_type is_ANY_BIT_compatible -#define compute_standard_function_default visit_expression_type_c::compute_standard_function_default -#define compute_standard_function_il visit_expression_type_c::compute_standard_function_il -#define search_expression_type_c visit_expression_type_c -#define search(x) search_f(x) -#define next() next_nf() -// #define search_constant_type_c::constant_int_type_name search_expression_type_c::integer -#define constant_int_type_name integer -#define is_same_type is_compatible_type -#include "../absyntax_utils/search_type_code.c" -#undef is_same_type -#undef constant_int_type_name -// #undef search_constant_type_c::constant_int_type_name -#undef next -#undef search -#undef compute_standard_function_default -#undef compute_standard_function_il -#undef search_expression_type_c -#undef is_real_type -#undef is_binary_type -#undef is_nbinary_type -#undef is_integer_type -#undef is_num_type - - - - - /* A helper function... */ /* @@ -674,58 +641,25 @@ } -# if 0 -/* A helper function... */ -symbol_c *visit_expression_type_c::compute_numeric_expression(symbol_c *left_type, symbol_c *right_type, - is_data_type_t is_data_type) { - bool error = false; - - if (!(this->*is_data_type)(left_type)) { - STAGE3_ERROR(left_type, right_type, "Invalid data type of left operand."); - error = true; - } - if (!(this->*is_data_type)(right_type)) { - STAGE3_ERROR(left_type, right_type, "Invalid data type of right operand."); - error = true; - } - if (!is_compatible_type(left_type, right_type)) { - STAGE3_ERROR(left_type, right_type, "Type mismatch between operands."); - error = true; - } - -/* - if (is_literal_integer_type(left_type) || is_literal_real_type(left_type)) { - return right_type; - } else { - return left_type; - } -*/ - - if (error) - return NULL; - else - return common_type(left_type, right_type); - - /* humour the compiler... */ -/* - return NULL; -*/ -} -#endif - - - /* A helper function... */ /* check the semantics of a FB or Function non-formal call */ /* e.g. foo(1, 2, 3, 4); */ -void visit_expression_type_c::check_nonformal_call(symbol_c *f_call, symbol_c *f_decl, bool use_il_defvar) { +/* If error_count pointer is != NULL, we do not really print out the errors, + * but rather only count how many errors were found. + * This is used to support overloaded functions, where we have to check each possible + * function, one at a time, untill we find a function call without any errors. + */ +void visit_expression_type_c::check_nonformal_call(symbol_c *f_call, symbol_c *f_decl, bool use_il_defvar, int *error_count) { symbol_c *call_param_value, *call_param_type, *param_type; identifier_c *param_name; function_param_iterator_c fp_iterator(f_decl); function_call_param_iterator_c fcp_iterator(f_call); - + int extensible_parameter_highest_index = -1; + + /* reset error counter */ + if (error_count != NULL) *error_count = 0; /* if use_il_defvar, then the first parameter for the call comes from the il_default_variable */ if (use_il_defvar) { /* The first parameter of the function corresponds to the il_default_variable_type of the function call */ @@ -740,20 +674,48 @@ } while ((strcmp(param_name->value, "EN") == 0) || (strcmp(param_name->value, "ENO") == 0)); /* If the function does not have any parameters (param_name == NULL) * then we cannot compare its type with the il_default_variable_type. + * + * However, I (Mario) think this is invalid syntax, as it seems to me all functions must + * have at least one parameter. + * However, we will make this semantic verification consider it possible, as later + * versions of the standard may change that syntax. + * So, instead of generating a syntax error message, we simply check whether the call + * is passing any more parameters besides the default variable (the il default variable may be ignored + * in this case, and not consider it as being a parameter being passed to the function). + * If it does, then we have found a semantic error, otherwise the function call is + * correct, and we simply return. */ - if(param_name != NULL) { + if(param_name == NULL) { + if (fcp_iterator.next_nf() != NULL) + STAGE3_ERROR(f_call, f_call, "Too many parameters in function/FB call."); + return; + } else { + /* param_name != NULL */ param_type = fp_iterator.param_type(); - if(!is_valid_assignment(param_type, il_default_variable_type)) - STAGE3_ERROR(f_call, f_call, "In function/FB call, first parameter has invalid data type."); + if(!is_valid_assignment(param_type, il_default_variable_type)) { + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(f_call, f_call, "In function/FB call, first parameter has invalid data type."); + } + } + + /* the fisrt parameter (il_def_variable) is correct */ + if (extensible_parameter_highest_index < fp_iterator.extensible_param_index()) { + extensible_parameter_highest_index = fp_iterator.extensible_param_index(); } } // if (use_il_defvar) + + /* Iterating through the non-formal parameters of the function call */ while((call_param_value = fcp_iterator.next_nf()) != NULL) { /* Obtaining the type of the value being passed in the function call */ call_param_type = base_type((symbol_c*)call_param_value->accept(*this)); if (call_param_type == NULL) { - STAGE3_ERROR(call_param_value, call_param_value, "Could not determine data type of value being passed in function/FB call."); + if (error_count != NULL) (*error_count)++; + /* the following error will usually occur when ST code uses an identifier, that could refer to an enumerated constant, + * but was not actually used as a constant in any definitions of an enumerated data type + */ + else STAGE3_ERROR(call_param_value, call_param_value, "Could not determine data type of value being passed in function/FB call."); continue; } @@ -762,17 +724,43 @@ */ do { param_name = fp_iterator.next(); - /* If there is no parameter declared with that name */ - if(param_name == NULL) {STAGE3_ERROR(f_call, f_call, "Too many parameters in function/FB call."); break;} + /* If there is no other parameter declared, then we are passing too many parameters... */ + if(param_name == NULL) { + if (error_count != NULL) (*error_count)++; + /* Note: We don't want to print out the follwoing error message multiple times, so we return instead of continuing with 'break' */ + else STAGE3_ERROR(f_call, f_call, "Too many parameters in function/FB call."); return; + } } while ((strcmp(param_name->value, "EN") == 0) || (strcmp(param_name->value, "ENO") == 0)); - if(param_name != NULL) { - /* Get the parameter type */ - param_type = base_type(fp_iterator.param_type()); - /* If the declared parameter and the parameter from the function call do no have the same type */ - if(!is_valid_assignment(param_type, call_param_type)) STAGE3_ERROR(call_param_value, call_param_value, "Type mismatch in function/FB call parameter."); + /* Get the parameter type */ + param_type = base_type(fp_iterator.param_type()); + /* If the declared parameter and the parameter from the function call do not have the same type */ + if(!is_valid_assignment(param_type, call_param_type)) { + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(call_param_value, call_param_value, "Type mismatch in function/FB call parameter."); } - } + + if (extensible_parameter_highest_index < fp_iterator.extensible_param_index()) { + extensible_parameter_highest_index = fp_iterator.extensible_param_index(); + } + } + + /* The function call may not have any errors! */ + /* In the case of a call to an extensible function, we store the highest index + * of the extensible parameters this particular call uses, in the symbol_c object + * of the function call itself! + * In calls to non-extensible functions, this value will be set to -1. + * This information is later used in stage4 to correctly generate the + * output code. + */ + int extensible_param_count = -1; + if (extensible_parameter_highest_index >=0) /* if call to extensible function */ + extensible_param_count = 1 + extensible_parameter_highest_index - fp_iterator.first_extensible_param_index(); + il_function_call_c *il_function_call = dynamic_cast(f_call); + function_invocation_c *function_invocation = dynamic_cast(f_call); + if (il_function_call != NULL) il_function_call ->extensible_param_count = extensible_param_count; + else if (function_invocation != NULL) function_invocation->extensible_param_count = extensible_param_count; + // else ERROR; /* this function is also called by Function Blocks, so this is not an error! */ } @@ -814,12 +802,22 @@ /* A helper function... */ /* check the semantics of a FB or Function formal call */ /* e.g. foo(IN1 := 1, OUT1 =>x, EN := true); */ -void visit_expression_type_c::check_formal_call(symbol_c *f_call, symbol_c *f_decl) { +/* If error_count pointer is != NULL, we do not really print out the errors, + * but rather only count how many errors were found. + * This is used to support overloaded functions, where we have to check each possible + * function, one at a time, untill we find a function call without any errors. + */ +void visit_expression_type_c::check_formal_call(symbol_c *f_call, symbol_c *f_decl, int *error_count) { symbol_c *call_param_value, *call_param_type, *call_param_name, *param_type; symbol_c *verify_duplicate_param; identifier_c *param_name; function_param_iterator_c fp_iterator(f_decl); function_call_param_iterator_c fcp_iterator(f_call); + int extensible_parameter_highest_index = -1; + identifier_c *extensible_parameter_name; + + /* reset error counter */ + if (error_count != NULL) *error_count = 0; /* Iterating through the formal parameters of the function call */ while((call_param_name = fcp_iterator.next_f()) != NULL) { @@ -832,13 +830,15 @@ /* Checking if there are duplicated parameter values */ verify_duplicate_param = fcp_iterator.search_f(call_param_name); if(verify_duplicate_param != call_param_value){ - STAGE3_ERROR(call_param_name, verify_duplicate_param, "Duplicated parameter values."); + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(call_param_name, verify_duplicate_param, "Duplicated parameter values."); } /* Obtaining the type of the value being passed in the function call */ call_param_type = (symbol_c*)call_param_value->accept(*this); if (call_param_type == NULL) { - STAGE3_ERROR(call_param_name, call_param_value, "Could not determine data type of value being passed in function/FB call."); + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(call_param_name, call_param_value, "Could not determine data type of value being passed in function/FB call."); /* The data value being passed is possibly any enumerated type value. * We do not yet handle semantic verification of enumerated types. */ @@ -850,14 +850,58 @@ /* Find the corresponding parameter of the function being called */ param_name = fp_iterator.search(call_param_name); if(param_name == NULL) { - STAGE3_ERROR(call_param_name, call_param_name, "Invalid parameter in function/FB call."); + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(call_param_name, call_param_name, "Invalid parameter in function/FB call."); } else { /* Get the parameter type */ param_type = base_type(fp_iterator.param_type()); /* If the declared parameter and the parameter from the function call have the same type */ - if(!is_valid_assignment(param_type, call_param_type)) STAGE3_ERROR(call_param_name, call_param_value, "Type mismatch function/FB call parameter."); + if(!is_valid_assignment(param_type, call_param_type)) { + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(call_param_name, call_param_value, "Type mismatch function/FB call parameter."); + } + if (extensible_parameter_highest_index < fp_iterator.extensible_param_index()) { + extensible_parameter_highest_index = fp_iterator.extensible_param_index(); + extensible_parameter_name = param_name; + } } } + + /* In the case of a call to an extensible function, we store the highest index + * of the extensible parameters this particular call uses, in the symbol_c object + * of the function call itself! + * In calls to non-extensible functions, this value will be set to -1. + * This information is later used in stage4 to correctly generate the + * output code. + */ + int extensible_param_count = -1; + if (extensible_parameter_highest_index >=0) /* if call to extensible function */ + extensible_param_count = 1 + extensible_parameter_highest_index - fp_iterator.first_extensible_param_index(); + il_formal_funct_call_c *il_formal_funct_call = dynamic_cast(f_call); + function_invocation_c *function_invocation = dynamic_cast(f_call); + if (il_formal_funct_call != NULL) il_formal_funct_call->extensible_param_count = extensible_param_count; + else if (function_invocation != NULL) function_invocation->extensible_param_count = extensible_param_count; +// else ERROR; /* this function is also called by Function Blocks, so this is not an error! */ + + /* We have iterated through all the formal parameters of the function call, + * and everything seems fine. + * If the function being called in an extensible function, we now check + * whether the extensible paramters in the formal invocation do not skip + * any indexes... + * + * f(in1:=0, in2:=0, in4:=0) --> ERROR!! + */ + if (extensible_parameter_highest_index >=0) { /* if call to extensible function */ + for (int i=fp_iterator.first_extensible_param_index(); i < extensible_parameter_highest_index; i++) { + char tmp[256]; + if (snprintf(tmp, 256, "%s%d", extensible_parameter_name->value, i) >= 256) ERROR; + if (fcp_iterator.search_f(tmp) == NULL) { + /* error in invocation of extensible function */ + if (error_count != NULL) (*error_count)++; + else STAGE3_ERROR(f_call, f_call, "Missing extensible parameters in call to extensible function."); + } + } + } } @@ -990,58 +1034,51 @@ if (il_error) return NULL; + symbol_c *return_data_type = NULL; + /* First find the declaration of the function being called! */ - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - - symbol_c *return_data_type = NULL; - - if (f_decl == function_symtable.end_value()) { - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; - /* This code is for the functions that the user did not declare and that are - * part of the IL or ST languagem (built-in functions). - * For now we won't do the semantics analysis for that kind of functions. - */ - /* - return_data_type = (symbol_c *)search_expression_type->compute_standard_function_default(NULL, symbol); - if (NULL == return_data_type) ERROR; - - function_call_param_iterator_c fcp_iterator(symbol); - - int nb_param = 0; - if (symbol->il_param_list != NULL) - nb_param += ((list_c *)symbol->il_param_list)->n; - - identifier_c en_param_name("EN");*/ - /* Get the value from EN param */ - /*symbol_c *EN_param_value = fcp_iterator.search(&en_param_name); - if (EN_param_value == NULL) - EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())); - else - nb_param --; - ADD_PARAM_LIST(EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in) - - identifier_c eno_param_name("EN0");*/ - /* Get the value from ENO param */ - /*symbol_c *ENO_param_value = fcp_iterator.search(&eno_param_name); - if (ENO_param_value != NULL) - nb_param --; - ADD_PARAM_LIST(ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) + function_symtable_t::iterator lower = function_symtable.lower_bound(symbol->function_name); + function_symtable_t::iterator upper = function_symtable.upper_bound(symbol->function_name); + if (lower == function_symtable.end()) ERROR; + + int error_count = 0; + int *error_count_ptr = NULL; + + function_symtable_t::iterator second = lower; + second++; + if (second != upper) + /* This is a call to an overloaded function... */ + error_count_ptr = &error_count; + + for(; lower != upper; lower++) { + function_declaration_c *f_decl = function_symtable.get_value(lower); - #include "st_code_gen.c" - */ - } else { - /* determine the base data type returned by the function being called... */ - return_data_type = base_type(f_decl->type_name); - /* If the following occurs, then we must have some big bug in the syntax parser (stage 2)... */ - if (NULL == return_data_type) ERROR; - - /* check semantics of data passed in the function call... */ - check_nonformal_call(symbol, f_decl, true); - - /* set the new ddata type of the default variable for the following verifications... */ - il_default_variable_type = return_data_type; - } + check_nonformal_call(symbol, f_decl, true, error_count_ptr); + + if (0 == error_count) { + /* Either: + * (i) we have a call to a non-overloaded function (error_cnt_ptr is NULL!, so error_count won't change!) + * (ii) we have a call to an overloaded function, with no errors! + */ + + /* Store the pointer to the declaration of the function being called. + * This data will be used by stage 4 to call the correct function. + * Mostly needed to disambiguate overloaded functions... + * See comments in absyntax.def for more details + */ + symbol->called_function_declaration = f_decl; + /* determine the base data type returned by the function being called... */ + return_data_type = base_type(f_decl->type_name); + /* If the following occurs, then we must have some big bug in the syntax parser (stage 2)... */ + if (NULL == return_data_type) ERROR; + /* set the new data type of the default variable for the following verifications... */ + il_default_variable_type = return_data_type; + return NULL; + } + } + + /* No compatible function was found for this function call */ + STAGE3_ERROR(symbol, symbol, "Call to an overloaded function with invalid parameter type."); return NULL; } @@ -1161,58 +1198,55 @@ if (il_error) return NULL; - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - symbol_c *return_data_type = NULL; - - if (f_decl == function_symtable.end_value()) { + function_symtable_t::iterator lower = function_symtable.lower_bound(symbol->function_name); + function_symtable_t::iterator upper = function_symtable.upper_bound(symbol->function_name); + + if (lower == function_symtable.end()) { function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); if (current_function_type == function_none) ERROR; - - /* This code is for the functions that the user did not declare and that are - * part of the IL or ST languagem (built-in functions). - * For now we won't do the semantics analysis for that kind of functions. - */ - #if 0 - return_data_type = (symbol_c *)search_expression_type->compute_standard_function_default(NULL, symbol); - if (NULL == return_data_type) ERROR; - - function_call_param_iterator_c fcp_iterator(symbol); - - int nb_param = 0; - if (symbol->il_param_list != NULL) - nb_param += ((list_c *)symbol->il_param_list)->n; - - identifier_c en_param_name("EN"); - /* Get the value from EN param */ - symbol_c *EN_param_value = fcp_iterator.search(&en_param_name); - if (EN_param_value == NULL) - EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())); - else - nb_param --; - ADD_PARAM_LIST(EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in) - - identifier_c eno_param_name("EN0"); - /* Get the value from ENO param */ - symbol_c *ENO_param_value = fcp_iterator.search(&eno_param_name); - if (ENO_param_value != NULL) - nb_param --; - ADD_PARAM_LIST(ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) - - #include "st_code_gen.c" - #endif - } else { - /* determine the base data type returned by the function being called... */ - return_data_type = base_type(f_decl->type_name); - /* the following should never occur. If it does, then we have a bug in the syntax parser (stage 2)... */ - if (NULL == return_data_type) ERROR; - + return NULL; + } + + int error_count = 0; + int *error_count_ptr = NULL; + + function_symtable_t::iterator second = lower; + second++; + if (second != upper) + /* This is a call to an overloaded function... */ + error_count_ptr = &error_count; + + for(; lower != upper; lower++) { + function_declaration_c *f_decl = function_symtable.get_value(lower); + /* check semantics of data passed in the function call... */ - check_formal_call(symbol, f_decl); - - /* the data type of the data returned by the function, and stored in the il default variable... */ - il_default_variable_type = return_data_type; - } + check_formal_call(symbol, f_decl, error_count_ptr); + + if (0 == error_count) { + /* Either: + * (i) we have a call to a non-overloaded function (error_cnt_ptr is NULL!, so error_count won't change!) + * (ii) we have a call to an overloaded function, with no errors! + */ + + /* Store the pointer to the declaration of the function being called. + * This data will be used by stage 4 to call the correct function. + * Mostly needed to disambiguate overloaded functions... + * See comments in absyntax.def for more details + */ + symbol->called_function_declaration = f_decl; + /* determine the base data type returned by the function being called... */ + return_data_type = base_type(f_decl->type_name); + /* the following should never occur. If it does, then we have a bug in the syntax parser (stage 2)... */ + if (NULL == return_data_type) ERROR; + /* the data type of the data returned by the function, and stored in the il default variable... */ + il_default_variable_type = return_data_type; + return NULL; + } + } + + /* No compatible function was found for this function call */ + STAGE3_ERROR(symbol, symbol, "Call to an overloaded function with invalid parameter type."); return NULL; } @@ -1578,7 +1612,8 @@ // SYM_REF0(MOD_operator_c) void *visit_expression_type_c::visit(MOD_operator_c *symbol) { verify_null(symbol); - il_default_variable_type = compute_expression(il_default_variable_type, il_operand_type, &visit_expression_type_c::is_ANY_INT_compatible); + il_default_variable_type = compute_expression(il_default_variable_type, il_operand_type, &visit_expression_type_c::is_ANY_INT_compatible, + symbol , il_operand); return NULL; } @@ -1729,28 +1764,28 @@ void *visit_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_expression(left_type, right_type, &visit_expression_type_c::is_ANY_BIT_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_BIT_compatible, symbol->l_exp, symbol->r_exp); } void *visit_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_expression(left_type, right_type, &visit_expression_type_c::is_ANY_BIT_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_BIT_compatible, symbol->l_exp, symbol->r_exp); } void *visit_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_expression(left_type, right_type, &visit_expression_type_c::is_ANY_BIT_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_BIT_compatible, symbol->l_exp, symbol->r_exp); } void *visit_expression_type_c::visit(equ_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)); - compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible); + compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible, symbol->l_exp, symbol->r_exp); return &search_expression_type_c::bool_type_name; } @@ -1758,7 +1793,7 @@ void *visit_expression_type_c::visit(notequ_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)); - compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible); + compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible, symbol->l_exp, symbol->r_exp); return &search_expression_type_c::bool_type_name; } @@ -1766,7 +1801,7 @@ void *visit_expression_type_c::visit(lt_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)); - compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible); + compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible, symbol->l_exp, symbol->r_exp); return &search_expression_type_c::bool_type_name; } @@ -1774,7 +1809,7 @@ void *visit_expression_type_c::visit(gt_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)); - compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible); + compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible, symbol->l_exp, symbol->r_exp); return &search_expression_type_c::bool_type_name; } @@ -1782,7 +1817,7 @@ void *visit_expression_type_c::visit(le_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)); - compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible); + compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible, symbol->l_exp, symbol->r_exp); return &search_expression_type_c::bool_type_name; } @@ -1790,7 +1825,7 @@ void *visit_expression_type_c::visit(ge_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)); - compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible); + compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_ELEMENTARY_compatible, symbol->l_exp, symbol->r_exp); return &search_expression_type_c::bool_type_name; } @@ -1823,7 +1858,7 @@ if (is_type(left_type, safedt_type_name_c) && is_type(right_type, safetime_type_name_c)) return (void *)&safedt_type_name; - return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_MAGNITUDE_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_MAGNITUDE_compatible, symbol->l_exp, symbol->r_exp); } @@ -1882,7 +1917,7 @@ if (is_type(left_type, safedt_type_name_c) && is_type(right_type, safedt_type_name_c)) return (void *)&safetime_type_name; - return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_MAGNITUDE_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_MAGNITUDE_compatible, symbol->l_exp, symbol->r_exp); } @@ -1902,7 +1937,7 @@ if (is_type(left_type, safetime_type_name_c) && is_ANY_NUM_compatible(right_type)) return (void *)&safetime_type_name; - return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_NUM_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_NUM_compatible, symbol->l_exp, symbol->r_exp); } @@ -1922,14 +1957,14 @@ if (is_type(left_type, safetime_type_name_c) && is_ANY_NUM_compatible(right_type)) return (void *)&safetime_type_name; - return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_NUM_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_NUM_compatible, symbol->l_exp, symbol->r_exp); } void *visit_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_expression(left_type, right_type, &visit_expression_type_c::is_ANY_INT_compatible); + return compute_expression(left_type, right_type, &visit_expression_type_c::is_ANY_INT_compatible, symbol->l_exp, symbol->r_exp); } @@ -1956,27 +1991,57 @@ void *visit_expression_type_c::visit(not_expression_c *symbol) { symbol_c *type = base_type((symbol_c *)symbol->exp->accept(*this)); - return compute_expression(type, type, &visit_expression_type_c::is_ANY_BIT_compatible); + return compute_expression(type, type, &visit_expression_type_c::is_ANY_BIT_compatible, NULL, symbol->exp); } void *visit_expression_type_c::visit(function_invocation_c *symbol) { - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - /* TODO: the following code is for standard library functions. We do not yet support this... */ - void *res = compute_standard_function_default(symbol); - if (res != NULL) return res; - ERROR; - } - - /* now check the semantics of the function call... */ - /* If the syntax parser is working correctly, exactly one of the - * following two symbols will be NULL, while the other is != NULL. - */ - if (symbol-> formal_param_list != NULL) check_formal_call (symbol, f_decl); - if (symbol->nonformal_param_list != NULL) check_nonformal_call(symbol, f_decl); - - return base_type(f_decl->type_name); + function_symtable_t::iterator lower = function_symtable.lower_bound(symbol->function_name); + function_symtable_t::iterator upper = function_symtable.upper_bound(symbol->function_name); + if (lower == function_symtable.end()) ERROR; + + function_symtable_t::iterator second = lower; + second++; + if (second == upper) { + /* call to a function that is not overloaded. */ + /* now check the semantics of the function call... */ + /* If the syntax parser is working correctly, exactly one of the + * following two symbols will be NULL, while the other is != NULL. + */ + function_declaration_c *f_decl = function_symtable.get_value(lower); + if (symbol-> formal_param_list != NULL) check_formal_call (symbol, f_decl); + if (symbol->nonformal_param_list != NULL) check_nonformal_call(symbol, f_decl); + /* Store the pointer to the declaration of the function being called. + * This data will be used by stage 4 to call the correct function. + * Mostly needed to disambiguate overloaded functions... + * See comments in absyntax.def for more details + */ + symbol->called_function_declaration = f_decl; + return base_type(f_decl->type_name); + } + + /* This is a call to an overloaded function... */ + if (debug) printf("visit_expression_type_c::visit(function_invocation_c *symbol): FOUND CALL TO OVERLOADED FUNCTION!!\n"); + for(; lower != upper; lower++) { + if (debug) printf("visit_expression_type_c::visit(function_invocation_c *symbol): FOUND CALL TO OVERLOADED FUNCTION!! iterating...\n"); + int error_count = 0; + function_declaration_c *f_decl = function_symtable.get_value(lower); + if (symbol-> formal_param_list != NULL) check_formal_call (symbol, f_decl, &error_count); + if (symbol->nonformal_param_list != NULL) check_nonformal_call(symbol, f_decl, false, &error_count); + if (0 == error_count) { + /* Store the pointer to the declaration of the function being called. + * This data will be used by stage 4 to call the correct function. + * Mostly needed to disambiguate overloaded functions... + * See comments in absyntax.def for more details + */ + symbol->called_function_declaration = f_decl; + return base_type(f_decl->type_name); + } + } + + /* No compatible function was found for this function call */ + STAGE3_ERROR(symbol, symbol, "Call to an overloaded function with invalid parameter type."); + return NULL; } /********************/ @@ -2009,10 +2074,14 @@ if (hi2 != NULL) printf("%s", hi2->value); printf("\n"); } // if (debug) - - if (!is_valid_assignment(left_type, right_type)) { - STAGE3_ERROR(symbol, symbol, "data type mismatch in assignment statement!\n"); - } + + if (NULL == left_type) { + STAGE3_ERROR(symbol->l_exp, symbol->l_exp, "Could not determine data type of expression (undefined variable or strcuture element?).\n"); + } else if (NULL == right_type) { + STAGE3_ERROR(symbol->r_exp, symbol->r_exp, "Could not determine data type of expression (undefined variable or strcuture element?).\n"); + } else if (!is_valid_assignment(left_type, right_type)) + STAGE3_ERROR(symbol, symbol, "data type mismatch in assignment statement!\n"); + return NULL; } diff -r b826f13c260e -r 7a11f9e9e703 stage3/visit_expression_type.hh --- a/stage3/visit_expression_type.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/stage3/visit_expression_type.hh Thu Sep 08 20:25:00 2011 +0200 @@ -190,10 +190,18 @@ void check_il_fbcall(symbol_c *symbol, const char *input_operator); /* check the semantics of a FB or Function non-formal call */ /* e.g. foo(1, 2, 3, 4); */ - void check_nonformal_call(symbol_c *f_call, symbol_c *f_decl, bool use_il_defvar = false); + /* If error_count pointer is NULL, print out error messages. + * If error_count pointer is != NULL, do not print out error messages, but tally up + * how many errors were found. + */ + void check_nonformal_call(symbol_c *f_call, symbol_c *f_decl, bool use_il_defvar = false, int *error_count = NULL); /* check the semantics of a FB or Function formal call */ /* e.g. foo(IN1 := 1, OUT1 =>x, EN := true); */ - void check_formal_call(symbol_c *f_call, symbol_c *f_decl); + /* If error_count pointer is NULL, print out error messages. + * If error_count pointer is != NULL, do not print out error messages, but tally up + * how many errors were found. + */ + void check_formal_call(symbol_c *f_call, symbol_c *f_decl, int *error_count = NULL); void *compute_standard_function_default(function_invocation_c *st_symbol, il_formal_funct_call_c *il_symbol); @@ -206,7 +214,7 @@ // symbol_c *compute_numeric_expression(symbol_c *left_exp, symbol_c *right_exp, is_data_type_t is_data_type); // symbol_c *compute_expression(symbol_c *left_exp, symbol_c *right_exp, is_data_type_t is_data_type); symbol_c *compute_expression(symbol_c *left_type, symbol_c *right_type, is_data_type_t is_data_type, - symbol_c *left_expr=NULL, symbol_c *right_expr=NULL); + symbol_c *left_expr, symbol_c *right_expr); /* a helper function... */ diff -r b826f13c260e -r 7a11f9e9e703 stage4/Makefile --- a/stage4/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +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 . -# include the system specific Makefile - -include ../Makefile.$(shell uname) - - - - -default: all - -all: stage4.o - -clean: - rm -f *.o - find . -depth -mindepth 2 -maxdepth 2 -name Makefile | sed 's/Makefile//g' | xargs -I {} $(MAKE) -C{} clean - - -CXXFLAGS += -I. -I../* - -#how to make things in subdirectories etc -../% /% absyntax/% stage1_2/% stage3/% stage4/% util/%: - $(MAKE) -C $(@D) $(@F) - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend diff -r b826f13c260e -r 7a11f9e9e703 stage4/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage4/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,6 @@ +include ../common.mk + +SUBDIRS = generate_c generate_iec + +CLEANFILES = stage4.o + diff -r b826f13c260e -r 7a11f9e9e703 stage4/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage4/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,531 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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; + +$(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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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: diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/Makefile --- a/stage4/generate_c/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +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 . - -# include the system specific Makefile -include ../../Makefile.$(shell uname) - -default: all - -all: generate_c.o - -clean: - echo > Makefile.depend - -rm -f *.o */*.o - -CXXFLAGS += -Wno-unused -CXXFLAGS += -I. -I../* -I../../absyntax - -#how to make things from other directories if they are missing -../% /%: - $(MAKE) -C $(@D) $(@F) - -test_iec_std_lib: test_iec_std_lib.c iec_std_lib.h - gcc -o test_iec_std_lib test_iec_std_lib.c - -test: test_iec_std_lib - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage4/generate_c/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,10 @@ +include ../../common.mk + +lib_LIBRARIES = libstage4_c.a + +libstage4_c_a_SOURCES = generate_c.cc + +libstage4_c_a_LIBADD = ../stage4.o + +libstage4_c_a_cppflags = -I../../../absyntax + diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage4/generate_c/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,485 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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__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; + +$(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|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ + cd "$(DESTDIR)$(libdir)" && rm -f $$files + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libstage4_c.a: $(libstage4_c_a_OBJECTS) $(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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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: diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/generate_c.cc --- a/stage4/generate_c/generate_c.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_c/generate_c.cc Thu Sep 08 20:25:00 2011 +0200 @@ -158,12 +158,174 @@ /***********************************************************************/ /***********************************************************************/ + +#include "generate_c.hh" + + +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ + +/* A helper class that prints out the identifiers for function calls to overloaded functions */ +/* Given a function declaration of the function being called, it + * will simply print out the returned data type, + * followed by the data types of all input, output, and in_out parameters. + * for e.g.; + * SIN( REAL) : REAL -> prints out -> REAL__REAL + * LEN( STRING) : INT -> prints out -> INT__STRING + * MUL(TIME, INT) : TIME -> prints out -> TIME__TIME__INT + */ +class print_function_parameter_data_types_c: public generate_c_base_c { + private: + symbol_c *current_type; + bool_type_name_c tmp_bool; + + void print_list(symbol_c *var_list, symbol_c *data_type) { + if (data_type != NULL) { + /* print out the data type once for every variable! */ + list_c *list = dynamic_cast(var_list); + if (list == NULL) ERROR; + for (int i=0; i < list->n; i++) { + s4o.print("__"); + data_type->accept(*this); + } + } + } + + public: + print_function_parameter_data_types_c(stage4out_c *s4o_ptr): + generate_c_base_c(s4o_ptr) + {current_type = NULL;} + + /**************************************/ + /* B.1.5 - Program organization units */ + /**************************************/ + /***********************/ + /* B 1.5.1 - Functions */ + /***********************/ + /* FUNCTION derived_function_name ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ + /* | FUNCTION derived_function_name ':' derived_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ + void *visit(function_declaration_c *symbol) { + symbol->type_name->accept(*this); /* return type */ + symbol->var_declarations_list->accept(*this); + return NULL; + } + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(var_declarations_list_c *symbol) {// iterate through list} + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(input_declarations_c *symbol) {// iterate through list} + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(input_declaration_list_c *symbol) {// iterate through list} + + void *visit(edge_declaration_c *symbol) { + current_type = &tmp_bool; + symbol->var1_list->accept(*this); + current_type = NULL; + return NULL; + } + + /* We do NOT print out EN and ENO parameters! */ + void *visit(en_param_declaration_c *symbol) {return NULL;} + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(output_declarations_c *symbol) {// iterate through list} + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(var_init_decl_list_c *symbol) {// iterate through list} + + void *visit(simple_spec_init_c *symbol) { + /* return the data type */ + return symbol->simple_specification; + } + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + /* NOTE: although this class may also sometimes point to a previously_declared_subrange_type_name + * we don't need this for now, so it is easier to just skip it allocation + */ + void *visit(subrange_spec_init_c *symbol) {return NULL;} + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + /* NOTE: although this class may also sometimes point to a previously_declared_enumerated_type_name + * we don't need this for now, so it is easier to just skip it allocation + */ + void *visit(enumerated_spec_init_c *symbol) {return NULL;} + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + /* NOTE: although this class may also sometimes point to a previously_declared_array_type_name + * we don't need this for now, so it is easier to just skip it allocation + */ + void *visit(array_var_init_decl_c *symbol) {return NULL;} + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + /* NOTE: although this class may also sometimes point to a previously_declared_structured_type_name + * we don't need this for now, so it is easier to just skip it allocation + */ + void *visit(structured_var_init_decl_c *symbol) {return NULL;} + + /* We do NOT print out EN and ENO parameters! */ + void *visit(eno_param_declaration_c *symbol) {return NULL;} + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(input_output_declarations_c *symbol) {// iterate through list} + + /* already handled by iterator base class (note that generate_c_base_c inherits from iterator_c) */ + //void *visit(var_declaration_list_c *symbol) {iterate through list} + + void *visit(fb_name_decl_c *symbol) { + print_list(symbol->fb_name_list, symbol->function_block_type_name); + return NULL; + } + + void *visit(var1_init_decl_c *symbol) { + print_list(symbol->var1_list, (symbol_c *)symbol->spec_init->accept(*this)); + return NULL; + } + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + void *visit(array_var_declaration_c *symbol) {return NULL;} + + void *visit(structured_var_declaration_c *symbol) { + current_type = symbol->structure_type_name; + symbol->var1_list->accept(*this); + current_type = NULL; + return NULL; + } + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + /* Note that this class is used for fixed length strings... + * STRING [ 42 ] + */ + void *visit(single_byte_string_var_declaration_c *symbol) {return NULL;} + + /* currently we do not support data types defined in the declaration itself */ + /* For now, sugest the user define a TYPE .. END_TYPE */ + /* Note that this class is used for fixed length strings... + * WSTRING [ 42 ] + */ + void *visit(double_byte_string_var_declaration_c *symbol) {return NULL;} +}; + + +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ +/***********************************************************************/ + + #include "generate_c_st.cc" #include "generate_c_il.cc" #include "generate_c_inlinefcall.cc" -#include "generate_c.hh" - /***********************************************************************/ /***********************************************************************/ /***********************************************************************/ diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/generate_c_il.cc --- a/stage4/generate_c/generate_c_il.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_c/generate_c_il.cc Thu Sep 08 20:25:00 2011 +0200 @@ -789,102 +789,122 @@ function_call_param_iterator_c function_call_param_iterator(symbol); - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; + 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 + * to it, and then output the c equivalent... + */ + 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 */ + 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; + for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + if (fp_iterator.is_extensible_param() && (!found_first_extensible_parameter)) { + /* We are calling an extensible function. Before passing the extensible + * parameters, we must add a dummy paramater value to tell the called + * function how many extensible parameters we will be passing. + * + * Note that stage 3 has already determined the number of extensible + * paramters, and stored that info in the abstract syntax tree. We simply + * re-use that value. + */ + /* NOTE: we are not freeing the malloc'd memory. This is not really a bug. + * Since we are writing a compiler, which runs to termination quickly, + * we can consider this as just memory required for the compilation process + * that will be free'd when the program terminates. + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + if (tmp == NULL) ERROR; + int res = snprintf(tmp, 32, "%d", symbol->extensible_param_count); + if ((res >= 32) || (res < 0)) ERROR; + identifier_c *param_value = new identifier_c(tmp); + uint_type_name_c *param_type = new uint_type_name_c(); + identifier_c *param_name = new identifier_c(""); + ADD_PARAM_LIST(param_name, param_value, param_type, function_param_iterator_c::direction_in) + found_first_extensible_parameter = true; + } - return_data_type = (symbol_c *)search_expression_type->compute_standard_function_il(symbol, param_data_type); - if (NULL == return_data_type) ERROR; + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; - symbol_c *en_param_name = (symbol_c *)(new identifier_c("EN")); - /* Add the value from EN param */ - ADD_PARAM_LIST(en_param_name, - (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())), - (symbol_c*)(new bool_type_name_c()), - function_param_iterator_c::direction_in) + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - symbol_c *eno_param_name = (symbol_c *)(new identifier_c("ENO")); - /* Add the value from ENO param */ - ADD_PARAM_LIST(eno_param_name, NULL, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) + symbol_c *param_value = NULL; + + /* Get the value from a foo( = ) style call */ + /* NOTE: Since the class il_function_call_c only references a non.formal function call, + * the following line of code is not required in this case. However, it doesn't + * harm to leave it in, as in the case of a non-formal syntax function call, + * it will always return NULL. + * We leave it in in case we later decide to merge this part of the code together + * with the function calling code in generate_c_st_c, which does require + * the following line... + */ + if (param_value == NULL) + param_value = function_call_param_iterator.search_f(param_name); + + /* 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! + * + * 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! + */ + if ((param_value == NULL) && (!used_defvar) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = &this->default_variable_name; + used_defvar = true; + } + + /* Get the value from a foo() style call */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = function_call_param_iterator.next_nf(); + } - int nb_param = 1; - if (symbol->il_operand_list != NULL) - nb_param += ((list_c *)symbol->il_operand_list)->n; - - #include "il_code_gen.c" - - } - else { - /* 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; + /* if no more parameter values in function call, and the current parameter + * of the function declaration is an extensible parameter, we + * have reached the end, and should simply jump out of the for loop. + */ + if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { + break; + } - /* loop through each function parameter, find the value we should pass - * to it, and then output the c equivalent... - */ - - function_param_iterator_c fp_iterator(f_decl); - identifier_c *param_name; - for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - - function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - - symbol_c *param_value = NULL; - - /* if it is the first parameter, semantics specifies that we should - * get the value off the IL default variable! - */ - if (1 == i) - param_value = &this->default_variable_name; - - /* Get the value from a foo( = ) style call */ - /* NOTE: the following line of code is not required in this case, but it doesn't - * harm to leave it in, as in the case of a non-formal syntax function call, - * it will always return NULL. - * We leave it in in case we later decide to merge this part of the code together - * with the function calling code in generate_c_st_c, which does require - * the following line... - */ - if (param_value == NULL) - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) { - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; - } - - if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { - /* No value given for parameter, so we must use the default... */ - /* First check whether default value specified in function declaration...*/ - param_value = fp_iterator.default_value(); - } - - ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) - } /* for(...) */ - } - + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { + /* No value given for parameter, so we must use the default... */ + /* First check whether default value specified in function declaration...*/ + param_value = fp_iterator.default_value(); + } + + ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) + } /* for(...) */ + if (function_call_param_iterator.next_nf() != NULL) ERROR; bool has_output_params = false; if (!this->is_variable_prefix_null()) { PARAM_LIST_ITERATOR() { - if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || - PARAM_DIRECTION == function_param_iterator_c::direction_inout) && - PARAM_VALUE != NULL) { - if (!has_output_params) { - has_output_params = true; - } - } - } - } + if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || + PARAM_DIRECTION == function_param_iterator_c::direction_inout) && + PARAM_VALUE != NULL) { + has_output_params = true; + } + } + } + + /* Check whether we are calling an overloaded function! */ + /* (fdecl_mutiplicity==2) => calling overloaded function */ + int fdecl_mutiplicity = function_symtable.multiplicity(symbol->function_name); + if (fdecl_mutiplicity == 0) ERROR; default_variable_name.current_type = return_data_type; this->default_variable_name.accept(*this); @@ -900,18 +920,31 @@ function_type_suffix = search_expression_type->default_literal_type(function_type_suffix); } if (has_output_params) { - fcall_number++; - s4o.print("__"); + fcall_number++; + s4o.print("__"); fbname->accept(*this); s4o.print("_"); function_name->accept(*this); + if (fdecl_mutiplicity == 2) { + /* function being called is overloaded! */ + s4o.print("__"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } s4o.print_integer(fcall_number); } else { - if (function_name != NULL) - function_name->accept(*this); + if (function_name != NULL) { + function_name->accept(*this); + if (fdecl_mutiplicity == 2) { + /* function being called is overloaded! */ + s4o.print("__"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } + } if (function_type_suffix != NULL) - function_type_suffix->accept(*this); + function_type_suffix->accept(*this); } s4o.print("("); s4o.indent_right(); @@ -923,8 +956,8 @@ switch (PARAM_DIRECTION) { case function_param_iterator_c::direction_in: - if (nb_param > 0) - s4o.print(",\n"+s4o.indent_spaces); + if (nb_param > 0) + 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()); @@ -943,18 +976,18 @@ break; case function_param_iterator_c::direction_out: case function_param_iterator_c::direction_inout: - if (!has_output_params) { + if (!has_output_params) { if (nb_param > 0) - s4o.print(",\n"+s4o.indent_spaces); - if (param_value == NULL) { - s4o.print("NULL"); - } else { - wanted_variablegeneration = fparam_output_vg; - param_value->accept(*this); - wanted_variablegeneration = expression_vg; - } - nb_param++; - } + s4o.print(",\n"+s4o.indent_spaces); + if (param_value == NULL) { + s4o.print("NULL"); + } else { + wanted_variablegeneration = fparam_output_vg; + param_value->accept(*this); + wanted_variablegeneration = expression_vg; + } + nb_param++; + } break; case function_param_iterator_c::direction_extref: /* TODO! */ @@ -964,7 +997,7 @@ } if (has_output_params) { if (nb_param > 0) - s4o.print(",\n"+s4o.indent_spaces); + s4o.print(",\n"+s4o.indent_spaces); s4o.print(FB_FUNCTION_PARAM); } @@ -1072,7 +1105,10 @@ symbol_c *param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + /* When using the informal invocation style, user can not pass values to EN or ENO parameters if these + * were implicitly defined! + */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) param_value = function_call_param_iterator.next_nf(); symbol_c *param_type = fp_iterator.param_type(); @@ -1116,7 +1152,10 @@ symbol_c *param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + /* When using the informal invocation style, user can not pass values to EN or ENO parameters if these + * were implicitly defined! + */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) param_value = function_call_param_iterator.next_nf(); /* now output the value assignment */ @@ -1158,85 +1197,100 @@ function_call_param_iterator_c function_call_param_iterator(symbol); - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; + 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 + * to it, and then output the c equivalent... + */ + function_param_iterator_c fp_iterator(f_decl); + identifier_c *param_name; + + /* flag to cirreclty handle calls to extensible standard functions (i.e. functions with variable number of input parameters) */ + bool found_first_extensible_parameter = false; + for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + if (fp_iterator.is_extensible_param() && (!found_first_extensible_parameter)) { + /* We are calling an extensible function. Before passing the extensible + * parameters, we must add a dummy paramater value to tell the called + * function how many extensible parameters we will be passing. + * + * Note that stage 3 has already determined the number of extensible + * paramters, and stored that info in the abstract syntax tree. We simply + * re-use that value. + */ + /* NOTE: we are not freeing the malloc'd memory. This is not really a bug. + * Since we are writing a compiler, which runs to termination quickly, + * we can consider this as just memory required for the compilation process + * that will be free'd when the program terminates. + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + if (tmp == NULL) ERROR; + int res = snprintf(tmp, 32, "%d", symbol->extensible_param_count); + if ((res >= 32) || (res < 0)) ERROR; + identifier_c *param_value = new identifier_c(tmp); + uint_type_name_c *param_type = new uint_type_name_c(); + identifier_c *param_name = new identifier_c(""); + ADD_PARAM_LIST(param_name, param_value, param_type, function_param_iterator_c::direction_in) + found_first_extensible_parameter = true; + } - return_data_type = (symbol_c *)search_expression_type->compute_standard_function_default(NULL, symbol); - if (NULL == return_data_type) ERROR; + if (fp_iterator.is_extensible_param()) { + /* since we are handling an extensible parameter, we must add the index to the + * parameter name so we can go looking for the value passed to the correct + * extended parameter (e.g. IN1, IN2, IN3, IN4, ...) + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + int res = snprintf(tmp, 32, "%d", fp_iterator.extensible_param_index()); + if ((res >= 32) || (res < 0)) ERROR; + param_name = new identifier_c(strdup2(param_name->value, tmp)); + if (param_name->value == NULL) ERROR; + } + + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; + + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); + + symbol_c *param_value = NULL; + + /* Get the value from a foo( = ) style call */ + if (param_value == NULL) + param_value = function_call_param_iterator.search_f(param_name); + + /* Get the value from a foo() style call */ + /* NOTE: the following line of code is not required in this case, but it doesn't + * harm to leave it in, as in the case of a formal syntax function call, + * it will always return NULL. + * We leave it in in case we later decide to merge this part of the code together + * with the function calling code in generate_c_st_c, which does require + * the following line... + */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = function_call_param_iterator.next_nf(); + } - int nb_param = 0; - if (symbol->il_param_list != NULL) - nb_param += ((list_c *)symbol->il_param_list)->n; + /* if no more parameter values in function call, and the current parameter + * of the function declaration is an extensible parameter, we + * have reached the end, and should simply jump out of the for loop. + */ + if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { + break; + } - symbol_c *en_param_name = (symbol_c *)(new identifier_c("EN")); - /* Get the value from EN param */ - symbol_c *EN_param_value = function_call_param_iterator.search_f(en_param_name); - if (EN_param_value == NULL) - EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())); - else - nb_param --; - ADD_PARAM_LIST(en_param_name, EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in) + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { + /* No value given for parameter, so we must use the default... */ + /* First check whether default value specified in function declaration...*/ + param_value = fp_iterator.default_value(); + } - symbol_c *eno_param_name = (symbol_c *)(new identifier_c("ENO")); - /* Get the value from ENO param */ - symbol_c *ENO_param_value = function_call_param_iterator.search_f(eno_param_name); - if (ENO_param_value != NULL) - nb_param --; - ADD_PARAM_LIST(eno_param_name, ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) - - #include "st_code_gen.c" - - } - else { - /* 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 - * to it, and then output the c equivalent... - */ - - function_param_iterator_c fp_iterator(f_decl); - identifier_c *param_name; - for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - - function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - - - symbol_c *param_value = NULL; - - /* Get the value from a foo( = ) style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - /* NOTE: the following line of code is not required in this case, but it doesn't - * harm to leave it in, as in the case of a formal syntax function call, - * it will always return NULL. - * We leave it in in case we later decide to merge this part of the code together - * with the function calling code in generate_c_st_c, which does require - * the following line... - */ - if (param_value == NULL) { - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; - } - - if (param_value == NULL) { - /* No value given for parameter, so we must use the default... */ - /* First check whether default value specified in function declaration...*/ - param_value = fp_iterator.default_value(); - } - - ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) - } + ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) } if (function_call_param_iterator.next_nf() != NULL) ERROR; @@ -1245,15 +1299,21 @@ if (!this->is_variable_prefix_null()) { PARAM_LIST_ITERATOR() { - if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || - PARAM_DIRECTION == function_param_iterator_c::direction_inout) && - PARAM_VALUE != NULL) { - if (!has_output_params) { - has_output_params = true; - } - } - } - } + if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || + PARAM_DIRECTION == function_param_iterator_c::direction_inout) && + PARAM_VALUE != NULL) { + has_output_params = true; + } + } + } + + /* Check whether we are calling an overloaded function! */ + /* (fdecl_mutiplicity==2) => calling overloaded function */ + int fdecl_mutiplicity = function_symtable.multiplicity(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); @@ -1268,16 +1328,29 @@ function_type_suffix = search_expression_type->default_literal_type(function_type_suffix); } if (has_output_params) { - fcall_number++; - s4o.print("__"); + fcall_number++; + s4o.print("__"); fbname->accept(*this); s4o.print("_"); function_name->accept(*this); + if (fdecl_mutiplicity == 2) { + /* function being called is overloaded! */ + s4o.print("__"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } s4o.print_integer(fcall_number); } else { - if (function_name != NULL) + if (function_name != NULL) { function_name->accept(*this); + if (fdecl_mutiplicity == 2) { + /* function being called is overloaded! */ + s4o.print("__"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } + } if (function_type_suffix != NULL) function_type_suffix->accept(*this); } @@ -1286,14 +1359,13 @@ int nb_param = 0; PARAM_LIST_ITERATOR() { - symbol_c *param_value = PARAM_VALUE; - current_param_type = PARAM_TYPE; - + symbol_c *param_value = PARAM_VALUE; + current_param_type = PARAM_TYPE; switch (PARAM_DIRECTION) { case function_param_iterator_c::direction_in: - if (nb_param > 0) - s4o.print(",\n"+s4o.indent_spaces); - if (param_value == NULL) { + if (nb_param > 0) + 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()); } @@ -1307,26 +1379,26 @@ current_param_type->accept(*this); s4o.print(")"); print_check_function(current_param_type, param_value); - nb_param++; + nb_param++; break; case function_param_iterator_c::direction_out: case function_param_iterator_c::direction_inout: - if (!has_output_params) { + if (!has_output_params) { if (nb_param > 0) - s4o.print(",\n"+s4o.indent_spaces); - if (param_value == NULL) { - s4o.print("NULL"); - } else { - wanted_variablegeneration = fparam_output_vg; - param_value->accept(*this); - wanted_variablegeneration = expression_vg; - } - } - break; + s4o.print(",\n"+s4o.indent_spaces); + if (param_value == NULL) { + s4o.print("NULL"); + } else { + wanted_variablegeneration = fparam_output_vg; + param_value->accept(*this); + wanted_variablegeneration = expression_vg; + } + } + break; case function_param_iterator_c::direction_extref: /* TODO! */ ERROR; - break; + break; } /* switch */ } /* for(...) */ if (has_output_params) { @@ -1659,7 +1731,7 @@ 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); + 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; } @@ -1677,7 +1749,7 @@ 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); + 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; } @@ -1695,7 +1767,7 @@ 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); + 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) && @@ -1712,7 +1784,7 @@ 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); + 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) && @@ -1742,52 +1814,58 @@ 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;} + 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;} + 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;} + 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;} + 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;} + 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;} + CMP_operator(this->current_operand, "NE_"); + } else { + ERROR; + } return NULL; } diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/generate_c_inlinefcall.cc --- a/stage4/generate_c/generate_c_inlinefcall.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_c/generate_c_inlinefcall.cc Thu Sep 08 20:25:00 2011 +0200 @@ -136,10 +136,13 @@ } } + + void generate_inline(symbol_c *function_name, symbol_c *function_type_prefix, symbol_c *function_type_suffix, - std::list param_list) { + std::list param_list, + function_declaration_c *f_decl = NULL) { std::list::iterator pt; fcall_number++; @@ -155,8 +158,13 @@ fbname->accept(*this); s4o.print("_"); function_name->accept(*this); + if (f_decl != NULL) { +printf("generate_inline(): calling print_function_parameter_data_types_c !!!!!!!!!!!!!!!!!!!!!!\n"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } if (function_type_suffix) { - function_type_suffix->accept(*this); + function_type_suffix->accept(*this); } s4o.print_integer(fcall_number); s4o.print("("); @@ -171,11 +179,11 @@ } } fbname->accept(*this); - s4o.print(" *"); - s4o.print(FB_FUNCTION_PARAM); - s4o.indent_left(); - s4o.print(")\n" + s4o.indent_spaces); - s4o.print("{\n"); + s4o.print(" *"); + s4o.print(FB_FUNCTION_PARAM); + s4o.indent_left(); + s4o.print(")\n" + s4o.indent_spaces); + s4o.print("{\n"); s4o.indent_right(); s4o.print(s4o.indent_spaces); @@ -184,59 +192,63 @@ s4o.print(INLINE_RESULT_TEMP_VAR); s4o.print(";\n"); - PARAM_LIST_ITERATOR() { - if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || - PARAM_DIRECTION == function_param_iterator_c::direction_inout) && - PARAM_VALUE != NULL) { - s4o.print(s4o.indent_spaces); - PARAM_TYPE->accept(*this); + PARAM_LIST_ITERATOR() { + if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || + PARAM_DIRECTION == function_param_iterator_c::direction_inout) && + PARAM_VALUE != NULL) { + s4o.print(s4o.indent_spaces); + PARAM_TYPE->accept(*this); s4o.print(" "); s4o.print(TEMP_VAR); PARAM_NAME->accept(*this); s4o.print(" = "); print_check_function(PARAM_TYPE, PARAM_VALUE); s4o.print(";\n"); - } - } - - s4o.print(s4o.indent_spaces + INLINE_RESULT_TEMP_VAR), - s4o.print(" = "); - function_name->accept(*this); - if (function_type_suffix) + } + } + + s4o.print(s4o.indent_spaces + INLINE_RESULT_TEMP_VAR), + s4o.print(" = "); + function_name->accept(*this); + if (f_decl != NULL) { +printf("generate_inline(): calling print_function_parameter_data_types_c !!!!!!!!!!!!!!!!!!!!!!\n"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } + + if (function_type_suffix) function_type_suffix->accept(*this); - s4o.print("("); - s4o.indent_right(); - - PARAM_LIST_ITERATOR() { - if (pt != param_list.begin()) - s4o.print(",\n" + s4o.indent_spaces); - if (PARAM_DIRECTION == function_param_iterator_c::direction_in) - PARAM_NAME->accept(*this); - else if (PARAM_VALUE != NULL){ + s4o.print("("); + s4o.indent_right(); + + PARAM_LIST_ITERATOR() { + if (pt != param_list.begin()) + s4o.print(",\n" + s4o.indent_spaces); + if (PARAM_DIRECTION == function_param_iterator_c::direction_in) + PARAM_NAME->accept(*this); + else if (PARAM_VALUE != NULL){ s4o.print("&"); s4o.print(TEMP_VAR); PARAM_NAME->accept(*this); - } - else { - s4o.print("NULL"); - } - } - s4o.print(");\n"); - s4o.indent_left(); - - PARAM_LIST_ITERATOR() { + } else { + s4o.print("NULL"); + } + } + s4o.print(");\n"); + s4o.indent_left(); + + PARAM_LIST_ITERATOR() { if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || - PARAM_DIRECTION == function_param_iterator_c::direction_inout) && - PARAM_VALUE != NULL) { - + PARAM_DIRECTION == function_param_iterator_c::direction_inout) && + PARAM_VALUE != NULL) { s4o.print(s4o.indent_spaces); print_setter(PARAM_VALUE, PARAM_TYPE, PARAM_NAME); s4o.print(";\n"); - } - } - s4o.print(s4o.indent_spaces + "return "); - s4o.print(INLINE_RESULT_TEMP_VAR); - s4o.print(";\n"); + } + } + s4o.print(s4o.indent_spaces + "return "); + s4o.print(INLINE_RESULT_TEMP_VAR); + s4o.print(";\n"); s4o.indent_left(); s4o.print(s4o.indent_spaces + "}\n\n"); @@ -460,7 +472,7 @@ void *visit(il_function_call_c *symbol) { symbol_c* function_type_prefix = NULL; - symbol_c* function_name = NULL; + symbol_c* function_name = NULL; symbol_c* function_type_suffix = NULL; DECLARE_PARAM_LIST() @@ -468,86 +480,104 @@ function_call_param_iterator_c function_call_param_iterator(symbol); - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; - - function_type_prefix = (symbol_c *)search_expression_type->compute_standard_function_il(symbol, param_data_type); - - symbol_c *en_param_name = (symbol_c *)(new identifier_c("EN")); - /* Add the value from EN param */ - ADD_PARAM_LIST(en_param_name, - (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())), - (symbol_c*)(new bool_type_name_c()), - function_param_iterator_c::direction_in) - - symbol_c *eno_param_name = (symbol_c *)(new identifier_c("ENO")); - /* Add the value from ENO param */ - ADD_PARAM_LIST(eno_param_name, NULL, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) - - int nb_param = 1; - if (symbol->il_operand_list != NULL) - nb_param += ((list_c *)symbol->il_operand_list)->n; - - #include "il_code_gen.c" - - } - else { - 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); - - /* loop through each function parameter, find the value we should pass - * to it, and then output the c equivalent... - */ - - function_param_iterator_c fp_iterator(f_decl); - identifier_c *param_name; - for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - - function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - - symbol_c *param_value = NULL; - - /* if it is the first parameter, semantics specifies that we should - * get the value off the IL default variable! - */ - if (1 == i) - param_value = &this->default_variable_name; - - /* Get the value from a foo( = ) style call */ - /* NOTE: the following line of code is not required in this case, but it doesn't - * harm to leave it in, as in the case of a non-formal syntax function call, - * it will always return NULL. - * We leave it in in case we later decide to merge this part of the code together - * with the function calling code in generate_c_st_c, which does require - * the following line... - */ - if (param_value == NULL) - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) { - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; - } - - if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { - /* No value given for parameter, so we must use the default... */ - /* First check whether default value specified in function declaration...*/ - param_value = fp_iterator.default_value(); - } - - ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) - } /* for(...) */ - } - - if (function_call_param_iterator.next_nf() != NULL) ERROR; + 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_name = symbol->function_name; + + /* loop through each function parameter, find the value we should pass + * to it, and then output the c equivalent... + */ + + 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 */ + 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; + for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + if (fp_iterator.is_extensible_param() && (!found_first_extensible_parameter)) { + /* We are calling an extensible function. Before passing the extensible + * parameters, we must add a dummy paramater value to tell the called + * function how many extensible parameters we will be passing. + * + * Note that stage 3 has already determined the number of extensible + * paramters, and stored that info in the abstract syntax tree. We simply + * re-use that value. + */ + /* NOTE: we are not freeing the malloc'd memory. This is not really a bug. + * Since we are writing a compiler, which runs to termination quickly, + * we can consider this as just memory required for the compilation process + * that will be free'd when the program terminates. + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + if (tmp == NULL) ERROR; + int res = snprintf(tmp, 32, "%d", symbol->extensible_param_count); + if ((res >= 32) || (res < 0)) ERROR; + identifier_c *param_value = new identifier_c(tmp); + uint_type_name_c *param_type = new uint_type_name_c(); + identifier_c *param_name = new identifier_c(""); + ADD_PARAM_LIST(param_name, param_value, param_type, function_param_iterator_c::direction_in) + found_first_extensible_parameter = true; + } + + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; + + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); + + symbol_c *param_value = NULL; + + /* Get the value from a foo( = ) style call */ + /* NOTE: the following line of code is not required in this case, but it doesn't + * harm to leave it in, as in the case of a non-formal syntax function call, + * it will always return NULL. + * We leave it in in case we later decide to merge this part of the code together + * with the function calling code in generate_c_st_c, which does require + * the following line... + */ + if (param_value == NULL) + param_value = function_call_param_iterator.search_f(param_name); + + /* 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! + * + * 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! + */ + if ((param_value == NULL) && (!used_defvar) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = &this->default_variable_name; + used_defvar = true; + } + + /* Get the value from a foo() style call */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = function_call_param_iterator.next_nf(); + } + + /* if no more parameter values in function call, and the current parameter + * of the function declaration is an extensible parameter, we + * have reached the end, and should simply jump out of the for loop. + */ + if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { + break; + } + + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { + /* No value given for parameter, so we must use the default... */ + /* First check whether default value specified in function declaration...*/ + param_value = fp_iterator.default_value(); + } + + ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) + } /* for(...) */ + + if (function_call_param_iterator.next_nf() != NULL) ERROR; if (NULL == function_type_prefix) ERROR; bool has_output_params = false; @@ -560,8 +590,16 @@ } } + /* Check whether we are calling an overloaded function! */ + /* (fdecl_mutiplicity==2) => calling overloaded function */ + int fdecl_mutiplicity = function_symtable.multiplicity(symbol->function_name); + if (fdecl_mutiplicity == 0) ERROR; + if (fdecl_mutiplicity == 1) + /* function being called is NOT overloaded! */ + f_decl = NULL; + if (has_output_params) - generate_inline(function_name, function_type_prefix, function_type_suffix, param_list); + generate_inline(function_name, function_type_prefix, function_type_suffix, param_list, f_decl); CLEAR_PARAM_LIST() @@ -625,87 +663,103 @@ function_call_param_iterator_c function_call_param_iterator(symbol); - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; - - function_type_prefix = (symbol_c *)search_expression_type->compute_standard_function_default(NULL, symbol); - - int nb_param = 0; - if (symbol->il_param_list != NULL) - nb_param += ((list_c *)symbol->il_param_list)->n; - - symbol_c *en_param_name = (symbol_c *)(new identifier_c("EN")); - /* Get the value from EN param */ - symbol_c *EN_param_value = function_call_param_iterator.search_f(en_param_name); - if (EN_param_value == NULL) - EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())); - else - nb_param --; - ADD_PARAM_LIST(en_param_name, EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in) - - symbol_c *eno_param_name = (symbol_c *)(new identifier_c("ENO")); - /* Get the value from ENO param */ - symbol_c *ENO_param_value = function_call_param_iterator.search_f(eno_param_name); - if (ENO_param_value != NULL) - nb_param --; - ADD_PARAM_LIST(eno_param_name, ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) - - #include "st_code_gen.c" - - } - else { - 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); - - /* loop through each function parameter, find the value we should pass - * to it, and then output the c equivalent... - */ - - function_param_iterator_c fp_iterator(f_decl); - identifier_c *param_name; - for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - - function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - - - symbol_c *param_value = NULL; - - /* Get the value from a foo( = ) style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - /* NOTE: the following line of code is not required in this case, but it doesn't - * harm to leave it in, as in the case of a formal syntax function call, - * it will always return NULL. - * We leave it in in case we later decide to merge this part of the code together - * with the function calling code in generate_c_st_c, which does require - * the following line... - */ - if (param_value == NULL) { - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; - } - - if (param_value == NULL) { - /* No value given for parameter, so we must use the default... */ - /* First check whether default value specified in function declaration...*/ - param_value = fp_iterator.default_value(); - } - - ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) - } + 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); + if (NULL == function_type_prefix) ERROR; + + function_name = symbol->function_name; + + /* loop through each function parameter, find the value we should pass + * to it, and then output the c equivalent... + */ + function_param_iterator_c fp_iterator(f_decl); + identifier_c *param_name; + + /* flag to cirreclty handle calls to extensible standard functions (i.e. functions with variable number of input parameters) */ + bool found_first_extensible_parameter = false; + for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + if (fp_iterator.is_extensible_param() && (!found_first_extensible_parameter)) { + /* We are calling an extensible function. Before passing the extensible + * parameters, we must add a dummy paramater value to tell the called + * function how many extensible parameters we will be passing. + * + * Note that stage 3 has already determined the number of extensible + * paramters, and stored that info in the abstract syntax tree. We simply + * re-use that value. + */ + /* NOTE: we are not freeing the malloc'd memory. This is not really a bug. + * Since we are writing a compiler, which runs to termination quickly, + * we can consider this as just memory required for the compilation process + * that will be free'd when the program terminates. + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + if (tmp == NULL) ERROR; + int res = snprintf(tmp, 32, "%d", symbol->extensible_param_count); + if ((res >= 32) || (res < 0)) ERROR; + identifier_c *param_value = new identifier_c(tmp); + uint_type_name_c *param_type = new uint_type_name_c(); + identifier_c *param_name = new identifier_c(""); + ADD_PARAM_LIST(param_name, param_value, param_type, function_param_iterator_c::direction_in) + found_first_extensible_parameter = true; + } + + if (fp_iterator.is_extensible_param()) { + /* since we are handling an extensible parameter, we must add the index to the + * parameter name so we can go looking for the value passed to the correct + * extended parameter (e.g. IN1, IN2, IN3, IN4, ...) + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + int res = snprintf(tmp, 32, "%d", fp_iterator.extensible_param_index()); + if ((res >= 32) || (res < 0)) ERROR; + param_name = new identifier_c(strdup2(param_name->value, tmp)); + if (param_name->value == NULL) ERROR; + } + + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; + + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); + + symbol_c *param_value = NULL; + + /* Get the value from a foo( = ) style call */ + if (param_value == NULL) + param_value = function_call_param_iterator.search_f(param_name); + + /* Get the value from a foo() style call */ + /* NOTE: the following line of code is not required in this case, but it doesn't + * harm to leave it in, as in the case of a formal syntax function call, + * it will always return NULL. + * We leave it in in case we later decide to merge this part of the code together + * with the function calling code in generate_c_st_c, which does require + * the following line... + */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = function_call_param_iterator.next_nf(); + } + + /* if no more parameter values in function call, and the current parameter + * of the function declaration is an extensible parameter, we + * have reached the end, and should simply jump out of the for loop. + */ + if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { + break; + } + + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { + /* No value given for parameter, so we must use the default... */ + /* First check whether default value specified in function declaration...*/ + param_value = fp_iterator.default_value(); + } + + ADD_PARAM_LIST(param_name, param_value, param_type, fp_iterator.param_direction()) } if (function_call_param_iterator.next_nf() != NULL) ERROR; - if (NULL == function_type_prefix) ERROR; bool has_output_params = false; @@ -717,8 +771,16 @@ } } + /* Check whether we are calling an overloaded function! */ + /* (fdecl_mutiplicity==2) => calling overloaded function */ + int fdecl_mutiplicity = function_symtable.multiplicity(symbol->function_name); + if (fdecl_mutiplicity == 0) ERROR; + if (fdecl_mutiplicity == 1) + /* function being called is NOT overloaded! */ + f_decl = NULL; + if (has_output_params) - generate_inline(function_name, function_type_prefix, function_type_suffix, param_list); + generate_inline(function_name, function_type_prefix, function_type_suffix, param_list, f_decl); CLEAR_PARAM_LIST() @@ -968,81 +1030,100 @@ function_call_param_iterator_c function_call_param_iterator(symbol); - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - /* The function called is not in the symtable, so we test if it is a - * standard function defined in standard */ - - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; - - function_type_prefix = search_expression_type->get_type(symbol); - - int nb_param = ((list_c *)parameter_assignment_list)->n; - - symbol_c *en_param_name = (symbol_c *)(new identifier_c("EN")); - /* Get the value from EN param */ - symbol_c *EN_param_value = function_call_param_iterator.search_f(en_param_name); - if (EN_param_value == NULL) - EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())); - else - nb_param --; - ADD_PARAM_LIST(en_param_name, EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in) - - symbol_c *eno_param_name = (symbol_c *)(new identifier_c("ENO")); - /* Get the value from ENO param */ - symbol_c *ENO_param_value = function_call_param_iterator.search_f(eno_param_name); - if (ENO_param_value != NULL) - nb_param --; - ADD_PARAM_LIST(eno_param_name, ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) - - #include "st_code_gen.c" - - } - else { - 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); - - /* loop through each function parameter, find the value we should pass - * to it, and then output the c equivalent... + function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration; + if (f_decl == NULL) ERROR; + + 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); + if (NULL == function_type_prefix) ERROR; + + /* loop through each function parameter, find the value we should pass + * to it, and then output the c equivalent... + */ + function_param_iterator_c fp_iterator(f_decl); + identifier_c *param_name; + /* flag to cirreclty handle calls to extensible standard functions (i.e. functions with variable number of input parameters) */ + bool found_first_extensible_parameter = false; + for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + if (fp_iterator.is_extensible_param() && (!found_first_extensible_parameter)) { + /* We are calling an extensible function. Before passing the extensible + * parameters, we must add a dummy paramater value to tell the called + * function how many extensible parameters we will be passing. + * + * Note that stage 3 has already determined the number of extensible + * paramters, and stored that info in the abstract syntax tree. We simply + * re-use that value. + */ + /* NOTE: we are not freeing the malloc'd memory. This is not really a bug. + * Since we are writing a compiler, which runs to termination quickly, + * we can consider this as just memory required for the compilation process + * that will be free'd when the program terminates. + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + if (tmp == NULL) ERROR; + int res = snprintf(tmp, 32, "%d", symbol->extensible_param_count); + if ((res >= 32) || (res < 0)) ERROR; + identifier_c *param_value = new identifier_c(tmp); + uint_type_name_c *param_type = new uint_type_name_c(); + identifier_c *param_name = new identifier_c(""); + ADD_PARAM_LIST(param_name, param_value, param_type, function_param_iterator_c::direction_in) + found_first_extensible_parameter = true; + } + + if (fp_iterator.is_extensible_param()) { + /* since we are handling an extensible parameter, we must add the index to the + * parameter name so we can go looking for the value passed to the correct + * extended parameter (e.g. IN1, IN2, IN3, IN4, ...) + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + int res = snprintf(tmp, 32, "%d", fp_iterator.extensible_param_index()); + if ((res >= 32) || (res < 0)) ERROR; + param_name = new identifier_c(strdup2(param_name->value, tmp)); + if (param_name->value == NULL) ERROR; + } + + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; + + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); + + symbol_c *param_value = NULL; + + /* Get the value from a foo( = ) style call */ + if (param_value == NULL) + param_value = function_call_param_iterator.search_f(param_name); + + /* Get the value from a foo() style call */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = function_call_param_iterator.next_nf(); + } + + /* if no more parameter values in function call, and the current parameter + * of the function declaration is an extensible parameter, we + * have reached the end, and should simply jump out of the for loop. */ - function_param_iterator_c fp_iterator(f_decl); - identifier_c *param_name; - for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - - function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - - /* Get the value from a foo( = ) style call */ - symbol_c *param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) { - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; - } - - if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { - /* No value given for parameter, so we must use the default... */ - /* First check whether default value specified in function declaration...*/ - param_value = fp_iterator.default_value(); - } - - ADD_PARAM_LIST(param_name, param_value, param_type, param_direction) - } /* for(...) */ - // symbol->parameter_assignment->accept(*this); - } + if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { + break; + } + + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { + /* No value given for parameter, so we must use the default... */ + /* First check whether default value specified in function declaration...*/ + param_value = fp_iterator.default_value(); + } + + ADD_PARAM_LIST(param_name, param_value, param_type, param_direction) + } /* for(...) */ + // symbol->parameter_assignment->accept(*this); if (function_call_param_iterator.next_nf() != NULL) ERROR; - if (NULL == function_type_prefix) ERROR; - - bool has_output_params = false; - - PARAM_LIST_ITERATOR() { + + bool has_output_params = false; + + PARAM_LIST_ITERATOR() { if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || PARAM_DIRECTION == function_param_iterator_c::direction_inout) && PARAM_VALUE != NULL) { @@ -1050,8 +1131,16 @@ } } + /* Check whether we are calling an overloaded function! */ + /* (fdecl_mutiplicity==2) => calling overloaded function */ + int fdecl_mutiplicity = function_symtable.multiplicity(symbol->function_name); + if (fdecl_mutiplicity == 0) ERROR; + if (fdecl_mutiplicity == 1) + /* function being called is NOT overloaded! */ + f_decl = NULL; + if (has_output_params) - generate_inline(function_name, function_type_prefix, function_type_suffix, param_list); + generate_inline(function_name, function_type_prefix, function_type_suffix, param_list, f_decl); CLEAR_PARAM_LIST() diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/generate_c_sfc.cc --- a/stage4/generate_c/generate_c_sfc.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_c/generate_c_sfc.cc Thu Sep 08 20:25:00 2011 +0200 @@ -519,7 +519,7 @@ s4o.print("activated"); } if (strcmp(qualifier, "D") == 0 || strcmp(qualifier, "L") == 0) { - s4o.print("active && __TIME_CMP("); + s4o.print("active && __time_cmp("); print_step_argument(current_step, "elapsed_time"); s4o.print(", "); symbol->action_time->accept(*this); @@ -640,7 +640,9 @@ /* generate elapsed_time initializations */ s4o.print(s4o.indent_spaces + "// Calculate elapsed_time\n"); s4o.print(s4o.indent_spaces +"current_time = __CURRENT_TIME;\n"); - s4o.print(s4o.indent_spaces +"elapsed_time = __time_sub(__BOOL_LITERAL(TRUE), NULL, current_time, "); +// s4o.print(s4o.indent_spaces +"elapsed_time = __time_sub(__BOOL_LITERAL(TRUE), NULL, current_time, "); +// s4o.print(s4o.indent_spaces +"elapsed_time = SUB_TIME(__BOOL_LITERAL(TRUE), NULL, current_time, "); + s4o.print(s4o.indent_spaces +"elapsed_time = __time_sub(current_time, "); print_variable_prefix(); s4o.print("__lasttick_time);\n"); s4o.print(s4o.indent_spaces); @@ -686,7 +688,9 @@ s4o.indent_right(); s4o.print(s4o.indent_spaces); print_variable_prefix(); - s4o.print("__step_list[i].elapsed_time = __time_add(__BOOL_LITERAL(TRUE), NULL, "); +// s4o.print("__step_list[i].elapsed_time = __time_add(__BOOL_LITERAL(TRUE), NULL, "); +// s4o.print("__step_list[i].elapsed_time = ADD_TIME(__BOOL_LITERAL(TRUE), NULL, "); + s4o.print("__step_list[i].elapsed_time = __time_add("); print_variable_prefix(); s4o.print("__step_list[i].elapsed_time, elapsed_time);\n"); s4o.indent_left(); @@ -710,17 +714,19 @@ print_variable_prefix(); s4o.print("__action_list[i].reset = 0;\n"); s4o.print(s4o.indent_spaces + "if ("); - s4o.print("__TIME_CMP("); + s4o.print("__time_cmp("); print_variable_prefix(); s4o.print("__action_list[i].set_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) > 0) {\n"); s4o.indent_right(); s4o.print(s4o.indent_spaces); print_variable_prefix(); - s4o.print("__action_list[i].set_remaining_time = __time_sub(__BOOL_LITERAL(TRUE), NULL, "); +// s4o.print("__action_list[i].set_remaining_time = __time_sub(__BOOL_LITERAL(TRUE), NULL, "); +// s4o.print("__action_list[i].set_remaining_time = SUB_TIME(__BOOL_LITERAL(TRUE), NULL, "); + s4o.print("__action_list[i].set_remaining_time = __time_sub("); print_variable_prefix(); s4o.print("__action_list[i].set_remaining_time, elapsed_time);\n"); s4o.print(s4o.indent_spaces + "if ("); - s4o.print("__TIME_CMP("); + s4o.print("__time_cmp("); print_variable_prefix(); s4o.print("__action_list[i].set_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) <= 0) {\n"); s4o.indent_right(); @@ -735,17 +741,19 @@ s4o.indent_left(); s4o.print(s4o.indent_spaces + "}\n"); s4o.print(s4o.indent_spaces + "if ("); - s4o.print("__TIME_CMP("); + s4o.print("__time_cmp("); print_variable_prefix(); s4o.print("__action_list[i].reset_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) > 0) {\n"); s4o.indent_right(); s4o.print(s4o.indent_spaces); print_variable_prefix(); - s4o.print("__action_list[i].reset_remaining_time = __time_sub(__BOOL_LITERAL(TRUE), NULL, "); +// s4o.print("__action_list[i].reset_remaining_time = __time_sub(__BOOL_LITERAL(TRUE), NULL, "); +// s4o.print("__action_list[i].reset_remaining_time = SUB_TIME(__BOOL_LITERAL(TRUE), NULL, "); + s4o.print("__action_list[i].reset_remaining_time = __time_sub("); print_variable_prefix(); s4o.print("__action_list[i].reset_remaining_time, elapsed_time);\n"); s4o.print(s4o.indent_spaces + "if ("); - s4o.print("__TIME_CMP("); + s4o.print("__time_cmp("); print_variable_prefix(); s4o.print("__action_list[i].reset_remaining_time, __time_to_timespec(1, 0, 0, 0, 0, 0)) <= 0) {\n"); s4o.indent_right(); diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/generate_c_st.cc --- a/stage4/generate_c/generate_c_st.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_c/generate_c_st.cc Thu Sep 08 20:25:00 2011 +0200 @@ -35,6 +35,9 @@ */ + +#include "../../util/strdup.hh" + /***********************************************************************/ /***********************************************************************/ /***********************************************************************/ @@ -462,7 +465,7 @@ 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); + return print_compare_function("EQ_", left_type, symbol->l_exp, symbol->r_exp); return print_binary_expression(symbol->l_exp, symbol->r_exp, " == "); } @@ -473,7 +476,7 @@ 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); + return print_compare_function("NE_", left_type, symbol->l_exp, symbol->r_exp); return print_binary_expression(symbol->l_exp, symbol->r_exp, " != "); } @@ -484,7 +487,7 @@ 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); + 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; @@ -498,7 +501,7 @@ 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); + 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; @@ -512,7 +515,7 @@ 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); + 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; @@ -526,7 +529,7 @@ 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); + 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; @@ -539,7 +542,7 @@ 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))) - return print_binary_function("__TIME_ADD", symbol->l_exp, symbol->r_exp); + 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)) @@ -557,7 +560,7 @@ (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); + 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)) @@ -571,7 +574,7 @@ 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))) - return print_binary_function("__TIME_MUL", symbol->l_exp, symbol->r_exp); + 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)) @@ -585,7 +588,7 @@ 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))) - return print_binary_function("__TIME_DIV", symbol->l_exp, symbol->r_exp); + 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)) @@ -615,7 +618,7 @@ 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((BOOL)__BOOL_LITERAL(TRUE),\n"); + 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)("); @@ -627,6 +630,7 @@ return NULL; } ERROR; + return NULL; } void *visit(neg_expression_c *symbol) { @@ -642,9 +646,7 @@ } void *visit(function_invocation_c *symbol) { - symbol_c* function_type_prefix = NULL; symbol_c* function_name = NULL; - symbol_c* function_type_suffix = NULL; DECLARE_PARAM_LIST() symbol_c *parameter_assignment_list = NULL; @@ -654,71 +656,89 @@ function_call_param_iterator_c function_call_param_iterator(symbol); - function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); - if (f_decl == function_symtable.end_value()) { - /* The function called is not in the symtable, so we test if it is a - * standard function defined in standard */ - - function_type_t current_function_type = get_function_type((identifier_c *)symbol->function_name); - if (current_function_type == function_none) ERROR; - - symbol_c *function_return_type = search_expression_type->get_type(symbol); - - int nb_param = ((list_c *)parameter_assignment_list)->n; - - symbol_c *en_param_name = (symbol_c *)(new identifier_c("EN")); - /* Get the value from EN param */ - symbol_c *EN_param_value = function_call_param_iterator.search_f(en_param_name); - if (EN_param_value == NULL) - EN_param_value = (symbol_c*)(new boolean_literal_c((symbol_c*)(new bool_type_name_c()), new boolean_true_c())); - else - nb_param --; - ADD_PARAM_LIST(en_param_name, EN_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_in) - - symbol_c *eno_param_name = (symbol_c *)(new identifier_c("ENO")); - /* Get the value from ENO param */ - symbol_c *ENO_param_value = function_call_param_iterator.search_f(eno_param_name); - if (ENO_param_value != NULL) - nb_param --; - ADD_PARAM_LIST(eno_param_name, ENO_param_value, (symbol_c*)(new bool_type_name_c()), function_param_iterator_c::direction_out) - - #include "st_code_gen.c" - - } - else { - function_name = symbol->function_name; - - /* loop through each function parameter, find the value we should pass - * to it, and then output the c equivalent... + function_declaration_c *f_decl = (function_declaration_c *)symbol->called_function_declaration; + if (f_decl == NULL) ERROR; + + function_name = symbol->function_name; + + /* loop through each function parameter, find the value we should pass + * to it, and then output the c equivalent... + */ + function_param_iterator_c fp_iterator(f_decl); + identifier_c *param_name; + /* flag to cirreclty handle calls to extensible standard functions (i.e. functions with variable number of input parameters) */ + bool found_first_extensible_parameter = false; + for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { + if (fp_iterator.is_extensible_param() && (!found_first_extensible_parameter)) { + /* We are calling an extensible function. Before passing the extensible + * parameters, we must add a dummy paramater value to tell the called + * function how many extensible parameters we will be passing. + * + * Note that stage 3 has already determined the number of extensible + * paramters, and stored that info in the abstract syntax tree. We simply + * re-use that value. + */ + /* NOTE: we are not freeing the malloc'd memory. This is not really a bug. + * Since we are writing a compiler, which runs to termination quickly, + * we can consider this as just memory required for the compilation process + * that will be free'd when the program terminates. + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + if (tmp == NULL) ERROR; + int res = snprintf(tmp, 32, "%d", symbol->extensible_param_count); + if ((res >= 32) || (res < 0)) ERROR; + identifier_c *param_value = new identifier_c(tmp); + uint_type_name_c *param_type = new uint_type_name_c(); + identifier_c *param_name = new identifier_c(""); + ADD_PARAM_LIST(param_name, param_value, param_type, function_param_iterator_c::direction_in) + found_first_extensible_parameter = true; + } + + if (fp_iterator.is_extensible_param()) { + /* since we are handling an extensible parameter, we must add the index to the + * parameter name so we can go looking for the value passed to the correct + * extended parameter (e.g. IN1, IN2, IN3, IN4, ...) + */ + char *tmp = (char *)malloc(32); /* enough space for a call with 10^31 (larger than 2^64) input parameters! */ + int res = snprintf(tmp, 32, "%d", fp_iterator.extensible_param_index()); + if ((res >= 32) || (res < 0)) ERROR; + param_name = new identifier_c(strdup2(param_name->value, tmp)); + if (param_name->value == NULL) ERROR; + } + + symbol_c *param_type = fp_iterator.param_type(); + if (param_type == NULL) ERROR; + + function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); + + symbol_c *param_value = NULL; + + /* Get the value from a foo( = ) style call */ + if (param_value == NULL) + param_value = function_call_param_iterator.search_f(param_name); + + /* Get the value from a foo() style call */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) { + param_value = function_call_param_iterator.next_nf(); + } + + /* if no more parameter values in function call, and the current parameter + * of the function declaration is an extensible parameter, we + * have reached the end, and should simply jump out of the for loop. */ - function_param_iterator_c fp_iterator(f_decl); - identifier_c *param_name; - for(int i = 1; (param_name = fp_iterator.next()) != NULL; i++) { - - symbol_c *param_type = fp_iterator.param_type(); - if (param_type == NULL) ERROR; - - function_param_iterator_c::param_direction_t param_direction = fp_iterator.param_direction(); - - /* Get the value from a foo( = ) style call */ - symbol_c *param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) { - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL && fp_iterator.is_en_eno_param_implicit()) ERROR; - } - - if (param_value == NULL && param_direction == function_param_iterator_c::direction_in) { - /* No value given for parameter, so we must use the default... */ - /* First check whether default value specified in function declaration...*/ - param_value = fp_iterator.default_value(); - } - - ADD_PARAM_LIST(param_name, param_value, param_type, param_direction) - } /* for(...) */ - // symbol->parameter_assignment->accept(*this); - } + if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { + break; + } + + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { + /* No value given for parameter, so we must use the default... */ + /* First check whether default value specified in function declaration...*/ + param_value = fp_iterator.default_value(); + } + + ADD_PARAM_LIST(param_name, param_value, param_type, param_direction) + } /* for(...) */ + // symbol->parameter_assignment->accept(*this); if (function_call_param_iterator.next_nf() != NULL) ERROR; @@ -726,38 +746,41 @@ if (!this->is_variable_prefix_null()) { PARAM_LIST_ITERATOR() { - if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || - PARAM_DIRECTION == function_param_iterator_c::direction_inout) && - PARAM_VALUE != NULL) { - if (!has_output_params) { - has_output_params = true; - } - } - } - } - - if (function_type_prefix != NULL) { - s4o.print("("); - search_expression_type->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); - } + if ((PARAM_DIRECTION == function_param_iterator_c::direction_out || + PARAM_DIRECTION == function_param_iterator_c::direction_inout) && + PARAM_VALUE != NULL) { + has_output_params = true; + } + } + } + + /* Check whether we are calling an overloaded function! */ + /* (fdecl_mutiplicity==2) => calling overloaded function */ + int fdecl_mutiplicity = function_symtable.multiplicity(symbol->function_name); + if (fdecl_mutiplicity == 0) ERROR; + if (has_output_params) { - fcall_number++; - s4o.print("__"); + fcall_number++; + s4o.print("__"); fbname->accept(*this); s4o.print("_"); function_name->accept(*this); - if (function_type_suffix != NULL) - function_type_suffix->accept(*this); + if (fdecl_mutiplicity == 2) { + /* function being called is overloaded! */ + s4o.print("__"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } s4o.print_integer(fcall_number); } else { function_name->accept(*this); - if (function_type_suffix != NULL) - function_type_suffix->accept(*this); + if (fdecl_mutiplicity == 2) { + /* function being called is overloaded! */ + s4o.print("__"); + print_function_parameter_data_types_c overloaded_func_suf(&s4o); + f_decl->accept(overloaded_func_suf); + } } s4o.print("("); s4o.indent_right(); @@ -885,7 +908,10 @@ symbol_c *param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + /* When using the informal invocation style, user can not pass values to EN or ENO parameters if these + * were implicitly defined! + */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) param_value = function_call_param_iterator.next_nf(); symbol_c *param_type = fp_iterator.param_type(); @@ -929,7 +955,10 @@ symbol_c *param_value = function_call_param_iterator.search_f(param_name); /* Get the value from a foo() style call */ - if (param_value == NULL) + /* When using the informal invocation style, user can not pass values to EN or ENO parameters if these + * were implicitly defined! + */ + if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) param_value = function_call_param_iterator.next_nf(); /* now output the value assignment */ diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/generate_c_typedecl.cc --- a/stage4/generate_c/generate_c_typedecl.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_c/generate_c_typedecl.cc Thu Sep 08 20:25:00 2011 +0200 @@ -76,10 +76,6 @@ basetypedeclaration_t current_basetypedeclaration; - int extract_integer(symbol_c *integer) { - return atoi(((integer_c *)integer)->value); - } - void print_integer(unsigned int integer) { char str[10]; sprintf(str, "%d", integer); diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/il_code_gen.c --- a/stage4/generate_c/il_code_gen.c Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18040 +0,0 @@ -/* - * Copyright (C) 2007-2011: Edouard TISSERANT and Laurent BESSARD - * - * See COPYING and COPYING.LESSER files for copyright details. - * - * 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 . - * - */ - -/**** - * IEC 61131-3 standard function library - * generated code, do not edit by hand - */ - - -switch(current_function_type){ - -/**** - *REAL_TO_SINT - */ - case function_real_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_sint*/ - break; - -/**** - *REAL_TO_LINT - */ - case function_real_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_lint*/ - break; - -/**** - *REAL_TO_DINT - */ - case function_real_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_dint*/ - break; - -/**** - *REAL_TO_DATE - */ - case function_real_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_date*/ - break; - -/**** - *REAL_TO_DWORD - */ - case function_real_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_dword*/ - break; - -/**** - *REAL_TO_DT - */ - case function_real_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_dt*/ - break; - -/**** - *REAL_TO_TOD - */ - case function_real_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_tod*/ - break; - -/**** - *REAL_TO_UDINT - */ - case function_real_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_udint*/ - break; - -/**** - *REAL_TO_WORD - */ - case function_real_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_word*/ - break; - -/**** - *REAL_TO_STRING - */ - case function_real_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_string*/ - break; - -/**** - *REAL_TO_LWORD - */ - case function_real_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_lword*/ - break; - -/**** - *REAL_TO_UINT - */ - case function_real_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_uint*/ - break; - -/**** - *REAL_TO_LREAL - */ - case function_real_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_lreal*/ - break; - -/**** - *REAL_TO_BYTE - */ - case function_real_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_byte*/ - break; - -/**** - *REAL_TO_USINT - */ - case function_real_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_usint*/ - break; - -/**** - *REAL_TO_ULINT - */ - case function_real_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_ulint*/ - break; - -/**** - *REAL_TO_BOOL - */ - case function_real_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_bool*/ - break; - -/**** - *REAL_TO_TIME - */ - case function_real_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_time*/ - break; - -/**** - *REAL_TO_INT - */ - case function_real_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_int*/ - break; - -/**** - *SINT_TO_REAL - */ - case function_sint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_real*/ - break; - -/**** - *SINT_TO_LINT - */ - case function_sint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_lint*/ - break; - -/**** - *SINT_TO_DINT - */ - case function_sint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_dint*/ - break; - -/**** - *SINT_TO_DATE - */ - case function_sint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_date*/ - break; - -/**** - *SINT_TO_DWORD - */ - case function_sint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_dword*/ - break; - -/**** - *SINT_TO_DT - */ - case function_sint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_dt*/ - break; - -/**** - *SINT_TO_TOD - */ - case function_sint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_tod*/ - break; - -/**** - *SINT_TO_UDINT - */ - case function_sint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_udint*/ - break; - -/**** - *SINT_TO_WORD - */ - case function_sint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_word*/ - break; - -/**** - *SINT_TO_STRING - */ - case function_sint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_string*/ - break; - -/**** - *SINT_TO_LWORD - */ - case function_sint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_lword*/ - break; - -/**** - *SINT_TO_UINT - */ - case function_sint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_uint*/ - break; - -/**** - *SINT_TO_LREAL - */ - case function_sint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_lreal*/ - break; - -/**** - *SINT_TO_BYTE - */ - case function_sint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_byte*/ - break; - -/**** - *SINT_TO_USINT - */ - case function_sint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_usint*/ - break; - -/**** - *SINT_TO_ULINT - */ - case function_sint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_ulint*/ - break; - -/**** - *SINT_TO_BOOL - */ - case function_sint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_bool*/ - break; - -/**** - *SINT_TO_TIME - */ - case function_sint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_time*/ - break; - -/**** - *SINT_TO_INT - */ - case function_sint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_int*/ - break; - -/**** - *LINT_TO_REAL - */ - case function_lint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_real*/ - break; - -/**** - *LINT_TO_SINT - */ - case function_lint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_sint*/ - break; - -/**** - *LINT_TO_DINT - */ - case function_lint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_dint*/ - break; - -/**** - *LINT_TO_DATE - */ - case function_lint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_date*/ - break; - -/**** - *LINT_TO_DWORD - */ - case function_lint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_dword*/ - break; - -/**** - *LINT_TO_DT - */ - case function_lint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_dt*/ - break; - -/**** - *LINT_TO_TOD - */ - case function_lint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_tod*/ - break; - -/**** - *LINT_TO_UDINT - */ - case function_lint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_udint*/ - break; - -/**** - *LINT_TO_WORD - */ - case function_lint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_word*/ - break; - -/**** - *LINT_TO_STRING - */ - case function_lint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_string*/ - break; - -/**** - *LINT_TO_LWORD - */ - case function_lint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_lword*/ - break; - -/**** - *LINT_TO_UINT - */ - case function_lint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_uint*/ - break; - -/**** - *LINT_TO_LREAL - */ - case function_lint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_lreal*/ - break; - -/**** - *LINT_TO_BYTE - */ - case function_lint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_byte*/ - break; - -/**** - *LINT_TO_USINT - */ - case function_lint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_usint*/ - break; - -/**** - *LINT_TO_ULINT - */ - case function_lint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_ulint*/ - break; - -/**** - *LINT_TO_BOOL - */ - case function_lint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_bool*/ - break; - -/**** - *LINT_TO_TIME - */ - case function_lint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_time*/ - break; - -/**** - *LINT_TO_INT - */ - case function_lint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_int*/ - break; - -/**** - *DINT_TO_REAL - */ - case function_dint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_real*/ - break; - -/**** - *DINT_TO_SINT - */ - case function_dint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_sint*/ - break; - -/**** - *DINT_TO_LINT - */ - case function_dint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_lint*/ - break; - -/**** - *DINT_TO_DATE - */ - case function_dint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_date*/ - break; - -/**** - *DINT_TO_DWORD - */ - case function_dint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_dword*/ - break; - -/**** - *DINT_TO_DT - */ - case function_dint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_dt*/ - break; - -/**** - *DINT_TO_TOD - */ - case function_dint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_tod*/ - break; - -/**** - *DINT_TO_UDINT - */ - case function_dint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_udint*/ - break; - -/**** - *DINT_TO_WORD - */ - case function_dint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_word*/ - break; - -/**** - *DINT_TO_STRING - */ - case function_dint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_string*/ - break; - -/**** - *DINT_TO_LWORD - */ - case function_dint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_lword*/ - break; - -/**** - *DINT_TO_UINT - */ - case function_dint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_uint*/ - break; - -/**** - *DINT_TO_LREAL - */ - case function_dint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_lreal*/ - break; - -/**** - *DINT_TO_BYTE - */ - case function_dint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_byte*/ - break; - -/**** - *DINT_TO_USINT - */ - case function_dint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_usint*/ - break; - -/**** - *DINT_TO_ULINT - */ - case function_dint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_ulint*/ - break; - -/**** - *DINT_TO_BOOL - */ - case function_dint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_bool*/ - break; - -/**** - *DINT_TO_TIME - */ - case function_dint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_time*/ - break; - -/**** - *DINT_TO_INT - */ - case function_dint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_int*/ - break; - -/**** - *DATE_TO_REAL - */ - case function_date_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_real*/ - break; - -/**** - *DATE_TO_SINT - */ - case function_date_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_sint*/ - break; - -/**** - *DATE_TO_LINT - */ - case function_date_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_lint*/ - break; - -/**** - *DATE_TO_DINT - */ - case function_date_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_dint*/ - break; - -/**** - *DATE_TO_DWORD - */ - case function_date_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_dword*/ - break; - -/**** - *DATE_TO_UDINT - */ - case function_date_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_udint*/ - break; - -/**** - *DATE_TO_WORD - */ - case function_date_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_word*/ - break; - -/**** - *DATE_TO_STRING - */ - case function_date_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__date_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_string*/ - break; - -/**** - *DATE_TO_LWORD - */ - case function_date_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_lword*/ - break; - -/**** - *DATE_TO_UINT - */ - case function_date_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_uint*/ - break; - -/**** - *DATE_TO_LREAL - */ - case function_date_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_lreal*/ - break; - -/**** - *DATE_TO_BYTE - */ - case function_date_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_byte*/ - break; - -/**** - *DATE_TO_USINT - */ - case function_date_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_usint*/ - break; - -/**** - *DATE_TO_ULINT - */ - case function_date_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_ulint*/ - break; - -/**** - *DATE_TO_INT - */ - case function_date_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_int*/ - break; - -/**** - *DWORD_TO_REAL - */ - case function_dword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_real*/ - break; - -/**** - *DWORD_TO_SINT - */ - case function_dword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_sint*/ - break; - -/**** - *DWORD_TO_LINT - */ - case function_dword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_lint*/ - break; - -/**** - *DWORD_TO_DINT - */ - case function_dword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_dint*/ - break; - -/**** - *DWORD_TO_DATE - */ - case function_dword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_date*/ - break; - -/**** - *DWORD_TO_DT - */ - case function_dword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_dt*/ - break; - -/**** - *DWORD_TO_TOD - */ - case function_dword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_tod*/ - break; - -/**** - *DWORD_TO_UDINT - */ - case function_dword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_udint*/ - break; - -/**** - *DWORD_TO_WORD - */ - case function_dword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_word*/ - break; - -/**** - *DWORD_TO_STRING - */ - case function_dword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_string*/ - break; - -/**** - *DWORD_TO_LWORD - */ - case function_dword_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_lword*/ - break; - -/**** - *DWORD_TO_UINT - */ - case function_dword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_uint*/ - break; - -/**** - *DWORD_TO_LREAL - */ - case function_dword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_lreal*/ - break; - -/**** - *DWORD_TO_BYTE - */ - case function_dword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_byte*/ - break; - -/**** - *DWORD_TO_USINT - */ - case function_dword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_usint*/ - break; - -/**** - *DWORD_TO_ULINT - */ - case function_dword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_ulint*/ - break; - -/**** - *DWORD_TO_BOOL - */ - case function_dword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_bool*/ - break; - -/**** - *DWORD_TO_TIME - */ - case function_dword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_time*/ - break; - -/**** - *DWORD_TO_INT - */ - case function_dword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_int*/ - break; - -/**** - *DT_TO_REAL - */ - case function_dt_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_real*/ - break; - -/**** - *DT_TO_SINT - */ - case function_dt_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_sint*/ - break; - -/**** - *DT_TO_LINT - */ - case function_dt_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_lint*/ - break; - -/**** - *DT_TO_DINT - */ - case function_dt_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_dint*/ - break; - -/**** - *DT_TO_DWORD - */ - case function_dt_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_dword*/ - break; - -/**** - *DT_TO_UDINT - */ - case function_dt_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_udint*/ - break; - -/**** - *DT_TO_WORD - */ - case function_dt_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_word*/ - break; - -/**** - *DT_TO_STRING - */ - case function_dt_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__dt_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_string*/ - break; - -/**** - *DT_TO_LWORD - */ - case function_dt_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_lword*/ - break; - -/**** - *DT_TO_UINT - */ - case function_dt_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_uint*/ - break; - -/**** - *DT_TO_LREAL - */ - case function_dt_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_lreal*/ - break; - -/**** - *DT_TO_BYTE - */ - case function_dt_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_byte*/ - break; - -/**** - *DT_TO_USINT - */ - case function_dt_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_usint*/ - break; - -/**** - *DT_TO_ULINT - */ - case function_dt_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_ulint*/ - break; - -/**** - *DT_TO_INT - */ - case function_dt_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_int*/ - break; - -/**** - *TOD_TO_REAL - */ - case function_tod_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_real*/ - break; - -/**** - *TOD_TO_SINT - */ - case function_tod_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_sint*/ - break; - -/**** - *TOD_TO_LINT - */ - case function_tod_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_lint*/ - break; - -/**** - *TOD_TO_DINT - */ - case function_tod_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_dint*/ - break; - -/**** - *TOD_TO_DWORD - */ - case function_tod_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_dword*/ - break; - -/**** - *TOD_TO_UDINT - */ - case function_tod_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_udint*/ - break; - -/**** - *TOD_TO_WORD - */ - case function_tod_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_word*/ - break; - -/**** - *TOD_TO_STRING - */ - case function_tod_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__tod_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_string*/ - break; - -/**** - *TOD_TO_LWORD - */ - case function_tod_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_lword*/ - break; - -/**** - *TOD_TO_UINT - */ - case function_tod_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_uint*/ - break; - -/**** - *TOD_TO_LREAL - */ - case function_tod_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_lreal*/ - break; - -/**** - *TOD_TO_BYTE - */ - case function_tod_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_byte*/ - break; - -/**** - *TOD_TO_USINT - */ - case function_tod_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_usint*/ - break; - -/**** - *TOD_TO_ULINT - */ - case function_tod_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_ulint*/ - break; - -/**** - *TOD_TO_INT - */ - case function_tod_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_int*/ - break; - -/**** - *UDINT_TO_REAL - */ - case function_udint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_real*/ - break; - -/**** - *UDINT_TO_SINT - */ - case function_udint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_sint*/ - break; - -/**** - *UDINT_TO_LINT - */ - case function_udint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_lint*/ - break; - -/**** - *UDINT_TO_DINT - */ - case function_udint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_dint*/ - break; - -/**** - *UDINT_TO_DATE - */ - case function_udint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_date*/ - break; - -/**** - *UDINT_TO_DWORD - */ - case function_udint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_dword*/ - break; - -/**** - *UDINT_TO_DT - */ - case function_udint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_dt*/ - break; - -/**** - *UDINT_TO_TOD - */ - case function_udint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_tod*/ - break; - -/**** - *UDINT_TO_WORD - */ - case function_udint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_word*/ - break; - -/**** - *UDINT_TO_STRING - */ - case function_udint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_string*/ - break; - -/**** - *UDINT_TO_LWORD - */ - case function_udint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_lword*/ - break; - -/**** - *UDINT_TO_UINT - */ - case function_udint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_uint*/ - break; - -/**** - *UDINT_TO_LREAL - */ - case function_udint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_lreal*/ - break; - -/**** - *UDINT_TO_BYTE - */ - case function_udint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_byte*/ - break; - -/**** - *UDINT_TO_USINT - */ - case function_udint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_usint*/ - break; - -/**** - *UDINT_TO_ULINT - */ - case function_udint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_ulint*/ - break; - -/**** - *UDINT_TO_BOOL - */ - case function_udint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_bool*/ - break; - -/**** - *UDINT_TO_TIME - */ - case function_udint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_time*/ - break; - -/**** - *UDINT_TO_INT - */ - case function_udint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_int*/ - break; - -/**** - *WORD_TO_REAL - */ - case function_word_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_real*/ - break; - -/**** - *WORD_TO_SINT - */ - case function_word_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_sint*/ - break; - -/**** - *WORD_TO_LINT - */ - case function_word_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_lint*/ - break; - -/**** - *WORD_TO_DINT - */ - case function_word_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_dint*/ - break; - -/**** - *WORD_TO_DATE - */ - case function_word_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_date*/ - break; - -/**** - *WORD_TO_DWORD - */ - case function_word_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_dword*/ - break; - -/**** - *WORD_TO_DT - */ - case function_word_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_dt*/ - break; - -/**** - *WORD_TO_TOD - */ - case function_word_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_tod*/ - break; - -/**** - *WORD_TO_UDINT - */ - case function_word_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_udint*/ - break; - -/**** - *WORD_TO_STRING - */ - case function_word_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_string*/ - break; - -/**** - *WORD_TO_LWORD - */ - case function_word_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_lword*/ - break; - -/**** - *WORD_TO_UINT - */ - case function_word_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_uint*/ - break; - -/**** - *WORD_TO_LREAL - */ - case function_word_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_lreal*/ - break; - -/**** - *WORD_TO_BYTE - */ - case function_word_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_byte*/ - break; - -/**** - *WORD_TO_USINT - */ - case function_word_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_usint*/ - break; - -/**** - *WORD_TO_ULINT - */ - case function_word_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_ulint*/ - break; - -/**** - *WORD_TO_BOOL - */ - case function_word_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_bool*/ - break; - -/**** - *WORD_TO_TIME - */ - case function_word_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_time*/ - break; - -/**** - *WORD_TO_INT - */ - case function_word_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_int*/ - break; - -/**** - *STRING_TO_REAL - */ - case function_string_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_real*/ - break; - -/**** - *STRING_TO_SINT - */ - case function_string_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_sint*/ - break; - -/**** - *STRING_TO_LINT - */ - case function_string_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_lint*/ - break; - -/**** - *STRING_TO_DINT - */ - case function_string_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_dint*/ - break; - -/**** - *STRING_TO_DATE - */ - case function_string_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_date*/ - break; - -/**** - *STRING_TO_DWORD - */ - case function_string_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_dword*/ - break; - -/**** - *STRING_TO_DT - */ - case function_string_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_dt*/ - break; - -/**** - *STRING_TO_TOD - */ - case function_string_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_tod*/ - break; - -/**** - *STRING_TO_UDINT - */ - case function_string_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_udint*/ - break; - -/**** - *STRING_TO_WORD - */ - case function_string_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_word*/ - break; - -/**** - *STRING_TO_LWORD - */ - case function_string_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_lword*/ - break; - -/**** - *STRING_TO_UINT - */ - case function_string_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_uint*/ - break; - -/**** - *STRING_TO_LREAL - */ - case function_string_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_lreal*/ - break; - -/**** - *STRING_TO_BYTE - */ - case function_string_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_byte*/ - break; - -/**** - *STRING_TO_USINT - */ - case function_string_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_usint*/ - break; - -/**** - *STRING_TO_ULINT - */ - case function_string_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_ulint*/ - break; - -/**** - *STRING_TO_BOOL - */ - case function_string_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bool")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_bool*/ - break; - -/**** - *STRING_TO_TIME - */ - case function_string_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_time*/ - break; - -/**** - *STRING_TO_INT - */ - case function_string_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_int*/ - break; - -/**** - *LWORD_TO_REAL - */ - case function_lword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_real*/ - break; - -/**** - *LWORD_TO_SINT - */ - case function_lword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_sint*/ - break; - -/**** - *LWORD_TO_LINT - */ - case function_lword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_lint*/ - break; - -/**** - *LWORD_TO_DINT - */ - case function_lword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_dint*/ - break; - -/**** - *LWORD_TO_DATE - */ - case function_lword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_date*/ - break; - -/**** - *LWORD_TO_DWORD - */ - case function_lword_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_dword*/ - break; - -/**** - *LWORD_TO_DT - */ - case function_lword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_dt*/ - break; - -/**** - *LWORD_TO_TOD - */ - case function_lword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_tod*/ - break; - -/**** - *LWORD_TO_UDINT - */ - case function_lword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_udint*/ - break; - -/**** - *LWORD_TO_WORD - */ - case function_lword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_word*/ - break; - -/**** - *LWORD_TO_STRING - */ - case function_lword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_string*/ - break; - -/**** - *LWORD_TO_UINT - */ - case function_lword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_uint*/ - break; - -/**** - *LWORD_TO_LREAL - */ - case function_lword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_lreal*/ - break; - -/**** - *LWORD_TO_BYTE - */ - case function_lword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_byte*/ - break; - -/**** - *LWORD_TO_USINT - */ - case function_lword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_usint*/ - break; - -/**** - *LWORD_TO_ULINT - */ - case function_lword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_ulint*/ - break; - -/**** - *LWORD_TO_BOOL - */ - case function_lword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_bool*/ - break; - -/**** - *LWORD_TO_TIME - */ - case function_lword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_time*/ - break; - -/**** - *LWORD_TO_INT - */ - case function_lword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_int*/ - break; - -/**** - *UINT_TO_REAL - */ - case function_uint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_real*/ - break; - -/**** - *UINT_TO_SINT - */ - case function_uint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_sint*/ - break; - -/**** - *UINT_TO_LINT - */ - case function_uint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_lint*/ - break; - -/**** - *UINT_TO_DINT - */ - case function_uint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_dint*/ - break; - -/**** - *UINT_TO_DATE - */ - case function_uint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_date*/ - break; - -/**** - *UINT_TO_DWORD - */ - case function_uint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_dword*/ - break; - -/**** - *UINT_TO_DT - */ - case function_uint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_dt*/ - break; - -/**** - *UINT_TO_TOD - */ - case function_uint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_tod*/ - break; - -/**** - *UINT_TO_UDINT - */ - case function_uint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_udint*/ - break; - -/**** - *UINT_TO_WORD - */ - case function_uint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_word*/ - break; - -/**** - *UINT_TO_STRING - */ - case function_uint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_string*/ - break; - -/**** - *UINT_TO_LWORD - */ - case function_uint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_lword*/ - break; - -/**** - *UINT_TO_LREAL - */ - case function_uint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_lreal*/ - break; - -/**** - *UINT_TO_BYTE - */ - case function_uint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_byte*/ - break; - -/**** - *UINT_TO_USINT - */ - case function_uint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_usint*/ - break; - -/**** - *UINT_TO_ULINT - */ - case function_uint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_ulint*/ - break; - -/**** - *UINT_TO_BOOL - */ - case function_uint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_bool*/ - break; - -/**** - *UINT_TO_TIME - */ - case function_uint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_time*/ - break; - -/**** - *UINT_TO_INT - */ - case function_uint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_int*/ - break; - -/**** - *LREAL_TO_REAL - */ - case function_lreal_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_real*/ - break; - -/**** - *LREAL_TO_SINT - */ - case function_lreal_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_sint*/ - break; - -/**** - *LREAL_TO_LINT - */ - case function_lreal_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_lint*/ - break; - -/**** - *LREAL_TO_DINT - */ - case function_lreal_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_dint*/ - break; - -/**** - *LREAL_TO_DATE - */ - case function_lreal_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_date*/ - break; - -/**** - *LREAL_TO_DWORD - */ - case function_lreal_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_dword*/ - break; - -/**** - *LREAL_TO_DT - */ - case function_lreal_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_dt*/ - break; - -/**** - *LREAL_TO_TOD - */ - case function_lreal_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_tod*/ - break; - -/**** - *LREAL_TO_UDINT - */ - case function_lreal_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_udint*/ - break; - -/**** - *LREAL_TO_WORD - */ - case function_lreal_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_word*/ - break; - -/**** - *LREAL_TO_STRING - */ - case function_lreal_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_string*/ - break; - -/**** - *LREAL_TO_LWORD - */ - case function_lreal_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_lword*/ - break; - -/**** - *LREAL_TO_UINT - */ - case function_lreal_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_uint*/ - break; - -/**** - *LREAL_TO_BYTE - */ - case function_lreal_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_byte*/ - break; - -/**** - *LREAL_TO_USINT - */ - case function_lreal_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_usint*/ - break; - -/**** - *LREAL_TO_ULINT - */ - case function_lreal_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_ulint*/ - break; - -/**** - *LREAL_TO_BOOL - */ - case function_lreal_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_bool*/ - break; - -/**** - *LREAL_TO_TIME - */ - case function_lreal_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_time*/ - break; - -/**** - *LREAL_TO_INT - */ - case function_lreal_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_int*/ - break; - -/**** - *BYTE_TO_REAL - */ - case function_byte_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_real*/ - break; - -/**** - *BYTE_TO_SINT - */ - case function_byte_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_sint*/ - break; - -/**** - *BYTE_TO_LINT - */ - case function_byte_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_lint*/ - break; - -/**** - *BYTE_TO_DINT - */ - case function_byte_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_dint*/ - break; - -/**** - *BYTE_TO_DATE - */ - case function_byte_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_date*/ - break; - -/**** - *BYTE_TO_DWORD - */ - case function_byte_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_dword*/ - break; - -/**** - *BYTE_TO_DT - */ - case function_byte_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_dt*/ - break; - -/**** - *BYTE_TO_TOD - */ - case function_byte_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_tod*/ - break; - -/**** - *BYTE_TO_UDINT - */ - case function_byte_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_udint*/ - break; - -/**** - *BYTE_TO_WORD - */ - case function_byte_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_word*/ - break; - -/**** - *BYTE_TO_STRING - */ - case function_byte_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_string*/ - break; - -/**** - *BYTE_TO_LWORD - */ - case function_byte_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_lword*/ - break; - -/**** - *BYTE_TO_UINT - */ - case function_byte_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_uint*/ - break; - -/**** - *BYTE_TO_LREAL - */ - case function_byte_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_lreal*/ - break; - -/**** - *BYTE_TO_USINT - */ - case function_byte_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_usint*/ - break; - -/**** - *BYTE_TO_ULINT - */ - case function_byte_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_ulint*/ - break; - -/**** - *BYTE_TO_BOOL - */ - case function_byte_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_bool*/ - break; - -/**** - *BYTE_TO_TIME - */ - case function_byte_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_time*/ - break; - -/**** - *BYTE_TO_INT - */ - case function_byte_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_int*/ - break; - -/**** - *USINT_TO_REAL - */ - case function_usint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_real*/ - break; - -/**** - *USINT_TO_SINT - */ - case function_usint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_sint*/ - break; - -/**** - *USINT_TO_LINT - */ - case function_usint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_lint*/ - break; - -/**** - *USINT_TO_DINT - */ - case function_usint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_dint*/ - break; - -/**** - *USINT_TO_DATE - */ - case function_usint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_date*/ - break; - -/**** - *USINT_TO_DWORD - */ - case function_usint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_dword*/ - break; - -/**** - *USINT_TO_DT - */ - case function_usint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_dt*/ - break; - -/**** - *USINT_TO_TOD - */ - case function_usint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_tod*/ - break; - -/**** - *USINT_TO_UDINT - */ - case function_usint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_udint*/ - break; - -/**** - *USINT_TO_WORD - */ - case function_usint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_word*/ - break; - -/**** - *USINT_TO_STRING - */ - case function_usint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_string*/ - break; - -/**** - *USINT_TO_LWORD - */ - case function_usint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_lword*/ - break; - -/**** - *USINT_TO_UINT - */ - case function_usint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_uint*/ - break; - -/**** - *USINT_TO_LREAL - */ - case function_usint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_lreal*/ - break; - -/**** - *USINT_TO_BYTE - */ - case function_usint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_byte*/ - break; - -/**** - *USINT_TO_ULINT - */ - case function_usint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_ulint*/ - break; - -/**** - *USINT_TO_BOOL - */ - case function_usint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_bool*/ - break; - -/**** - *USINT_TO_TIME - */ - case function_usint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_time*/ - break; - -/**** - *USINT_TO_INT - */ - case function_usint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_int*/ - break; - -/**** - *ULINT_TO_REAL - */ - case function_ulint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_real*/ - break; - -/**** - *ULINT_TO_SINT - */ - case function_ulint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_sint*/ - break; - -/**** - *ULINT_TO_LINT - */ - case function_ulint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_lint*/ - break; - -/**** - *ULINT_TO_DINT - */ - case function_ulint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_dint*/ - break; - -/**** - *ULINT_TO_DATE - */ - case function_ulint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_date*/ - break; - -/**** - *ULINT_TO_DWORD - */ - case function_ulint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_dword*/ - break; - -/**** - *ULINT_TO_DT - */ - case function_ulint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_dt*/ - break; - -/**** - *ULINT_TO_TOD - */ - case function_ulint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_tod*/ - break; - -/**** - *ULINT_TO_UDINT - */ - case function_ulint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_udint*/ - break; - -/**** - *ULINT_TO_WORD - */ - case function_ulint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_word*/ - break; - -/**** - *ULINT_TO_STRING - */ - case function_ulint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_string*/ - break; - -/**** - *ULINT_TO_LWORD - */ - case function_ulint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_lword*/ - break; - -/**** - *ULINT_TO_UINT - */ - case function_ulint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_uint*/ - break; - -/**** - *ULINT_TO_LREAL - */ - case function_ulint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_lreal*/ - break; - -/**** - *ULINT_TO_BYTE - */ - case function_ulint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_byte*/ - break; - -/**** - *ULINT_TO_USINT - */ - case function_ulint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_usint*/ - break; - -/**** - *ULINT_TO_BOOL - */ - case function_ulint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_bool*/ - break; - -/**** - *ULINT_TO_TIME - */ - case function_ulint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_time*/ - break; - -/**** - *ULINT_TO_INT - */ - case function_ulint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_int*/ - break; - -/**** - *BOOL_TO_REAL - */ - case function_bool_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_real*/ - break; - -/**** - *BOOL_TO_SINT - */ - case function_bool_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_sint*/ - break; - -/**** - *BOOL_TO_LINT - */ - case function_bool_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_lint*/ - break; - -/**** - *BOOL_TO_DINT - */ - case function_bool_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_dint*/ - break; - -/**** - *BOOL_TO_DATE - */ - case function_bool_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_date*/ - break; - -/**** - *BOOL_TO_DWORD - */ - case function_bool_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_dword*/ - break; - -/**** - *BOOL_TO_DT - */ - case function_bool_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_dt*/ - break; - -/**** - *BOOL_TO_TOD - */ - case function_bool_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_tod*/ - break; - -/**** - *BOOL_TO_UDINT - */ - case function_bool_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_udint*/ - break; - -/**** - *BOOL_TO_WORD - */ - case function_bool_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_word*/ - break; - -/**** - *BOOL_TO_STRING - */ - case function_bool_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bool_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_string*/ - break; - -/**** - *BOOL_TO_LWORD - */ - case function_bool_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_lword*/ - break; - -/**** - *BOOL_TO_UINT - */ - case function_bool_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_uint*/ - break; - -/**** - *BOOL_TO_LREAL - */ - case function_bool_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_lreal*/ - break; - -/**** - *BOOL_TO_BYTE - */ - case function_bool_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_byte*/ - break; - -/**** - *BOOL_TO_USINT - */ - case function_bool_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_usint*/ - break; - -/**** - *BOOL_TO_ULINT - */ - case function_bool_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_ulint*/ - break; - -/**** - *BOOL_TO_TIME - */ - case function_bool_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_time*/ - break; - -/**** - *BOOL_TO_INT - */ - case function_bool_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_int*/ - break; - -/**** - *TIME_TO_REAL - */ - case function_time_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_real*/ - break; - -/**** - *TIME_TO_SINT - */ - case function_time_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_sint*/ - break; - -/**** - *TIME_TO_LINT - */ - case function_time_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_lint*/ - break; - -/**** - *TIME_TO_DINT - */ - case function_time_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_dint*/ - break; - -/**** - *TIME_TO_DWORD - */ - case function_time_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_dword*/ - break; - -/**** - *TIME_TO_UDINT - */ - case function_time_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_udint*/ - break; - -/**** - *TIME_TO_WORD - */ - case function_time_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_word*/ - break; - -/**** - *TIME_TO_STRING - */ - case function_time_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_string*/ - break; - -/**** - *TIME_TO_LWORD - */ - case function_time_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_lword*/ - break; - -/**** - *TIME_TO_UINT - */ - case function_time_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_uint*/ - break; - -/**** - *TIME_TO_LREAL - */ - case function_time_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_lreal*/ - break; - -/**** - *TIME_TO_BYTE - */ - case function_time_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_byte*/ - break; - -/**** - *TIME_TO_USINT - */ - case function_time_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_usint*/ - break; - -/**** - *TIME_TO_ULINT - */ - case function_time_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_ulint*/ - break; - -/**** - *TIME_TO_INT - */ - case function_time_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_int*/ - break; - -/**** - *INT_TO_REAL - */ - case function_int_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_real*/ - break; - -/**** - *INT_TO_SINT - */ - case function_int_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_sint*/ - break; - -/**** - *INT_TO_LINT - */ - case function_int_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_lint*/ - break; - -/**** - *INT_TO_DINT - */ - case function_int_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_dint*/ - break; - -/**** - *INT_TO_DATE - */ - case function_int_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_date*/ - break; - -/**** - *INT_TO_DWORD - */ - case function_int_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_dword*/ - break; - -/**** - *INT_TO_DT - */ - case function_int_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_dt*/ - break; - -/**** - *INT_TO_TOD - */ - case function_int_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_tod*/ - break; - -/**** - *INT_TO_UDINT - */ - case function_int_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_udint*/ - break; - -/**** - *INT_TO_WORD - */ - case function_int_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_word*/ - break; - -/**** - *INT_TO_STRING - */ - case function_int_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_string*/ - break; - -/**** - *INT_TO_LWORD - */ - case function_int_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_lword*/ - break; - -/**** - *INT_TO_UINT - */ - case function_int_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_uint*/ - break; - -/**** - *INT_TO_LREAL - */ - case function_int_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_lreal*/ - break; - -/**** - *INT_TO_BYTE - */ - case function_int_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_byte*/ - break; - -/**** - *INT_TO_USINT - */ - case function_int_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_usint*/ - break; - -/**** - *INT_TO_ULINT - */ - case function_int_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_ulint*/ - break; - -/**** - *INT_TO_BOOL - */ - case function_int_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_bool*/ - break; - -/**** - *INT_TO_TIME - */ - case function_int_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_time*/ - break; - -/**** - *TRUNC - */ - case function_trunc : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = (symbol_c*)(new pragma_c("int")); - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_trunc*/ - break; - -/**** - *BCD_TO_UDINT - */ - case function_bcd_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_udint*/ - break; - -/**** - *BCD_TO_UINT - */ - case function_bcd_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_uint*/ - break; - -/**** - *BCD_TO_ULINT - */ - case function_bcd_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_ulint*/ - break; - -/**** - *BCD_TO_USINT - */ - case function_bcd_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_usint*/ - break; - -/**** - *UDINT_TO_BCD - */ - case function_udint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_bcd*/ - break; - -/**** - *UINT_TO_BCD - */ - case function_uint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_bcd*/ - break; - -/**** - *USINT_TO_BCD - */ - case function_usint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_bcd*/ - break; - -/**** - *ULINT_TO_BCD - */ - case function_ulint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_bcd*/ - break; - -/**** - *DATE_AND_TIME_TO_TIME_OF_DAY - */ - case function_date_and_time_to_time_of_day : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__date_and_time_to_time_of_day")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - }/*function_date_and_time_to_time_of_day*/ - break; - -/**** - *DATE_AND_TIME_TO_DATE - */ - case function_date_and_time_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__date_and_time_to_date")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - break; - - } - - - ERROR; - } - - }/*function_date_and_time_to_date*/ - break; - -/**** - *ABS - */ - case function_abs : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__abs_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - }/*function_abs*/ - break; - -/**** - *SQRT - */ - case function_sqrt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sqrt_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_sqrt*/ - break; - -/**** - *LN - */ - case function_ln : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__ln_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_ln*/ - break; - -/**** - *LOG - */ - case function_log : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__log_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_log*/ - break; - -/**** - *EXP - */ - case function_exp : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__exp_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_exp*/ - break; - -/**** - *SIN - */ - case function_sin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sin_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_sin*/ - break; - -/**** - *COS - */ - case function_cos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__cos_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_cos*/ - break; - -/**** - *TAN - */ - case function_tan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__tan_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_tan*/ - break; - -/**** - *ASIN - */ - case function_asin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__asin_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_asin*/ - break; - -/**** - *ACOS - */ - case function_acos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__acos_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_acos*/ - break; - -/**** - *ATAN - */ - case function_atan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__atan_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_atan*/ - break; - -/**** - *ADD - */ - case function_add : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__add_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add*/ - break; - -/**** - *MUL - */ - case function_mul : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__mul_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_mul")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mul*/ - break; - -/**** - *SUB - */ - case function_sub : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sub_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub*/ - break; - -/**** - *DIV - */ - case function_div : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__div_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_div")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_div*/ - break; - -/**** - *MOD - */ - case function_mod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__mod_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mod*/ - break; - -/**** - *EXPT - */ - case function_expt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__expt_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN1_type_symbol; - function_type_suffix = IN1_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_expt*/ - break; - -/**** - *MOVE - */ - case function_move : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_move*/ - break; - -/**** - *ADD_TIME - */ - case function_add_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_time*/ - break; - -/**** - *ADD_TOD_TIME - */ - case function_add_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_tod_time*/ - break; - -/**** - *ADD_DT_TIME - */ - case function_add_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_dt_time*/ - break; - -/**** - *MULTIME - */ - case function_multime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_mul")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_multime*/ - break; - -/**** - *SUB_TIME - */ - case function_sub_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_time*/ - break; - -/**** - *SUB_DATE_DATE - */ - case function_sub_date_date : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_date_date*/ - break; - -/**** - *SUB_TOD_TIME - */ - case function_sub_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_time*/ - break; - -/**** - *SUB_TOD_TOD - */ - case function_sub_tod_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_tod*/ - break; - -/**** - *SUB_DT_TIME - */ - case function_sub_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_dt_time*/ - break; - -/**** - *DIVTIME - */ - case function_divtime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_div")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_divtime*/ - break; - -/**** - *SHL - */ - case function_shl : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__shl_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shl*/ - break; - -/**** - *SHR - */ - case function_shr : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__shr_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shr*/ - break; - -/**** - *ROR - */ - case function_ror : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__ror_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ror*/ - break; - -/**** - *ROL - */ - case function_rol : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__rol_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_rol*/ - break; - -/**** - *AND - */ - case function_and : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__and_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_and*/ - break; - -/**** - *OR - */ - case function_or : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__or_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_or*/ - break; - -/**** - *XOR - */ - case function_xor : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__xor_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_xor*/ - break; - -/**** - *NOT - */ - case function_not : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__not_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = return_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lword_type_name; - break; - - } - - - ERROR; - } - - }/*function_not*/ - break; - -/**** - *SEL - */ - case function_sel : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *G_param_name = (symbol_c *)(new identifier_c("G")); - /* Get the value from a foo( = ) style call */ - symbol_c *G_param_value = &this->default_variable_name; - - symbol_c *G_type_symbol = param_data_type; - last_type_symbol = G_type_symbol; - - if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__sel_")); - - if (G_type_symbol == NULL) - G_type_symbol = last_type_symbol; - ADD_PARAM_LIST(G_param_name, G_param_value, G_type_symbol, function_param_iterator_c::direction_in) - - if (IN0_type_symbol == NULL) - IN0_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN0_param_name, IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = IN0_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sel*/ - break; - -/**** - *MAX - */ - case function_max : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__max_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_max*/ - break; - -/**** - *MIN - */ - case function_min : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__min_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_min*/ - break; - -/**** - *LIMIT - */ - case function_limit : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *MN_param_name = (symbol_c *)(new identifier_c("MN")); - /* Get the value from a foo( = ) style call */ - symbol_c *MN_param_value = &this->default_variable_name; - - symbol_c *MN_type_symbol = param_data_type; - last_type_symbol = MN_type_symbol; - - - { - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - - { - - { - symbol_c *MX_param_name = (symbol_c *)(new identifier_c("MX")); - /* Get the value from a foo( = ) style call */ - symbol_c *MX_param_value = function_call_param_iterator.search_f(MX_param_name); - symbol_c *MX_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (MX_param_value == NULL) - MX_param_value = function_call_param_iterator.next_nf(); - if (MX_param_value != NULL) { - MX_type_symbol = search_expression_type->get_type(MX_param_value); - last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__limit_")); - - if (MN_type_symbol == NULL) - MN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(MN_param_name, MN_param_value, MN_type_symbol, function_param_iterator_c::direction_in) - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (MX_type_symbol == NULL) - MX_type_symbol = last_type_symbol; - ADD_PARAM_LIST(MX_param_name, MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_limit*/ - break; - -/**** - *MUX - */ - case function_mux : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *K_param_name = (symbol_c *)(new identifier_c("K")); - /* Get the value from a foo( = ) style call */ - symbol_c *K_param_value = &this->default_variable_name; - - symbol_c *K_type_symbol = param_data_type; - last_type_symbol = K_type_symbol; - - if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__mux_")); - - if (nb_param < 3) - nb_param = 3; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (K_type_symbol == NULL) - K_type_symbol = last_type_symbol; - ADD_PARAM_LIST(K_param_name, K_param_value, K_type_symbol, function_param_iterator_c::direction_in) - - if (IN0_type_symbol == NULL) - IN0_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN0_param_name, IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 2; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mux*/ - break; - -/**** - *GT - */ - case function_gt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__gt_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_gt*/ - break; - -/**** - *GE - */ - case function_ge : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__ge_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ge*/ - break; - -/**** - *EQ - */ - case function_eq : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__eq_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_eq*/ - break; - -/**** - *LT - */ - case function_lt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__lt_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_lt*/ - break; - -/**** - *LE - */ - case function_le : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__le_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_le*/ - break; - -/**** - *NE - */ - case function_ne : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__ne_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ne*/ - break; - -/**** - *LEN - */ - case function_len : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__len")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - break; - - } - - - ERROR; - } - - }/*function_len*/ - break; - -/**** - *LEFT - */ - case function_left : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__left")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_left*/ - break; - -/**** - *RIGHT - */ - case function_right : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__right")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_right*/ - break; - -/**** - *MID - */ - case function_mid : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__mid")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mid*/ - break; - -/**** - *CONCAT - */ - case function_concat : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__concat")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat*/ - break; - -/**** - *CONCAT_DAT_TOD - */ - case function_concat_dat_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat_dat_tod*/ - break; - -/**** - *INSERT - */ - case function_insert : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__insert")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_insert*/ - break; - -/**** - *DELETE - */ - case function_delete : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = &this->default_variable_name; - - symbol_c *IN_type_symbol = param_data_type; - last_type_symbol = IN_type_symbol; - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__delete")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_delete*/ - break; - -/**** - *REPLACE - */ - case function_replace : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__replace")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_replace*/ - break; - -/**** - *FIND - */ - case function_find : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = &this->default_variable_name; - - symbol_c *IN1_type_symbol = param_data_type; - last_type_symbol = IN1_type_symbol; - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__find")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_find*/ - break; - - case function_none : - ERROR; -} diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_c/st_code_gen.c --- a/stage4/generate_c/st_code_gen.c Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20632 +0,0 @@ -/* - * Copyright (C) 2007-2011: Edouard TISSERANT and Laurent BESSARD - * - * See COPYING and COPYING.LESSER files for copyright details. - * - * 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 . - * - */ - -/**** - * IEC 61131-3 standard function library - * generated code, do not edit by hand - */ - - -switch(current_function_type){ - -/**** - *REAL_TO_SINT - */ - case function_real_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_sint*/ - break; - -/**** - *REAL_TO_LINT - */ - case function_real_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_lint*/ - break; - -/**** - *REAL_TO_DINT - */ - case function_real_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_dint*/ - break; - -/**** - *REAL_TO_DATE - */ - case function_real_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_date*/ - break; - -/**** - *REAL_TO_DWORD - */ - case function_real_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_dword*/ - break; - -/**** - *REAL_TO_DT - */ - case function_real_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_dt*/ - break; - -/**** - *REAL_TO_TOD - */ - case function_real_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_tod*/ - break; - -/**** - *REAL_TO_UDINT - */ - case function_real_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_udint*/ - break; - -/**** - *REAL_TO_WORD - */ - case function_real_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_word*/ - break; - -/**** - *REAL_TO_STRING - */ - case function_real_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_string*/ - break; - -/**** - *REAL_TO_LWORD - */ - case function_real_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_lword*/ - break; - -/**** - *REAL_TO_UINT - */ - case function_real_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_uint*/ - break; - -/**** - *REAL_TO_LREAL - */ - case function_real_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_lreal*/ - break; - -/**** - *REAL_TO_BYTE - */ - case function_real_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_byte*/ - break; - -/**** - *REAL_TO_USINT - */ - case function_real_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_usint*/ - break; - -/**** - *REAL_TO_ULINT - */ - case function_real_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_ulint*/ - break; - -/**** - *REAL_TO_BOOL - */ - case function_real_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_bool*/ - break; - -/**** - *REAL_TO_TIME - */ - case function_real_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_time*/ - break; - -/**** - *REAL_TO_INT - */ - case function_real_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::real_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_real_to_int*/ - break; - -/**** - *SINT_TO_REAL - */ - case function_sint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_real*/ - break; - -/**** - *SINT_TO_LINT - */ - case function_sint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_lint*/ - break; - -/**** - *SINT_TO_DINT - */ - case function_sint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_dint*/ - break; - -/**** - *SINT_TO_DATE - */ - case function_sint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_date*/ - break; - -/**** - *SINT_TO_DWORD - */ - case function_sint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_dword*/ - break; - -/**** - *SINT_TO_DT - */ - case function_sint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_dt*/ - break; - -/**** - *SINT_TO_TOD - */ - case function_sint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_tod*/ - break; - -/**** - *SINT_TO_UDINT - */ - case function_sint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_udint*/ - break; - -/**** - *SINT_TO_WORD - */ - case function_sint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_word*/ - break; - -/**** - *SINT_TO_STRING - */ - case function_sint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_string*/ - break; - -/**** - *SINT_TO_LWORD - */ - case function_sint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_lword*/ - break; - -/**** - *SINT_TO_UINT - */ - case function_sint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_uint*/ - break; - -/**** - *SINT_TO_LREAL - */ - case function_sint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_lreal*/ - break; - -/**** - *SINT_TO_BYTE - */ - case function_sint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_byte*/ - break; - -/**** - *SINT_TO_USINT - */ - case function_sint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_usint*/ - break; - -/**** - *SINT_TO_ULINT - */ - case function_sint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_ulint*/ - break; - -/**** - *SINT_TO_BOOL - */ - case function_sint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_bool*/ - break; - -/**** - *SINT_TO_TIME - */ - case function_sint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_time*/ - break; - -/**** - *SINT_TO_INT - */ - case function_sint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::sint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_sint_to_int*/ - break; - -/**** - *LINT_TO_REAL - */ - case function_lint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_real*/ - break; - -/**** - *LINT_TO_SINT - */ - case function_lint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_sint*/ - break; - -/**** - *LINT_TO_DINT - */ - case function_lint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_dint*/ - break; - -/**** - *LINT_TO_DATE - */ - case function_lint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_date*/ - break; - -/**** - *LINT_TO_DWORD - */ - case function_lint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_dword*/ - break; - -/**** - *LINT_TO_DT - */ - case function_lint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_dt*/ - break; - -/**** - *LINT_TO_TOD - */ - case function_lint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_tod*/ - break; - -/**** - *LINT_TO_UDINT - */ - case function_lint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_udint*/ - break; - -/**** - *LINT_TO_WORD - */ - case function_lint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_word*/ - break; - -/**** - *LINT_TO_STRING - */ - case function_lint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_string*/ - break; - -/**** - *LINT_TO_LWORD - */ - case function_lint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_lword*/ - break; - -/**** - *LINT_TO_UINT - */ - case function_lint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_uint*/ - break; - -/**** - *LINT_TO_LREAL - */ - case function_lint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_lreal*/ - break; - -/**** - *LINT_TO_BYTE - */ - case function_lint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_byte*/ - break; - -/**** - *LINT_TO_USINT - */ - case function_lint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_usint*/ - break; - -/**** - *LINT_TO_ULINT - */ - case function_lint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_ulint*/ - break; - -/**** - *LINT_TO_BOOL - */ - case function_lint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_bool*/ - break; - -/**** - *LINT_TO_TIME - */ - case function_lint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_time*/ - break; - -/**** - *LINT_TO_INT - */ - case function_lint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lint_to_int*/ - break; - -/**** - *DINT_TO_REAL - */ - case function_dint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_real*/ - break; - -/**** - *DINT_TO_SINT - */ - case function_dint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_sint*/ - break; - -/**** - *DINT_TO_LINT - */ - case function_dint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_lint*/ - break; - -/**** - *DINT_TO_DATE - */ - case function_dint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_date*/ - break; - -/**** - *DINT_TO_DWORD - */ - case function_dint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_dword*/ - break; - -/**** - *DINT_TO_DT - */ - case function_dint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_dt*/ - break; - -/**** - *DINT_TO_TOD - */ - case function_dint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_tod*/ - break; - -/**** - *DINT_TO_UDINT - */ - case function_dint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_udint*/ - break; - -/**** - *DINT_TO_WORD - */ - case function_dint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_word*/ - break; - -/**** - *DINT_TO_STRING - */ - case function_dint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_string*/ - break; - -/**** - *DINT_TO_LWORD - */ - case function_dint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_lword*/ - break; - -/**** - *DINT_TO_UINT - */ - case function_dint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_uint*/ - break; - -/**** - *DINT_TO_LREAL - */ - case function_dint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_lreal*/ - break; - -/**** - *DINT_TO_BYTE - */ - case function_dint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_byte*/ - break; - -/**** - *DINT_TO_USINT - */ - case function_dint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_usint*/ - break; - -/**** - *DINT_TO_ULINT - */ - case function_dint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_ulint*/ - break; - -/**** - *DINT_TO_BOOL - */ - case function_dint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_bool*/ - break; - -/**** - *DINT_TO_TIME - */ - case function_dint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_time*/ - break; - -/**** - *DINT_TO_INT - */ - case function_dint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dint_to_int*/ - break; - -/**** - *DATE_TO_REAL - */ - case function_date_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_real*/ - break; - -/**** - *DATE_TO_SINT - */ - case function_date_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_sint*/ - break; - -/**** - *DATE_TO_LINT - */ - case function_date_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_lint*/ - break; - -/**** - *DATE_TO_DINT - */ - case function_date_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_dint*/ - break; - -/**** - *DATE_TO_DWORD - */ - case function_date_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_dword*/ - break; - -/**** - *DATE_TO_UDINT - */ - case function_date_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_udint*/ - break; - -/**** - *DATE_TO_WORD - */ - case function_date_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_word*/ - break; - -/**** - *DATE_TO_STRING - */ - case function_date_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__date_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_string*/ - break; - -/**** - *DATE_TO_LWORD - */ - case function_date_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_lword*/ - break; - -/**** - *DATE_TO_UINT - */ - case function_date_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_uint*/ - break; - -/**** - *DATE_TO_LREAL - */ - case function_date_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_lreal*/ - break; - -/**** - *DATE_TO_BYTE - */ - case function_date_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_byte*/ - break; - -/**** - *DATE_TO_USINT - */ - case function_date_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_usint*/ - break; - -/**** - *DATE_TO_ULINT - */ - case function_date_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_ulint*/ - break; - -/**** - *DATE_TO_INT - */ - case function_date_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::date_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_date_to_int*/ - break; - -/**** - *DWORD_TO_REAL - */ - case function_dword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_real*/ - break; - -/**** - *DWORD_TO_SINT - */ - case function_dword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_sint*/ - break; - -/**** - *DWORD_TO_LINT - */ - case function_dword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_lint*/ - break; - -/**** - *DWORD_TO_DINT - */ - case function_dword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_dint*/ - break; - -/**** - *DWORD_TO_DATE - */ - case function_dword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_date*/ - break; - -/**** - *DWORD_TO_DT - */ - case function_dword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_dt*/ - break; - -/**** - *DWORD_TO_TOD - */ - case function_dword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_tod*/ - break; - -/**** - *DWORD_TO_UDINT - */ - case function_dword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_udint*/ - break; - -/**** - *DWORD_TO_WORD - */ - case function_dword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_word*/ - break; - -/**** - *DWORD_TO_STRING - */ - case function_dword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_string*/ - break; - -/**** - *DWORD_TO_LWORD - */ - case function_dword_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_lword*/ - break; - -/**** - *DWORD_TO_UINT - */ - case function_dword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_uint*/ - break; - -/**** - *DWORD_TO_LREAL - */ - case function_dword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_lreal*/ - break; - -/**** - *DWORD_TO_BYTE - */ - case function_dword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_byte*/ - break; - -/**** - *DWORD_TO_USINT - */ - case function_dword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_usint*/ - break; - -/**** - *DWORD_TO_ULINT - */ - case function_dword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_ulint*/ - break; - -/**** - *DWORD_TO_BOOL - */ - case function_dword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_bool*/ - break; - -/**** - *DWORD_TO_TIME - */ - case function_dword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_time*/ - break; - -/**** - *DWORD_TO_INT - */ - case function_dword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dword_to_int*/ - break; - -/**** - *DT_TO_REAL - */ - case function_dt_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_real*/ - break; - -/**** - *DT_TO_SINT - */ - case function_dt_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_sint*/ - break; - -/**** - *DT_TO_LINT - */ - case function_dt_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_lint*/ - break; - -/**** - *DT_TO_DINT - */ - case function_dt_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_dint*/ - break; - -/**** - *DT_TO_DWORD - */ - case function_dt_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_dword*/ - break; - -/**** - *DT_TO_UDINT - */ - case function_dt_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_udint*/ - break; - -/**** - *DT_TO_WORD - */ - case function_dt_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_word*/ - break; - -/**** - *DT_TO_STRING - */ - case function_dt_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__dt_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_string*/ - break; - -/**** - *DT_TO_LWORD - */ - case function_dt_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_lword*/ - break; - -/**** - *DT_TO_UINT - */ - case function_dt_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_uint*/ - break; - -/**** - *DT_TO_LREAL - */ - case function_dt_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_lreal*/ - break; - -/**** - *DT_TO_BYTE - */ - case function_dt_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_byte*/ - break; - -/**** - *DT_TO_USINT - */ - case function_dt_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_usint*/ - break; - -/**** - *DT_TO_ULINT - */ - case function_dt_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_ulint*/ - break; - -/**** - *DT_TO_INT - */ - case function_dt_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_dt_to_int*/ - break; - -/**** - *TOD_TO_REAL - */ - case function_tod_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_real*/ - break; - -/**** - *TOD_TO_SINT - */ - case function_tod_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_sint*/ - break; - -/**** - *TOD_TO_LINT - */ - case function_tod_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_lint*/ - break; - -/**** - *TOD_TO_DINT - */ - case function_tod_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_dint*/ - break; - -/**** - *TOD_TO_DWORD - */ - case function_tod_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_dword*/ - break; - -/**** - *TOD_TO_UDINT - */ - case function_tod_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_udint*/ - break; - -/**** - *TOD_TO_WORD - */ - case function_tod_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_word*/ - break; - -/**** - *TOD_TO_STRING - */ - case function_tod_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__tod_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_string*/ - break; - -/**** - *TOD_TO_LWORD - */ - case function_tod_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_lword*/ - break; - -/**** - *TOD_TO_UINT - */ - case function_tod_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_uint*/ - break; - -/**** - *TOD_TO_LREAL - */ - case function_tod_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_lreal*/ - break; - -/**** - *TOD_TO_BYTE - */ - case function_tod_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_byte*/ - break; - -/**** - *TOD_TO_USINT - */ - case function_tod_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_usint*/ - break; - -/**** - *TOD_TO_ULINT - */ - case function_tod_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_ulint*/ - break; - -/**** - *TOD_TO_INT - */ - case function_tod_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::tod_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_tod_to_int*/ - break; - -/**** - *UDINT_TO_REAL - */ - case function_udint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_real*/ - break; - -/**** - *UDINT_TO_SINT - */ - case function_udint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_sint*/ - break; - -/**** - *UDINT_TO_LINT - */ - case function_udint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_lint*/ - break; - -/**** - *UDINT_TO_DINT - */ - case function_udint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_dint*/ - break; - -/**** - *UDINT_TO_DATE - */ - case function_udint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_date*/ - break; - -/**** - *UDINT_TO_DWORD - */ - case function_udint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_dword*/ - break; - -/**** - *UDINT_TO_DT - */ - case function_udint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_dt*/ - break; - -/**** - *UDINT_TO_TOD - */ - case function_udint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_tod*/ - break; - -/**** - *UDINT_TO_WORD - */ - case function_udint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_word*/ - break; - -/**** - *UDINT_TO_STRING - */ - case function_udint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_string*/ - break; - -/**** - *UDINT_TO_LWORD - */ - case function_udint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_lword*/ - break; - -/**** - *UDINT_TO_UINT - */ - case function_udint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_uint*/ - break; - -/**** - *UDINT_TO_LREAL - */ - case function_udint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_lreal*/ - break; - -/**** - *UDINT_TO_BYTE - */ - case function_udint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_byte*/ - break; - -/**** - *UDINT_TO_USINT - */ - case function_udint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_usint*/ - break; - -/**** - *UDINT_TO_ULINT - */ - case function_udint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_ulint*/ - break; - -/**** - *UDINT_TO_BOOL - */ - case function_udint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_bool*/ - break; - -/**** - *UDINT_TO_TIME - */ - case function_udint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_time*/ - break; - -/**** - *UDINT_TO_INT - */ - case function_udint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_int*/ - break; - -/**** - *WORD_TO_REAL - */ - case function_word_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_real*/ - break; - -/**** - *WORD_TO_SINT - */ - case function_word_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_sint*/ - break; - -/**** - *WORD_TO_LINT - */ - case function_word_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_lint*/ - break; - -/**** - *WORD_TO_DINT - */ - case function_word_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_dint*/ - break; - -/**** - *WORD_TO_DATE - */ - case function_word_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_date*/ - break; - -/**** - *WORD_TO_DWORD - */ - case function_word_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_dword*/ - break; - -/**** - *WORD_TO_DT - */ - case function_word_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_dt*/ - break; - -/**** - *WORD_TO_TOD - */ - case function_word_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_tod*/ - break; - -/**** - *WORD_TO_UDINT - */ - case function_word_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_udint*/ - break; - -/**** - *WORD_TO_STRING - */ - case function_word_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_string*/ - break; - -/**** - *WORD_TO_LWORD - */ - case function_word_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_lword*/ - break; - -/**** - *WORD_TO_UINT - */ - case function_word_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_uint*/ - break; - -/**** - *WORD_TO_LREAL - */ - case function_word_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_lreal*/ - break; - -/**** - *WORD_TO_BYTE - */ - case function_word_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_byte*/ - break; - -/**** - *WORD_TO_USINT - */ - case function_word_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_usint*/ - break; - -/**** - *WORD_TO_ULINT - */ - case function_word_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_ulint*/ - break; - -/**** - *WORD_TO_BOOL - */ - case function_word_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_bool*/ - break; - -/**** - *WORD_TO_TIME - */ - case function_word_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_time*/ - break; - -/**** - *WORD_TO_INT - */ - case function_word_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_word_to_int*/ - break; - -/**** - *STRING_TO_REAL - */ - case function_string_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_real*/ - break; - -/**** - *STRING_TO_SINT - */ - case function_string_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_sint*/ - break; - -/**** - *STRING_TO_LINT - */ - case function_string_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_lint*/ - break; - -/**** - *STRING_TO_DINT - */ - case function_string_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_dint*/ - break; - -/**** - *STRING_TO_DATE - */ - case function_string_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_date*/ - break; - -/**** - *STRING_TO_DWORD - */ - case function_string_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_dword*/ - break; - -/**** - *STRING_TO_DT - */ - case function_string_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_dt*/ - break; - -/**** - *STRING_TO_TOD - */ - case function_string_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_tod*/ - break; - -/**** - *STRING_TO_UDINT - */ - case function_string_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_udint*/ - break; - -/**** - *STRING_TO_WORD - */ - case function_string_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_word*/ - break; - -/**** - *STRING_TO_LWORD - */ - case function_string_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_lword*/ - break; - -/**** - *STRING_TO_UINT - */ - case function_string_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_uint*/ - break; - -/**** - *STRING_TO_LREAL - */ - case function_string_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_lreal*/ - break; - -/**** - *STRING_TO_BYTE - */ - case function_string_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_byte*/ - break; - -/**** - *STRING_TO_USINT - */ - case function_string_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_usint*/ - break; - -/**** - *STRING_TO_ULINT - */ - case function_string_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_ulint*/ - break; - -/**** - *STRING_TO_BOOL - */ - case function_string_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_bool")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_bool*/ - break; - -/**** - *STRING_TO_TIME - */ - case function_string_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_time*/ - break; - -/**** - *STRING_TO_INT - */ - case function_string_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__string_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_string_to_int*/ - break; - -/**** - *LWORD_TO_REAL - */ - case function_lword_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_real*/ - break; - -/**** - *LWORD_TO_SINT - */ - case function_lword_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_sint*/ - break; - -/**** - *LWORD_TO_LINT - */ - case function_lword_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_lint*/ - break; - -/**** - *LWORD_TO_DINT - */ - case function_lword_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_dint*/ - break; - -/**** - *LWORD_TO_DATE - */ - case function_lword_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_date*/ - break; - -/**** - *LWORD_TO_DWORD - */ - case function_lword_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_dword*/ - break; - -/**** - *LWORD_TO_DT - */ - case function_lword_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_dt*/ - break; - -/**** - *LWORD_TO_TOD - */ - case function_lword_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_tod*/ - break; - -/**** - *LWORD_TO_UDINT - */ - case function_lword_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_udint*/ - break; - -/**** - *LWORD_TO_WORD - */ - case function_lword_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_word*/ - break; - -/**** - *LWORD_TO_STRING - */ - case function_lword_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_string*/ - break; - -/**** - *LWORD_TO_UINT - */ - case function_lword_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_uint*/ - break; - -/**** - *LWORD_TO_LREAL - */ - case function_lword_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_lreal*/ - break; - -/**** - *LWORD_TO_BYTE - */ - case function_lword_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_byte*/ - break; - -/**** - *LWORD_TO_USINT - */ - case function_lword_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_usint*/ - break; - -/**** - *LWORD_TO_ULINT - */ - case function_lword_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_ulint*/ - break; - -/**** - *LWORD_TO_BOOL - */ - case function_lword_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_bool*/ - break; - -/**** - *LWORD_TO_TIME - */ - case function_lword_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_time*/ - break; - -/**** - *LWORD_TO_INT - */ - case function_lword_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lword_to_int*/ - break; - -/**** - *UINT_TO_REAL - */ - case function_uint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_real*/ - break; - -/**** - *UINT_TO_SINT - */ - case function_uint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_sint*/ - break; - -/**** - *UINT_TO_LINT - */ - case function_uint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_lint*/ - break; - -/**** - *UINT_TO_DINT - */ - case function_uint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_dint*/ - break; - -/**** - *UINT_TO_DATE - */ - case function_uint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_date*/ - break; - -/**** - *UINT_TO_DWORD - */ - case function_uint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_dword*/ - break; - -/**** - *UINT_TO_DT - */ - case function_uint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_dt*/ - break; - -/**** - *UINT_TO_TOD - */ - case function_uint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_tod*/ - break; - -/**** - *UINT_TO_UDINT - */ - case function_uint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_udint*/ - break; - -/**** - *UINT_TO_WORD - */ - case function_uint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_word*/ - break; - -/**** - *UINT_TO_STRING - */ - case function_uint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_string*/ - break; - -/**** - *UINT_TO_LWORD - */ - case function_uint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_lword*/ - break; - -/**** - *UINT_TO_LREAL - */ - case function_uint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_lreal*/ - break; - -/**** - *UINT_TO_BYTE - */ - case function_uint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_byte*/ - break; - -/**** - *UINT_TO_USINT - */ - case function_uint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_usint*/ - break; - -/**** - *UINT_TO_ULINT - */ - case function_uint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_ulint*/ - break; - -/**** - *UINT_TO_BOOL - */ - case function_uint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_bool*/ - break; - -/**** - *UINT_TO_TIME - */ - case function_uint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_time*/ - break; - -/**** - *UINT_TO_INT - */ - case function_uint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_int*/ - break; - -/**** - *LREAL_TO_REAL - */ - case function_lreal_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_real*/ - break; - -/**** - *LREAL_TO_SINT - */ - case function_lreal_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_sint*/ - break; - -/**** - *LREAL_TO_LINT - */ - case function_lreal_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_lint*/ - break; - -/**** - *LREAL_TO_DINT - */ - case function_lreal_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_dint*/ - break; - -/**** - *LREAL_TO_DATE - */ - case function_lreal_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_date*/ - break; - -/**** - *LREAL_TO_DWORD - */ - case function_lreal_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_dword*/ - break; - -/**** - *LREAL_TO_DT - */ - case function_lreal_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_dt*/ - break; - -/**** - *LREAL_TO_TOD - */ - case function_lreal_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_tod*/ - break; - -/**** - *LREAL_TO_UDINT - */ - case function_lreal_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_udint*/ - break; - -/**** - *LREAL_TO_WORD - */ - case function_lreal_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_word*/ - break; - -/**** - *LREAL_TO_STRING - */ - case function_lreal_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_string*/ - break; - -/**** - *LREAL_TO_LWORD - */ - case function_lreal_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_lword*/ - break; - -/**** - *LREAL_TO_UINT - */ - case function_lreal_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_uint*/ - break; - -/**** - *LREAL_TO_BYTE - */ - case function_lreal_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_byte*/ - break; - -/**** - *LREAL_TO_USINT - */ - case function_lreal_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_usint*/ - break; - -/**** - *LREAL_TO_ULINT - */ - case function_lreal_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_ulint*/ - break; - -/**** - *LREAL_TO_BOOL - */ - case function_lreal_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_bit")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_bool*/ - break; - -/**** - *LREAL_TO_TIME - */ - case function_lreal_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_time*/ - break; - -/**** - *LREAL_TO_INT - */ - case function_lreal_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::lreal_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__real_to_sint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_lreal_to_int*/ - break; - -/**** - *BYTE_TO_REAL - */ - case function_byte_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_real*/ - break; - -/**** - *BYTE_TO_SINT - */ - case function_byte_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_sint*/ - break; - -/**** - *BYTE_TO_LINT - */ - case function_byte_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_lint*/ - break; - -/**** - *BYTE_TO_DINT - */ - case function_byte_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_dint*/ - break; - -/**** - *BYTE_TO_DATE - */ - case function_byte_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_date*/ - break; - -/**** - *BYTE_TO_DWORD - */ - case function_byte_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_dword*/ - break; - -/**** - *BYTE_TO_DT - */ - case function_byte_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_dt*/ - break; - -/**** - *BYTE_TO_TOD - */ - case function_byte_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_tod*/ - break; - -/**** - *BYTE_TO_UDINT - */ - case function_byte_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_udint*/ - break; - -/**** - *BYTE_TO_WORD - */ - case function_byte_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_word*/ - break; - -/**** - *BYTE_TO_STRING - */ - case function_byte_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bit_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_string*/ - break; - -/**** - *BYTE_TO_LWORD - */ - case function_byte_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_lword*/ - break; - -/**** - *BYTE_TO_UINT - */ - case function_byte_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_uint*/ - break; - -/**** - *BYTE_TO_LREAL - */ - case function_byte_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_lreal*/ - break; - -/**** - *BYTE_TO_USINT - */ - case function_byte_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_usint*/ - break; - -/**** - *BYTE_TO_ULINT - */ - case function_byte_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_ulint*/ - break; - -/**** - *BYTE_TO_BOOL - */ - case function_byte_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_bool*/ - break; - -/**** - *BYTE_TO_TIME - */ - case function_byte_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_time*/ - break; - -/**** - *BYTE_TO_INT - */ - case function_byte_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_byte_to_int*/ - break; - -/**** - *USINT_TO_REAL - */ - case function_usint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_real*/ - break; - -/**** - *USINT_TO_SINT - */ - case function_usint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_sint*/ - break; - -/**** - *USINT_TO_LINT - */ - case function_usint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_lint*/ - break; - -/**** - *USINT_TO_DINT - */ - case function_usint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_dint*/ - break; - -/**** - *USINT_TO_DATE - */ - case function_usint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_date*/ - break; - -/**** - *USINT_TO_DWORD - */ - case function_usint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_dword*/ - break; - -/**** - *USINT_TO_DT - */ - case function_usint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_dt*/ - break; - -/**** - *USINT_TO_TOD - */ - case function_usint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_tod*/ - break; - -/**** - *USINT_TO_UDINT - */ - case function_usint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_udint*/ - break; - -/**** - *USINT_TO_WORD - */ - case function_usint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_word*/ - break; - -/**** - *USINT_TO_STRING - */ - case function_usint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_string*/ - break; - -/**** - *USINT_TO_LWORD - */ - case function_usint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_lword*/ - break; - -/**** - *USINT_TO_UINT - */ - case function_usint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_uint*/ - break; - -/**** - *USINT_TO_LREAL - */ - case function_usint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_lreal*/ - break; - -/**** - *USINT_TO_BYTE - */ - case function_usint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_byte*/ - break; - -/**** - *USINT_TO_ULINT - */ - case function_usint_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_ulint*/ - break; - -/**** - *USINT_TO_BOOL - */ - case function_usint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_bool*/ - break; - -/**** - *USINT_TO_TIME - */ - case function_usint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_time*/ - break; - -/**** - *USINT_TO_INT - */ - case function_usint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_int*/ - break; - -/**** - *ULINT_TO_REAL - */ - case function_ulint_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_real*/ - break; - -/**** - *ULINT_TO_SINT - */ - case function_ulint_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_sint*/ - break; - -/**** - *ULINT_TO_LINT - */ - case function_ulint_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_lint*/ - break; - -/**** - *ULINT_TO_DINT - */ - case function_ulint_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_dint*/ - break; - -/**** - *ULINT_TO_DATE - */ - case function_ulint_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_date*/ - break; - -/**** - *ULINT_TO_DWORD - */ - case function_ulint_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_dword*/ - break; - -/**** - *ULINT_TO_DT - */ - case function_ulint_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_dt*/ - break; - -/**** - *ULINT_TO_TOD - */ - case function_ulint_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_tod*/ - break; - -/**** - *ULINT_TO_UDINT - */ - case function_ulint_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_udint*/ - break; - -/**** - *ULINT_TO_WORD - */ - case function_ulint_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_word*/ - break; - -/**** - *ULINT_TO_STRING - */ - case function_ulint_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_string*/ - break; - -/**** - *ULINT_TO_LWORD - */ - case function_ulint_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_lword*/ - break; - -/**** - *ULINT_TO_UINT - */ - case function_ulint_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_uint*/ - break; - -/**** - *ULINT_TO_LREAL - */ - case function_ulint_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_lreal*/ - break; - -/**** - *ULINT_TO_BYTE - */ - case function_ulint_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_byte*/ - break; - -/**** - *ULINT_TO_USINT - */ - case function_ulint_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_usint*/ - break; - -/**** - *ULINT_TO_BOOL - */ - case function_ulint_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_bool*/ - break; - -/**** - *ULINT_TO_TIME - */ - case function_ulint_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_time*/ - break; - -/**** - *ULINT_TO_INT - */ - case function_ulint_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_int*/ - break; - -/**** - *BOOL_TO_REAL - */ - case function_bool_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_real*/ - break; - -/**** - *BOOL_TO_SINT - */ - case function_bool_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_sint*/ - break; - -/**** - *BOOL_TO_LINT - */ - case function_bool_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_lint*/ - break; - -/**** - *BOOL_TO_DINT - */ - case function_bool_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_dint*/ - break; - -/**** - *BOOL_TO_DATE - */ - case function_bool_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_date*/ - break; - -/**** - *BOOL_TO_DWORD - */ - case function_bool_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_dword*/ - break; - -/**** - *BOOL_TO_DT - */ - case function_bool_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_dt*/ - break; - -/**** - *BOOL_TO_TOD - */ - case function_bool_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_tod*/ - break; - -/**** - *BOOL_TO_UDINT - */ - case function_bool_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_udint*/ - break; - -/**** - *BOOL_TO_WORD - */ - case function_bool_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_word*/ - break; - -/**** - *BOOL_TO_STRING - */ - case function_bool_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bool_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_string*/ - break; - -/**** - *BOOL_TO_LWORD - */ - case function_bool_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_lword*/ - break; - -/**** - *BOOL_TO_UINT - */ - case function_bool_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_uint*/ - break; - -/**** - *BOOL_TO_LREAL - */ - case function_bool_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_lreal*/ - break; - -/**** - *BOOL_TO_BYTE - */ - case function_bool_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_byte*/ - break; - -/**** - *BOOL_TO_USINT - */ - case function_bool_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_usint*/ - break; - -/**** - *BOOL_TO_ULINT - */ - case function_bool_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_ulint*/ - break; - -/**** - *BOOL_TO_TIME - */ - case function_bool_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_time*/ - break; - -/**** - *BOOL_TO_INT - */ - case function_bool_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::bool_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bool_to_int*/ - break; - -/**** - *TIME_TO_REAL - */ - case function_time_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_real*/ - break; - -/**** - *TIME_TO_SINT - */ - case function_time_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_sint*/ - break; - -/**** - *TIME_TO_LINT - */ - case function_time_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_lint*/ - break; - -/**** - *TIME_TO_DINT - */ - case function_time_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_dint*/ - break; - -/**** - *TIME_TO_DWORD - */ - case function_time_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_dword*/ - break; - -/**** - *TIME_TO_UDINT - */ - case function_time_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_udint*/ - break; - -/**** - *TIME_TO_WORD - */ - case function_time_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_word*/ - break; - -/**** - *TIME_TO_STRING - */ - case function_time_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_string*/ - break; - -/**** - *TIME_TO_LWORD - */ - case function_time_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_lword*/ - break; - -/**** - *TIME_TO_UINT - */ - case function_time_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_uint*/ - break; - -/**** - *TIME_TO_LREAL - */ - case function_time_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_real")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_lreal*/ - break; - -/**** - *TIME_TO_BYTE - */ - case function_time_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_byte*/ - break; - -/**** - *TIME_TO_USINT - */ - case function_time_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_usint*/ - break; - -/**** - *TIME_TO_ULINT - */ - case function_time_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_ulint*/ - break; - -/**** - *TIME_TO_INT - */ - case function_time_to_int : - { - symbol_c *last_type_symbol = &search_constant_type_c::time_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_to_int")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_time_to_int*/ - break; - -/**** - *INT_TO_REAL - */ - case function_int_to_real : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::real_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_real*/ - break; - -/**** - *INT_TO_SINT - */ - case function_int_to_sint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_sint*/ - break; - -/**** - *INT_TO_LINT - */ - case function_int_to_lint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_lint*/ - break; - -/**** - *INT_TO_DINT - */ - case function_int_to_dint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_dint*/ - break; - -/**** - *INT_TO_DATE - */ - case function_int_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_date*/ - break; - -/**** - *INT_TO_DWORD - */ - case function_int_to_dword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_dword*/ - break; - -/**** - *INT_TO_DT - */ - case function_int_to_dt : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_dt*/ - break; - -/**** - *INT_TO_TOD - */ - case function_int_to_tod : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_tod*/ - break; - -/**** - *INT_TO_UDINT - */ - case function_int_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_udint*/ - break; - -/**** - *INT_TO_WORD - */ - case function_int_to_word : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::word_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_word*/ - break; - -/**** - *INT_TO_STRING - */ - case function_int_to_string : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sint_to_string")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_string*/ - break; - -/**** - *INT_TO_LWORD - */ - case function_int_to_lword : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_lword*/ - break; - -/**** - *INT_TO_UINT - */ - case function_int_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_uint*/ - break; - -/**** - *INT_TO_LREAL - */ - case function_int_to_lreal : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_lreal*/ - break; - -/**** - *INT_TO_BYTE - */ - case function_int_to_byte : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_byte*/ - break; - -/**** - *INT_TO_USINT - */ - case function_int_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_usint*/ - break; - -/**** - *INT_TO_ULINT - */ - case function_int_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_ulint*/ - break; - -/**** - *INT_TO_BOOL - */ - case function_int_to_bool : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_prefix = return_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_bool*/ - break; - -/**** - *INT_TO_TIME - */ - case function_int_to_time : - { - symbol_c *last_type_symbol = &search_constant_type_c::int_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__int_to_time")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_int_to_time*/ - break; - -/**** - *TRUNC - */ - case function_trunc : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = (symbol_c*)(new pragma_c("int")); - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_trunc*/ - break; - -/**** - *BCD_TO_UDINT - */ - case function_bcd_to_udint : - { - symbol_c *last_type_symbol = &search_constant_type_c::dword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_udint*/ - break; - -/**** - *BCD_TO_UINT - */ - case function_bcd_to_uint : - { - symbol_c *last_type_symbol = &search_constant_type_c::word_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_uint*/ - break; - -/**** - *BCD_TO_ULINT - */ - case function_bcd_to_ulint : - { - symbol_c *last_type_symbol = &search_constant_type_c::lword_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_ulint*/ - break; - -/**** - *BCD_TO_USINT - */ - case function_bcd_to_usint : - { - symbol_c *last_type_symbol = &search_constant_type_c::byte_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__bcd_to_uint")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_bcd_to_usint*/ - break; - -/**** - *UDINT_TO_BCD - */ - case function_udint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::udint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_udint_to_bcd*/ - break; - -/**** - *UINT_TO_BCD - */ - case function_uint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::uint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_uint_to_bcd*/ - break; - -/**** - *USINT_TO_BCD - */ - case function_usint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::usint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_usint_to_bcd*/ - break; - -/**** - *ULINT_TO_BCD - */ - case function_ulint_to_bcd : - { - symbol_c *last_type_symbol = &search_constant_type_c::ulint_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__uint_to_bcd")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::integer; - function_type_prefix = return_type_symbol; - break; - - } - - - ERROR; - } - - }/*function_ulint_to_bcd*/ - break; - -/**** - *DATE_AND_TIME_TO_TIME_OF_DAY - */ - case function_date_and_time_to_time_of_day : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__date_and_time_to_time_of_day")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - }/*function_date_and_time_to_time_of_day*/ - break; - -/**** - *DATE_AND_TIME_TO_DATE - */ - case function_date_and_time_to_date : - { - symbol_c *last_type_symbol = &search_constant_type_c::dt_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__date_and_time_to_date")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::date_type_name; - break; - - } - - - ERROR; - } - - }/*function_date_and_time_to_date*/ - break; - -/**** - *ABS - */ - case function_abs : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__abs_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - }/*function_abs*/ - break; - -/**** - *SQRT - */ - case function_sqrt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sqrt_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_sqrt*/ - break; - -/**** - *LN - */ - case function_ln : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__ln_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_ln*/ - break; - -/**** - *LOG - */ - case function_log : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__log_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_log*/ - break; - -/**** - *EXP - */ - case function_exp : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__exp_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_exp*/ - break; - -/**** - *SIN - */ - case function_sin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sin_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_sin*/ - break; - -/**** - *COS - */ - case function_cos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__cos_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_cos*/ - break; - -/**** - *TAN - */ - case function_tan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__tan_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_tan*/ - break; - -/**** - *ASIN - */ - case function_asin : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__asin_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_asin*/ - break; - -/**** - *ACOS - */ - case function_acos : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__acos_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_acos*/ - break; - -/**** - *ATAN - */ - case function_atan : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__atan_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_atan*/ - break; - -/**** - *ADD - */ - case function_add : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__add_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add*/ - break; - -/**** - *MUL - */ - case function_mul : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__mul_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_mul")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mul*/ - break; - -/**** - *SUB - */ - case function_sub : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__sub_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub*/ - break; - -/**** - *DIV - */ - case function_div : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__div_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_div")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_div*/ - break; - -/**** - *MOD - */ - case function_mod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__mod_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mod*/ - break; - -/**** - *EXPT - */ - case function_expt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__expt_")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN1_type_symbol; - function_type_suffix = IN1_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_expt*/ - break; - -/**** - *MOVE - */ - case function_move : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__move_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - }/*function_move*/ - break; - -/**** - *ADD_TIME - */ - case function_add_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_time*/ - break; - -/**** - *ADD_TOD_TIME - */ - case function_add_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_tod_time*/ - break; - -/**** - *ADD_DT_TIME - */ - case function_add_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_add_dt_time*/ - break; - -/**** - *MULTIME - */ - case function_multime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_mul")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_multime*/ - break; - -/**** - *SUB_TIME - */ - case function_sub_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_time*/ - break; - -/**** - *SUB_DATE_DATE - */ - case function_sub_date_date : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_date_date*/ - break; - -/**** - *SUB_TOD_TIME - */ - case function_sub_tod_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_time*/ - break; - -/**** - *SUB_TOD_TOD - */ - case function_sub_tod_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_tod_tod*/ - break; - -/**** - *SUB_DT_TIME - */ - case function_sub_dt_time : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - break; - - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_sub")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sub_dt_time*/ - break; - -/**** - *DIVTIME - */ - case function_divtime : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_div")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::time_type_name; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_divtime*/ - break; - -/**** - *SHL - */ - case function_shl : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__shl_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shl*/ - break; - -/**** - *SHR - */ - case function_shr : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__shr_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_shr*/ - break; - -/**** - *ROR - */ - case function_ror : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__ror_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ror*/ - break; - -/**** - *ROL - */ - case function_rol : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol)) - { - - { - symbol_c *N_param_name = (symbol_c *)(new identifier_c("N")); - /* Get the value from a foo( = ) style call */ - symbol_c *N_param_value = function_call_param_iterator.search_f(N_param_name); - symbol_c *N_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (N_param_value == NULL) - N_param_value = function_call_param_iterator.next_nf(); - if (N_param_value != NULL) { - N_type_symbol = search_expression_type->get_type(N_param_value); - last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ; - } - - if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__rol_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (N_type_symbol == NULL) - N_type_symbol = last_type_symbol; - ADD_PARAM_LIST(N_param_name, N_param_value, N_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_rol*/ - break; - -/**** - *AND - */ - case function_and : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__and_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_and*/ - break; - -/**** - *OR - */ - case function_or : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__or_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_or*/ - break; - -/**** - *XOR - */ - case function_xor : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__xor_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_xor*/ - break; - -/**** - *NOT - */ - case function_not : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__not_")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = return_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lword_type_name; - break; - - } - - - ERROR; - } - - }/*function_not*/ - break; - -/**** - *SEL - */ - case function_sel : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *G_param_name = (symbol_c *)(new identifier_c("G")); - /* Get the value from a foo( = ) style call */ - symbol_c *G_param_value = function_call_param_iterator.search_f(G_param_name); - symbol_c *G_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (G_param_value == NULL) - G_param_value = function_call_param_iterator.next_nf(); - if (G_param_value != NULL) { - G_type_symbol = search_expression_type->get_type(G_param_value); - last_type_symbol = last_type_symbol && G_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ; - } - - if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__sel_")); - - if (G_type_symbol == NULL) - G_type_symbol = last_type_symbol; - ADD_PARAM_LIST(G_param_name, G_param_value, G_type_symbol, function_param_iterator_c::direction_in) - - if (IN0_type_symbol == NULL) - IN0_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN0_param_name, IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = IN0_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_sel*/ - break; - -/**** - *MAX - */ - case function_max : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__max_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_max*/ - break; - -/**** - *MIN - */ - case function_min : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__min_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_min*/ - break; - -/**** - *LIMIT - */ - case function_limit : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *MN_param_name = (symbol_c *)(new identifier_c("MN")); - /* Get the value from a foo( = ) style call */ - symbol_c *MN_param_value = function_call_param_iterator.search_f(MN_param_name); - symbol_c *MN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (MN_param_value == NULL) - MN_param_value = function_call_param_iterator.next_nf(); - if (MN_param_value != NULL) { - MN_type_symbol = search_expression_type->get_type(MN_param_value); - last_type_symbol = last_type_symbol && MN_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ; - } - - - { - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - - { - - { - symbol_c *MX_param_name = (symbol_c *)(new identifier_c("MX")); - /* Get the value from a foo( = ) style call */ - symbol_c *MX_param_value = function_call_param_iterator.search_f(MX_param_name); - symbol_c *MX_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (MX_param_value == NULL) - MX_param_value = function_call_param_iterator.next_nf(); - if (MX_param_value != NULL) { - MX_type_symbol = search_expression_type->get_type(MX_param_value); - last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__limit_")); - - if (MN_type_symbol == NULL) - MN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(MN_param_name, MN_param_value, MN_type_symbol, function_param_iterator_c::direction_in) - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (MX_type_symbol == NULL) - MX_type_symbol = last_type_symbol; - ADD_PARAM_LIST(MX_param_name, MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = IN_type_symbol; - function_type_suffix = IN_type_symbol; - if (search_expression_type->is_literal_integer_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lint_type_name; - else if (search_expression_type->is_literal_real_type(function_type_suffix)) - function_type_suffix = &search_constant_type_c::lreal_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_limit*/ - break; - -/**** - *MUX - */ - case function_mux : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *K_param_name = (symbol_c *)(new identifier_c("K")); - /* Get the value from a foo( = ) style call */ - symbol_c *K_param_value = function_call_param_iterator.search_f(K_param_name); - symbol_c *K_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (K_param_value == NULL) - K_param_value = function_call_param_iterator.next_nf(); - if (K_param_value != NULL) { - K_type_symbol = search_expression_type->get_type(K_param_value); - last_type_symbol = last_type_symbol && K_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ; - } - - if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol)) - { - - { - symbol_c *IN0_param_name = (symbol_c *)(new identifier_c("IN0")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN0_param_value = function_call_param_iterator.search_f(IN0_param_name); - symbol_c *IN0_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN0_param_value == NULL) - IN0_param_value = function_call_param_iterator.next_nf(); - if (IN0_param_value != NULL) { - IN0_type_symbol = search_expression_type->get_type(IN0_param_value); - last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ; - } - - - { - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__mux_")); - - if (nb_param < 3) - nb_param = 3; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (K_type_symbol == NULL) - K_type_symbol = last_type_symbol; - ADD_PARAM_LIST(K_param_name, K_param_value, K_type_symbol, function_param_iterator_c::direction_in) - - if (IN0_type_symbol == NULL) - IN0_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN0_param_name, IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 2; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = last_type_symbol; - function_type_suffix = return_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mux*/ - break; - -/**** - *GT - */ - case function_gt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__gt_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_gt*/ - break; - -/**** - *GE - */ - case function_ge : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__ge_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ge*/ - break; - -/**** - *EQ - */ - case function_eq : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__eq_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_eq*/ - break; - -/**** - *LT - */ - case function_lt : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__lt_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_lt*/ - break; - -/**** - *LE - */ - case function_le : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__le_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_le*/ - break; - -/**** - *NE - */ - case function_ne : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - - { - - function_name = (symbol_c*)(new pragma_c("__ne_")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name; - function_type_suffix = last_type_symbol; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_ne*/ - break; - -/**** - *LEN - */ - case function_len : - { - symbol_c *last_type_symbol = &search_constant_type_c::string_type_name; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__len")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - break; - - } - - - ERROR; - } - - }/*function_len*/ - break; - -/**** - *LEFT - */ - case function_left : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__left")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_left*/ - break; - -/**** - *RIGHT - */ - case function_right : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__right")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_right*/ - break; - -/**** - *MID - */ - case function_mid : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__mid")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_mid*/ - break; - -/**** - *CONCAT - */ - case function_concat : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__concat")); - - if (nb_param < 2) - nb_param = 2; - char* nb_param_str = new char[10]; - sprintf(nb_param_str, "%d", nb_param); - symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param")); - ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - int base_num = 3; - symbol_c *param_value = NULL; - symbol_c *param_name = NULL; - do{ - char my_name[10]; - sprintf(my_name, "IN%d", base_num++); - param_name = (symbol_c*)(new identifier_c(my_name)); - - /* Get the value from a foo( = ) style call */ - param_value = function_call_param_iterator.search_f(param_name); - - /* Get the value from a foo() style call */ - if (param_value == NULL) - param_value = function_call_param_iterator.next_nf(); - if (param_value != NULL){ - symbol_c *current_type_symbol = search_expression_type->get_type(param_value); - last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; - - /*Function specific CODE */ - ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) - } - - }while(param_value != NULL); - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat*/ - break; - -/**** - *CONCAT_DAT_TOD - */ - case function_concat_dat_tod : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__time_add")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_concat_dat_tod*/ - break; - -/**** - *INSERT - */ - case function_insert : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__insert")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_insert*/ - break; - -/**** - *DELETE - */ - case function_delete : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name); - symbol_c *IN_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN_param_value == NULL) - IN_param_value = function_call_param_iterator.next_nf(); - if (IN_param_value != NULL) { - IN_type_symbol = search_expression_type->get_type(IN_param_value); - last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ; - } - - if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__delete")); - - if (IN_type_symbol == NULL) - IN_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN_param_name, IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_delete*/ - break; - -/**** - *REPLACE - */ - case function_replace : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *L_param_name = (symbol_c *)(new identifier_c("L")); - /* Get the value from a foo( = ) style call */ - symbol_c *L_param_value = function_call_param_iterator.search_f(L_param_name); - symbol_c *L_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (L_param_value == NULL) - L_param_value = function_call_param_iterator.next_nf(); - if (L_param_value != NULL) { - L_type_symbol = search_expression_type->get_type(L_param_value); - last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ; - } - - if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol)) - { - - { - symbol_c *P_param_name = (symbol_c *)(new identifier_c("P")); - /* Get the value from a foo( = ) style call */ - symbol_c *P_param_value = function_call_param_iterator.search_f(P_param_name); - symbol_c *P_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (P_param_value == NULL) - P_param_value = function_call_param_iterator.next_nf(); - if (P_param_value != NULL) { - P_type_symbol = search_expression_type->get_type(P_param_value); - last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ; - } - - if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__replace")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - - if (L_type_symbol == NULL) - L_type_symbol = last_type_symbol; - ADD_PARAM_LIST(L_param_name, L_param_value, L_type_symbol, function_param_iterator_c::direction_in) - - if (P_type_symbol == NULL) - P_type_symbol = last_type_symbol; - ADD_PARAM_LIST(P_param_name, P_param_value, P_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::string_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_replace*/ - break; - -/**** - *FIND - */ - case function_find : - { - symbol_c *last_type_symbol = NULL; - - { - symbol_c *IN1_param_name = (symbol_c *)(new identifier_c("IN1")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN1_param_value = function_call_param_iterator.search_f(IN1_param_name); - symbol_c *IN1_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN1_param_value == NULL) - IN1_param_value = function_call_param_iterator.next_nf(); - if (IN1_param_value != NULL) { - IN1_type_symbol = search_expression_type->get_type(IN1_param_value); - last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ; - } - - if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - { - symbol_c *IN2_param_name = (symbol_c *)(new identifier_c("IN2")); - /* Get the value from a foo( = ) style call */ - symbol_c *IN2_param_value = function_call_param_iterator.search_f(IN2_param_name); - symbol_c *IN2_type_symbol = NULL; - - /* Get the value from a foo() style call */ - if (IN2_param_value == NULL) - IN2_param_value = function_call_param_iterator.next_nf(); - if (IN2_param_value != NULL) { - IN2_type_symbol = search_expression_type->get_type(IN2_param_value); - last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ; - } - - if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol)) - { - - function_name = (symbol_c*)(new pragma_c("__find")); - - if (IN1_type_symbol == NULL) - IN1_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN1_param_name, IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in) - - if (IN2_type_symbol == NULL) - IN2_type_symbol = last_type_symbol; - ADD_PARAM_LIST(IN2_param_name, IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in) - symbol_c * return_type_symbol = &search_constant_type_c::int_type_name; - break; - - } - - - ERROR; - } - - } - - - ERROR; - } - - }/*function_find*/ - break; - - case function_none : - ERROR; -} diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_iec/Makefile --- a/stage4/generate_iec/Makefile Wed Sep 07 19:28:10 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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 . - -# include the system specific Makefile -include ../../Makefile.$(shell uname) - -default: all - -all: generate_iec.o - -clean: - echo > Makefile.depend - -rm -f *.o */*.o - -#get warnings, debugging information and optimization -#CXXFLAGS = -Wall -pedantic -Wpointer-arith -Wwrite-strings -# CXXFLAGS += -Werror -#CXXFLAGS += -ggdb -O3 -funroll-loops -# Note: if the optimizer crashes, we'll leave out the -O3 for those files - -CXXFLAGS += -I. -I../* -I../../absyntax - - - -#how to make things from other directories if they are missing -../% /%: - $(MAKE) -C $(@D) $(@F) - -Makefile.depend depend: - $(CXX) -MM -MG -I. *.cc \ - | sed 's/:/ Makefile.depend:/' > Makefile.depend - -include Makefile.depend diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_iec/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage4/generate_iec/Makefile.am Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,10 @@ +include ../../common.mk + +lib_LIBRARIES = libstage4_iec.a + +libstage4_iec_a_SOURCES = generate_iec.cc + +libstage4_iec_a_LIBADD = ../stage4.o + +libstage4_iec_a_cppflags = -I../../../absyntax + diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_iec/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stage4/generate_iec/Makefile.in Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,485 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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__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; + +$(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|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libdir)' && rm -f "$$files" )"; \ + cd "$(DESTDIR)$(libdir)" && rm -f $$files + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libstage4_iec.a: $(libstage4_iec_a_OBJECTS) $(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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +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: diff -r b826f13c260e -r 7a11f9e9e703 stage4/generate_iec/generate_iec.cc --- a/stage4/generate_iec/generate_iec.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/generate_iec/generate_iec.cc Thu Sep 08 20:25:00 2011 +0200 @@ -704,6 +704,32 @@ void *visit(var1_list_c *symbol) {return print_list(symbol, "", ", ");} +/* | [var1_list ','] variable_name '..' */ +/* NOTE: This is an extension to the standard!!! */ +/* In order to be able to handle extensible standard functions + * (i.e. standard functions that may have a variable number of + * input parameters, such as AND(word#33, word#44, word#55, word#66), + * we have extended the acceptable syntax to allow var_name '..' + * in an input variable declaration. + * + * This allows us to parse the declaration of standard + * extensible functions and load their interface definition + * into the abstract syntax tree just like we do to other + * user defined functions. + * This has the advantage that we can later do semantic + * checking of calls to functions (be it a standard or user defined + * function) in (almost) exactly the same way. + * + * Of course, we have a flag that disables this syntax when parsing user + * written code, so we only allow this extra syntax while parsing the + * 'header' file that declares all the standard IEC 61131-3 functions. + */ +void *visit(extensible_input_parameter_c *symbol) { + symbol->var_name->accept(*this); + s4o.print(" .. "); + return NULL; +} + /* var1_list ':' array_spec_init */ void *visit(array_var_init_decl_c *symbol) { @@ -930,14 +956,10 @@ return NULL; } -/* STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */ -/* integer ->may be NULL ! */ +/* single_byte_limited_len_string_spec [ASSIGN single_byte_character_string] */ /* single_byte_character_string ->may be NULL ! */ void *visit(single_byte_string_spec_c *symbol) { - s4o.print("STRING ["); - if (symbol->integer != NULL) - symbol->integer->accept(*this); - s4o.print("]"); + symbol->string_spec->accept(*this); if (symbol->single_byte_character_string != NULL) { s4o.print(" := "); symbol->single_byte_character_string->accept(*this); @@ -945,6 +967,18 @@ return NULL; } +/* STRING ['[' integer ']'] */ +/* integer ->may be NULL ! */ +void *visit(single_byte_limited_len_string_spec_c *symbol) { + symbol->string_type_name->accept(*this); + if (symbol->character_string_len != NULL) { + s4o.print(" ["); + symbol->character_string_len->accept(*this); + s4o.print("]"); + } + return NULL; +} + /* var1_list ':' double_byte_string_spec */ void *visit(double_byte_string_var_declaration_c *symbol) { symbol->var1_list->accept(*this); @@ -953,14 +987,11 @@ return NULL; } -/* WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */ +/* double_byte_limited_len_string_spec [ASSIGN double_byte_character_string] */ /* integer ->may be NULL ! */ /* double_byte_character_string ->may be NULL ! */ void *visit(double_byte_string_spec_c *symbol) { - s4o.print("WSTRING ["); - if (symbol->integer != NULL) - symbol->integer->accept(*this); - s4o.print("]"); + symbol->string_spec->accept(*this); if (symbol->double_byte_character_string != NULL) { s4o.print(" := "); symbol->double_byte_character_string->accept(*this); @@ -968,6 +999,18 @@ return NULL; } +/* WSTRING ['[' integer ']'] */ +/* integer ->may be NULL ! */ +void *visit(double_byte_limited_len_string_spec_c *symbol) { + symbol->string_type_name->accept(*this); + if (symbol->character_string_len != NULL) { + s4o.print(" ["); + symbol->character_string_len->accept(*this); + s4o.print("]"); + } + return NULL; +} + /*| VAR [RETAIN|NON_RETAIN] incompl_located_var_decl_list END_VAR */ /* option ->may be NULL ! */ void *visit(incompl_located_var_declarations_c *symbol) { diff -r b826f13c260e -r 7a11f9e9e703 stage4/stage4.cc --- a/stage4/stage4.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/stage4/stage4.cc Thu Sep 08 20:25:00 2011 +0200 @@ -1,6 +1,4 @@ /* - * 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 * diff -r b826f13c260e -r 7a11f9e9e703 util/dsymtable.cc --- a/util/dsymtable.cc Wed Sep 07 19:28:10 2011 +0200 +++ b/util/dsymtable.cc Thu Sep 08 20:25:00 2011 +0200 @@ -91,6 +91,28 @@ #endif + +/* 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 +int dsymtable_c::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 value_type dsymtable_c::find_value(const char *identifier_str) { @@ -104,11 +126,11 @@ template -value_type dsymtable_c::find_value(const symbol_c *symbol) { +const char * dsymtable_c::symbol_to_string(const symbol_c *symbol) { const token_c *name = dynamic_cast(symbol); if (name == NULL) ERROR; - return find_value(name->value); + return name->value; } diff -r b826f13c260e -r 7a11f9e9e703 util/dsymtable.hh --- a/util/dsymtable.hh Wed Sep 07 19:28:10 2011 +0200 +++ b/util/dsymtable.hh Thu Sep 08 20:25:00 2011 +0200 @@ -78,6 +78,7 @@ private: void reset(void); /* clear all entries... */ + const char *symbol_to_string(const symbol_c *symbol); public: dsymtable_c(void) {}; @@ -85,12 +86,35 @@ 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));} + /* Search for an entry. Will return end_value() if not found */ value_t end_value(void) {return null_value;} value_t find_value(const char *identifier_str); - value_t find_value(const symbol_c *symbol); + value_t find_value(const symbol_c *symbol) {return find_value(symbol_to_string(symbol));} - iterator find(const char *identifier_str) {return _base.find(identifier_str);} + /* Search for an entry associated with identifier_str. Will return end() if not found */ + 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);} + 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 symbol_c *symbol) {return upper_bound(symbol_to_string(symbol));} + + /* get the value to which an iterator is pointing to... */ + value_t get_value(const iterator i) {return i->second;} /* iterators pointing to beg/end of map... */ iterator begin() {return _base.begin();} diff -r b826f13c260e -r 7a11f9e9e703 util/strdup.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/util/strdup.hh Thu Sep 08 20:25:00 2011 +0200 @@ -0,0 +1,58 @@ +/* + * matiec - a compiler for the programming languages defined in IEC 61131-3 + * + * Copyright (C) 2011 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 . + * + * + * This code is made available on the understanding that it will not be + * used in safety-critical situations without a full and competent review. + */ + + +/*******************************************/ +/* String Duplication Utility Functions... */ +/*******************************************/ + + + +#ifndef STRDUP__H +#define STRDUP__H + +#include /* required for malloc() */ +#include /* required for strcat() & strlen() */ + +/* + * Join two strings together. Allocate space with malloc(3). + */ +static char *strdup2(const char *a, const char *b) { + char *res = (char *)malloc(strlen(a) + strlen(b) + 1); + + if (res == NULL) return NULL; + return strcat(strcpy(res, a), b); +} + +/* + * Join three strings together. Allocate space with malloc(3). + */ +static char *strdup3(const char *a, const char *b, const char *c) { + char *res = (char *)malloc(strlen(a) + strlen(b) + strlen(c) + 1); + + if (res == NULL) return NULL; + return strcat(strcat(strcpy(res, a), b), c); +} + + +#endif /* STRDUP__H */