From f841edf1c007f85965bb36a02ed38e9722923a7a Mon Sep 17 00:00:00 2001 From: Sven Sahle Date: Thu, 12 Dec 2024 12:14:03 +0100 Subject: [PATCH] Revert "Merge branch 'release/Version-4.45' of https://github.com/copasi/COPASI into release/Version-4.45" This reverts commit 667039ff3e84bd8aae663116a83d2f8d9b3cdc58, reversing changes made to cd582a7a154c1ef8a8a5557db45b54cba958b3ce. --- CMakeLists.txt | 1 - CMakeModules/FindCLAPACK.cmake | 37 +- InnoSetup/COPASI.sh | 169 +- cmake-set-dependencies.cmake | 4 +- copasi/CMakeLists.txt | 4 +- copasi/CopasiDataModel/CDataModel.cpp | 54 +- copasi/CopasiDataModel/CDataModel.h | 5 - copasi/CopasiSE/CopasiSE.cpp | 7 +- copasi/CopasiUI/CMakeLists.txt | 3 +- copasi/UI/CQArrayAnnotationsWidget.cpp | 204 +- copasi/UI/CQArrayAnnotationsWidget.h | 2 +- copasi/UI/CQCompartmentsWidget.cpp | 6 +- copasi/UI/CQCompartmentsWidget.h | 2 +- copasi/UI/CQEventsWidget.cpp | 6 +- copasi/UI/CQEventsWidget.h | 2 +- copasi/UI/CQExternalToolDialog.cpp | 244 - copasi/UI/CQExternalToolDialog.h | 41 - copasi/UI/CQExternalToolDialog.ui | 460 -- copasi/UI/CQExternalTools.cpp | 360 -- copasi/UI/CQExternalTools.h | 136 - copasi/UI/CQFittingWidget.cpp | 11 +- copasi/UI/CQFittingWidget.ui | 10 - copasi/UI/CQFunctionsWidget.cpp | 8 +- copasi/UI/CQFunctionsWidget.h | 2 +- copasi/UI/CQGlobalQuantitiesWidget.cpp | 6 +- copasi/UI/CQGlobalQuantitiesWidget.h | 2 +- copasi/UI/CQLayoutsWidget.cpp | 4 +- copasi/UI/CQLayoutsWidget.h | 2 +- copasi/UI/CQOptimizationWidget.cpp | 17 +- copasi/UI/CQOptimizationWidget.ui | 45 +- copasi/UI/CQParameterOverviewWidget.cpp | 3 +- copasi/UI/CQParameterSetsDM.cpp | 4 +- copasi/UI/CQParameterSetsWidget.cpp | 6 +- copasi/UI/CQParameterSetsWidget.h | 2 +- copasi/UI/CQPlotsWidget.cpp | 6 +- copasi/UI/CQPlotsWidget.h | 2 +- copasi/UI/CQPreferenceDialog.cpp | 156 - copasi/UI/CQPreferenceDialog.h | 8 - copasi/UI/CQPreferenceDialog.ui | 62 +- copasi/UI/CQReactionsWidget.cpp | 6 +- copasi/UI/CQReactionsWidget.h | 2 +- copasi/UI/CQReportsWidget.cpp | 6 +- copasi/UI/CQReportsWidget.h | 2 +- copasi/UI/CQSBMLFileDialog.cpp | 3 +- copasi/UI/CQSpeciesWidget.cpp | 6 +- copasi/UI/CQSpeciesWidget.h | 2 +- copasi/UI/CQUnitsWidget.cpp | 6 +- copasi/UI/CQUnitsWidget.h | 2 +- copasi/UI/FunctionWidget1.cpp | 33 - copasi/UI/TaskWidget.cpp | 6 +- copasi/UI/copasiui3window.cpp | 75 - copasi/UI/copasiui3window.h | 11 - copasi/bindings/common/downcast_common.cpp | 13 +- copasi/bindings/csharp/CMakeLists.txt | 8 +- copasi/bindings/csharp/local.cpp | 3 - copasi/bindings/swig/CCopasiTask.i | 2 - copasi/bindings/swig/CDataObject.i | 2 - copasi/bindings/swig/CDataVector.i | 2 - copasi/bindings/swig/CModel.i | 2 - copasi/bindings/swig/copasi.i | 4 - copasi/commandline/COptions.h | 14 +- .../CEvaluationNodeNormalizer.cpp | 1 - .../ConvertToCEvaluationNode.cpp | 13 - copasi/core/CFlags.h | 2 +- copasi/function/CEvaluationLexer.lpp | 88 +- copasi/function/CEvaluationLexer_lex.cpp | 4806 +++++++++-------- copasi/function/CEvaluationNode.cpp | 7 +- copasi/function/CEvaluationNode.h | 4 +- copasi/function/CEvaluationNodeCall.cpp | 4 +- copasi/function/CEvaluationNodeCall.h | 2 +- copasi/function/CEvaluationNodeChoice.cpp | 8 +- copasi/function/CEvaluationNodeChoice.h | 2 +- copasi/function/CEvaluationNodeConstant.cpp | 2 +- copasi/function/CEvaluationNodeConstant.h | 2 +- copasi/function/CEvaluationNodeDelay.cpp | 4 +- copasi/function/CEvaluationNodeDelay.h | 2 +- copasi/function/CEvaluationNodeFunction.cpp | 300 +- copasi/function/CEvaluationNodeFunction.h | 24 +- copasi/function/CEvaluationNodeLogical.cpp | 27 +- copasi/function/CEvaluationNodeLogical.h | 6 +- copasi/function/CEvaluationNodeNumber.cpp | 2 +- copasi/function/CEvaluationNodeNumber.h | 2 +- copasi/function/CEvaluationNodeObject.cpp | 26 +- copasi/function/CEvaluationNodeObject.h | 2 +- copasi/function/CEvaluationNodeOperator.cpp | 137 +- copasi/function/CEvaluationNodeOperator.h | 7 +- copasi/function/CEvaluationNodeStructure.cpp | 2 +- copasi/function/CEvaluationNodeStructure.h | 2 +- copasi/function/CEvaluationNodeUnit.cpp | 2 +- copasi/function/CEvaluationNodeUnit.h | 2 +- copasi/function/CEvaluationNodeVariable.cpp | 2 +- copasi/function/CEvaluationNodeVariable.h | 2 +- copasi/function/CEvaluationNodeVector.cpp | 2 +- copasi/function/CEvaluationNodeVector.h | 2 +- copasi/function/CEvaluationNodeWhiteSpace.cpp | 2 +- copasi/function/CEvaluationNodeWhiteSpace.h | 2 +- copasi/function/CEvaluationParser.ypp | 54 +- copasi/function/CEvaluationParser_yacc.cpp | 2954 +++++----- copasi/function/CEvaluationParser_yacc.hpp | 103 +- copasi/function/CEvaluationTree.cpp | 7 +- copasi/function/CEvaluationTree.h | 2 +- copasi/lapack/blaswrap.h | 6 +- copasi/lapack/lapackwrap.h | 16 +- copasi/math/CJitCompilerImplementation.cpp | 38 +- copasi/math/CJitCompilerImplementation.h | 10 - copasi/math/CMathContainer.cpp | 10 +- copasi/math/CMathContainer.h | 4 +- copasi/math/CMathEvent.cpp | 5 - copasi/model/CCompartment.cpp | 2 +- copasi/model/CModel.cpp | 27 +- copasi/model/CModel.h | 11 +- copasi/model/CModelParameterSet.cpp | 40 +- copasi/model/CModelParameterSet.h | 8 - copasi/model/CReaction.cpp | 45 +- copasi/model/CReaction.h | 1 - copasi/optimization/COptMethodNL2SOL.cpp | 1 + copasi/optimization/COptMethodPS.cpp | 10 +- .../COptMethodSteepestDescent.cpp | 6 +- .../optimization/COptMethodSteepestDescent.h | 7 + copasi/optimization/COptProblem.cpp | 3 - copasi/optimization/FminBrent.cpp | 152 + copasi/optimization/FminBrent.h | 119 + copasi/plotUI/CQCustomPlot.cpp | 3 +- copasi/plotUI/CQMarchingSquares.cpp | 5 +- copasi/resourcesUI/copasi.qrc | 2 - copasi/resourcesUI/preferences.ini | 159 - copasi/sbml/CSBMLExporter.cpp | 6 +- copasi/sbml/SBMLImporter.cpp | 273 +- copasi/sbml/SBMLImporter.h | 8 +- copasi/sedml/SEDMLImporter.cpp | 11 +- copasi/steadystate/CSteadyStateMethod.cpp | 4 +- copasi/utilities/dgemm.cpp | 42 +- copasi/utilities/messages.h | 3 +- copasi/xml/CCopasiXML.cpp | 5 +- copasi/xml/parser/ModelHandler.cpp | 3 +- tests/ModelLoading.cpp | 13 +- tests/test_CDataHandler.cpp | 5 +- tests/test_model_creation.cpp | 31 +- tests/test_sedml.cpp | 6 +- 139 files changed, 5238 insertions(+), 6795 deletions(-) delete mode 100644 copasi/UI/CQExternalToolDialog.cpp delete mode 100644 copasi/UI/CQExternalToolDialog.h delete mode 100644 copasi/UI/CQExternalToolDialog.ui delete mode 100644 copasi/UI/CQExternalTools.cpp delete mode 100644 copasi/UI/CQExternalTools.h create mode 100644 copasi/optimization/FminBrent.cpp create mode 100644 copasi/optimization/FminBrent.h delete mode 100644 copasi/resourcesUI/preferences.ini diff --git a/CMakeLists.txt b/CMakeLists.txt index ac6f3171df..e023689ee5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -938,7 +938,6 @@ message(STATUS "----------------------------------------------------------- Vendor = ${BLA_VENDOR} LAPACK Libs = ${CLAPACK_LIBRARIES} LAPACK LDFLAGS = ${CLAPACK_LINKER_FLAGS} - LAPACK include = ${CLAPACK_INCLUDE_DIR} crossguid Libs = ${CROSSGUID_LIBRARY} cross include = ${CROSSGUID_INCLUDE_DIR} diff --git a/CMakeModules/FindCLAPACK.cmake b/CMakeModules/FindCLAPACK.cmake index 8173de350b..2fae16f2ef 100644 --- a/CMakeModules/FindCLAPACK.cmake +++ b/CMakeModules/FindCLAPACK.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the # University of Virginia, University of Heidelberg, and University # of Connecticut School of Medicine. # All rights reserved. @@ -109,37 +109,24 @@ endif () if (NOT LAPACK_FOUND) # cmake MKL Detection does only support MKL version 10 and older if (DEFINED ENV{MKLROOT}) - message(STATUS "MKLROOT is: $ENV{MKLROOT}") - set(MKLROOT $ENV{MKLROOT} CACHE PATH "MKLROOT" FORCE) - endif() - if (DEFINED MKLROOT) set(BLA_VENDOR "Intel (MKL)") if (UNIX) - if ((COPASI_BUILD_TYPE EQUAL "32bit") AND EXISTS ${MKLROOT}/lib/ia32) - set(LAPACK_LIBRARIES "-Wl,--start-group ${MKLROOT}/lib/ia32/libmkl_intel.a ${MKLROOT}/lib/ia32/libmkl_core.a ${MKLROOT}/lib/ia32/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") - elseif (COPASI_BUILD_TYPE EQUAL "64bit" AND EXISTS ${MKLROOT}/lib/intel64) - set(LAPACK_LIBRARIES "-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") - elseif(EXISTS "${MKLROOT}/lib" AND EXISTS "${MKLROOT}/lib/libmkl_intel_lp64.a") - set(LAPACK_LIBRARIES "-Wl,--start-group ${MKLROOT}/lib/libmkl_intel_lp64.a ${MKLROOT}/lib/libmkl_core.a ${MKLROOT}/lib/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") - elseif(EXISTS ${MKLROOT}/lib AND EXISTS ${MKLROOT}/lib/libmkl_intel.a) - set(LAPACK_LIBRARIES "-Wl,--start-group ${MKLROOT}/lib/libmkl_intel.a ${MKLROOT}/lib/libmkl_core.a ${MKLROOT}/lib/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") + if (COPASI_BUILD_TYPE EQUAL "32bit") + set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/ia32/libmkl_intel.a $ENV{MKLROOT}/lib/ia32/libmkl_core.a $ENV{MKLROOT}/lib/ia32/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") + elseif (COPASI_BUILD_TYPE EQUAL "64bit") + set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a $ENV{MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") endif () else () - if (COPASI_BUILD_TYPE EQUAL "32bit" AND EXISTS "${MKLROOT}/lib/ia32/") - set(LAPACK_LIBRARIES "${MKLROOT}/lib/ia32/mkl_intel_c.lib" "${MKLROOT}/lib/ia32/mkl_core.lib" "${MKLROOT}/lib/ia32/mkl_sequential.lib") - elseif (COPASI_BUILD_TYPE EQUAL "64bit" AND EXISTS "${MKLROOT}/lib/intel64/" ) - set(LAPACK_LIBRARIES "${MKLROOT}/lib/intel64/mkl_intel_lp64.lib" "${MKLROOT}/lib/intel64/mkl_core.lib" "${MKLROOT}/lib/intel64/mkl_sequential.lib") - elseif (EXISTS "${MKLROOT}/lib/mkl_intel_lp64.lib") - set(LAPACK_LIBRARIES "${MKLROOT}/lib/mkl_intel_lp64.lib" "${MKLROOT}/lib/mkl_core.lib" "${MKLROOT}/lib/mkl_sequential.lib") + if (COPASI_BUILD_TYPE EQUAL "32bit") + set(LAPACK_LIBRARIES "$ENV{MKLROOT}/lib/ia32/mkl_intel_c.lib" "$ENV{MKLROOT}/lib/ia32/mkl_core.lib" "$ENV{MKLROOT}/lib/ia32/mkl_sequential.lib") + elseif (COPASI_BUILD_TYPE EQUAL "64bit") + set(LAPACK_LIBRARIES "$ENV{MKLROOT}/lib/intel64/mkl_intel_lp64.lib" "$ENV{MKLROOT}/lib/intel64/mkl_core.lib" "$ENV{MKLROOT}/lib/intel64/mkl_sequential.lib") endif () endif () - set(CLAPACK_INCLUDE_DIR ${MKLROOT}/include) add_definitions(-DHAVE_MKL) set(LAPACK_FOUND "Yes") - set(USE_MKL 1) - endif () endif () @@ -301,9 +288,9 @@ find_path(CLAPACK_INCLUDE_DIR clapack.h endif(NOT CLAPACK_INCLUDE_DIR) -if (CLAPACK_INCLUDE_DIR AND NOT DEFINED MKLROOT) +if (CLAPACK_INCLUDE_DIR) add_definitions(-DHAVE_CLAPACK_H) -endif (CLAPACK_INCLUDE_DIR AND NOT DEFINED MKLROOT) +endif (CLAPACK_INCLUDE_DIR) if (NOT CLAPACK_INCLUDE_DIR) find_path(CLAPACK_INCLUDE_DIR lapack.h @@ -326,7 +313,7 @@ if (NOT CLAPACK_INCLUDE_DIR) endif (NOT CLAPACK_INCLUDE_DIR) if (NOT CLAPACK_INCLUDE_DIR) - set(CLAPACK_INCLUDE_DIR "${COPASI_SOURCE_DIR}/copasi/lapack") + set(CLAPACK_INCLUDE_DIR "${COPASI_SOURCE_DIR}") endif (NOT CLAPACK_INCLUDE_DIR) diff --git a/InnoSetup/COPASI.sh b/InnoSetup/COPASI.sh index 741b9bfcbf..a5c6458b22 100644 --- a/InnoSetup/COPASI.sh +++ b/InnoSetup/COPASI.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the # University of Virginia, University of Heidelberg, and University # of Connecticut School of Medicine. # All rights reserved. @@ -14,15 +14,6 @@ # of Manchester. # All rights reserved. - - - - - - - - - # Echo all bash commands to ease debugging set -x @@ -41,98 +32,72 @@ EOF GUID=$(echo $GUID | sed 'y/abcdef/ABCDEF/') productcode=${GUID:0:8}-${GUID:8:4}-${GUID:12:4}-${GUID:16:4}-${GUID:20:12} -# if NO_COPY environment variable is set, skip the copy step -if [ -n "${NO_COPY}" ]; then - echo "Skipping copy step" - cd ${SOURCE}/InnoSetup - - workdir=${SOURCE}/InnoSetup - workdir=$(echo "$workdir" | sed 's/\//\\/g') - workdir=$(echo "$workdir" | sed 's/^\\c\\/C:\\/') - workdir=$(echo "$workdir" | sed 's/^\\d\\/D:\\/') - workdir=$(echo "$workdir" | sed 's/^\\e\\/E:\\/') - workdir=${workdir//\\/\\\\} - - stagedir=${SETUP_DIR}/package - stagedir=$(echo "$stagedir" | sed 's/\//\\/g') - stagedir=$(echo "$stagedir" | sed 's/^\\c\\/C:\\/') - stagedir=$(echo "$stagedir" | sed 's/^\\d\\/D:\\/') - stagedir=$(echo "$stagedir" | sed 's/^\\e\\/E:\\/') - - stagedir=${stagedir//\\/\\\\} - -else - - [ -e ${SETUP_DIR}/package ] && rm -rf ${SETUP_DIR}/package - mkdir ${SETUP_DIR}/package - pushd ${SETUP_DIR}/package - - # Create directory structure - tar -xvf ${BUILD_ROOT}/src/windows.tgz - - # Copy README - cp ${SOURCE}/README.Win32 README.txt - chmod 644 README.txt - - # Copy license - cp ${SOURCE}/copasi/ArtisticLicense.txt LICENSE.txt - chmod 644 LICENSE.txt - - # Copy configuration resources - mkdir -p share/copasi/config - cp ${SOURCE}/copasi/MIRIAM/MIRIAMResources.xml share/copasi/config - chmod 444 share/copasi/config/* - - # Copy examples - mkdir -p share/copasi/examples - cp ${SOURCE}/TestSuite/distribution/* share/copasi/examples - chmod 444 share/copasi/examples/* - chmod 777 share/copasi/examples - - # Copy icons - mkdir -p share/copasi/icons - cp ${SOURCE}/copasi/UI/icons/Copasi.ico share/copasi/icons - cp ${SOURCE}/copasi/UI/icons/CopasiDoc.ico share/copasi/icons - chmod 644 share/copasi/icons/* - - # Copy wizard resource - mkdir -p share/copasi/doc/html - cp ${SOURCE}/copasi/wizard/help_html/*.html share/copasi/doc/html - chmod 644 share/copasi/doc/html/*.html - - mkdir -p share/copasi/doc/html/figures - cp ${SOURCE}/copasi/wizard/help_html/figures/*.png \ - share/copasi/doc/html/figures - chmod 644 share/copasi/doc/html/figures/*.png - - # 32 bit files - cp "${BUILD_32_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/32 - chmod 755 bin/32/CopasiUI.exe - cp "${BUILD_32_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/32 - chmod 755 bin/32/CopasiSE.exe - cp ${SOURCE}/InnoSetup/qt.conf bin/32 - chmod 644 bin/32/qt.conf - - # 64 bit files - cp "${BUILD_64_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/64 - chmod 755 bin/64/CopasiUI.exe - cp "${BUILD_64_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/64 - chmod 755 bin/64/CopasiSE.exe - cp ${SOURCE}/InnoSetup/qt.conf bin/64 - chmod 644 bin/64/qt.conf - - # Execute InnoSetup to create Installation package - cd ${SOURCE}/InnoSetup - - workdir=$(cygpath -wa .) - workdir=${workdir//\\/\\\\} - - stagedir=$(cygpath -wa "${SETUP_DIR}/package") - stagedir=${stagedir//\\/\\\\} - -fi - - +[ -e ${SETUP_DIR}/package ] && rm -rf ${SETUP_DIR}/package +mkdir ${SETUP_DIR}/package +pushd ${SETUP_DIR}/package + +# Create directory structure +tar -xvf ${BUILD_ROOT}/src/windows.tgz + +# Copy README +cp ${SOURCE}/README.Win32 README.txt +chmod 644 README.txt + +# Copy license +cp ${SOURCE}/copasi/ArtisticLicense.txt LICENSE.txt +chmod 644 LICENSE.txt + +# Copy configuration resources +mkdir -p share/copasi/config +cp ${SOURCE}/copasi/MIRIAM/MIRIAMResources.xml share/copasi/config +chmod 444 share/copasi/config/* + +# Copy examples +mkdir -p share/copasi/examples +cp ${SOURCE}/TestSuite/distribution/* share/copasi/examples +chmod 444 share/copasi/examples/* +chmod 777 share/copasi/examples + +# Copy icons +mkdir -p share/copasi/icons +cp ${SOURCE}/copasi/UI/icons/Copasi.ico share/copasi/icons +cp ${SOURCE}/copasi/UI/icons/CopasiDoc.ico share/copasi/icons +chmod 644 share/copasi/icons/* + +# Copy wizard resource +mkdir -p share/copasi/doc/html +cp ${SOURCE}/copasi/wizard/help_html/*.html share/copasi/doc/html +chmod 644 share/copasi/doc/html/*.html + +mkdir -p share/copasi/doc/html/figures +cp ${SOURCE}/copasi/wizard/help_html/figures/*.png \ + share/copasi/doc/html/figures +chmod 644 share/copasi/doc/html/figures/*.png + +# 32 bit files +cp "${BUILD_32_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/32 +chmod 755 bin/32/CopasiUI.exe +cp "${BUILD_32_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/32 +chmod 755 bin/32/CopasiSE.exe +cp ${SOURCE}/InnoSetup/qt.conf bin/32 +chmod 644 bin/32/qt.conf + +# 64 bit files +cp "${BUILD_64_MD}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiUI/CopasiUI.exe" bin/64 +chmod 755 bin/64/CopasiUI.exe +cp "${BUILD_64_MT}/build/COPASI.${DIR_SUFFIX}/copasi/CopasiSE/CopasiSE.exe" bin/64 +chmod 755 bin/64/CopasiSE.exe +cp ${SOURCE}/InnoSetup/qt.conf bin/64 +chmod 644 bin/64/qt.conf + +# Execute InnoSetup to create Installation package +cd ${SOURCE}/InnoSetup + +workdir=$(cygpath -wa .) +workdir=${workdir//\\/\\\\} + +stagedir=$(cygpath -wa "${SETUP_DIR}/package") +stagedir=${stagedir//\\/\\\\} # modify product code, product version, and package name sed -e '/#define MyAppVersion/s/".*"/"'${MyAppVersion}'"/' \ diff --git a/cmake-set-dependencies.cmake b/cmake-set-dependencies.cmake index 4a34cdf7cf..d33ebc47e4 100644 --- a/cmake-set-dependencies.cmake +++ b/cmake-set-dependencies.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the # University of Virginia, University of Heidelberg, and University # of Connecticut School of Medicine. # All rights reserved. @@ -68,7 +68,7 @@ if (NOT EXISTS ${RAPTOR_LIBRARY}) set (RAPTOR_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/raptor.lib CACHE FILEPATH "raptor library" FORCE) endif() -if (NOT DEFINED MKLROOT AND (NOT BLA_VENDOR OR "${BLA_VENDOR}" STREQUAL "COPASI Dependencies")) +if (NOT BLA_VENDOR OR "${BLA_VENDOR}" STREQUAL "COPASI Dependencies") # clapack set (CLAPACK_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "clapack include directory" FORCE) diff --git a/copasi/CMakeLists.txt b/copasi/CMakeLists.txt index 24f749e0b3..780358c2f1 100644 --- a/copasi/CMakeLists.txt +++ b/copasi/CMakeLists.txt @@ -225,7 +225,7 @@ endif(EXTRA_MOC_OPTIONS) set(QWT_VERSION 0x0${QWT_VERSION_NUMERIC}) set(COPASI_UI_MOC_OPTIONS ${COPASI_UI_MOC_OPTIONS} -DQWT_VERSION=0x0${QWT_VERSION_NUMERIC}) - if (CLAPACK_FOUND AND NOT USE_MKL) + if (CLAPACK_FOUND) set(USE_CLAPACK 1) elseif (USE_MKL) set(USE_MKL 1) @@ -509,14 +509,12 @@ if(BUILD_GUI) DOC "Path to the uic executable" PATHS ${Qt6Widgets_DIR}/../../../bin/ ${Qt6Widgets_DIR}/../../../share/qt/libexec/ - ${Qt6Widgets_DIR}/../../../libexec/qt6/ ) if (NOT EXISTS "${Qt6Widgets_UIC_EXECUTABLE}") message(FATAL_ERROR "Need UIC executable to compile GUI, it should be in: ${Qt6Widgets_DIR}/../../../bin ${Qt6Widgets_DIR}/../../../share/qt/libexec - ${Qt6Widgets_DIR}/../../../libexec/qt6/ ") endif() endif() diff --git a/copasi/CopasiDataModel/CDataModel.cpp b/copasi/CopasiDataModel/CDataModel.cpp index f12882329e..ba5d3dfd8d 100644 --- a/copasi/CopasiDataModel/CDataModel.cpp +++ b/copasi/CopasiDataModel/CDataModel.cpp @@ -922,7 +922,7 @@ bool CDataModel::saveModel(const std::string & fileName, CProcessReport * pProce mData.pModel->compileIfNecessary(pProcessReport); // Assure that the parameter set reflects all changes made to the model. - mData.pModel->refreshActiveParameterSet(); + mData.pModel->getActiveModelParameterSet().refreshFromModel(false); } catch (...) @@ -1012,7 +1012,7 @@ std::string CDataModel::saveModelToString(CProcessReport * pProcessReport) mData.pModel->compileIfNecessary(pProcessReport); // Assure that the parameter set reflects all changes made to the model. - mData.pModel->refreshActiveParameterSet(); + mData.pModel->getActiveModelParameterSet().refreshFromModel(false); } catch (...) @@ -1203,6 +1203,7 @@ bool CDataModel::importSBML(const std::string & fileName, importer.setImportHandler(pProcessReport); importer.setImportInitialValueAnnotation(importInitialValues); + CModel * pModel = NULL; SBMLDocument * pSBMLDocument = NULL; @@ -2390,7 +2391,7 @@ bool CDataModel::importSEDML(const std::string & fileName, // Later this will be settable by the user in the preferences dialog // Later this will be settable by the user in the preferences dialog // importer.setImportCOPASIMIRIAM(true); - importer.setImportHandler(pProcessReport); + importer.setImportHandler(pProcessReport); CModel * pModel = NULL; @@ -3362,6 +3363,11 @@ void CDataModel::commonAfterLoad(CProcessReport * pProcessReport, if (mOldData.pCurrentSEDMLDocument == mData.pCurrentSEDMLDocument) mOldData.pCurrentSEDMLDocument = NULL; + if (mData.pModel && mData.pModel->compileIfNecessary(pProcessReport)) + { + mData.pModel->getActiveModelParameterSet().updateModel(); + } + // We need to initialize all the task so that results are available // We suppress all errors and warnings @@ -3413,7 +3419,7 @@ void CDataModel::commonAfterLoad(CProcessReport * pProcessReport, CCopasiMessage(CCopasiMessage::WARNING, validity.getIssueMessages().c_str()); } - mData.pModel->updateInitialValues(CCore::Framework::ParticleNumbers, false); + mData.pModel->updateInitialValues(CCore::Framework::ParticleNumbers); } changed(false); @@ -3460,12 +3466,12 @@ bool CDataModel::changeModelParameter(CDataObject * element, double value) bool isInitialConcentration = pRef->getObjectName() == "InitialConcentration" && pRef->getObjectDataModel() != NULL && pRef->getObjectDataModel()->getModel() != NULL; if (isInitialConcentration) - pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef, false); + pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef); *static_cast< double * >(pRef->getValuePointer()) = value; if (isInitialConcentration) - pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef, false); + pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef); return true; } @@ -3531,7 +3537,6 @@ void CDataModel::reparameterizeFromIniFile(const std::string & fileName) } getModel()->compileIfNecessary(NULL); // compile if needed - getModel()->refreshActiveParameterSet(); } const CDataObject * CDataModel::findObjectByDisplayName(const std::string & displayString) const @@ -3687,6 +3692,7 @@ const CDataObject * CDataModel::findObjectByDisplayName(const std::string & disp return NULL; } + #include #include @@ -3697,13 +3703,12 @@ bool CDataModel::convertODEsToReactions() { std::string sbml = exportSBMLToString(NULL, 3, 1); - + auto *doc = readSBMLFromString(sbml.c_str()); ConversionProperties props; props.addOption("inferReactions", true, "Infer reactions from rateRules in the model"); - if (doc->convert(props) != LIBSBML_OPERATION_SUCCESS) { CCopasiMessage(CCopasiMessage::ERROR, "Couldn't infer reactions: %s", doc->getErrorLog()->toString().c_str()); @@ -3718,42 +3723,19 @@ CDataModel::convertODEsToReactions() /* * Converts Reactions in this model to ODEs */ -bool +bool CDataModel::convertReactionsToODEs() { std::string sbml = exportSBMLToString(NULL, 3, 1); - + auto *doc = readSBMLFromString(sbml.c_str()); ConversionProperties props; props.addOption("replaceReactions", true, - "Replace reactions with rateRules"); - + "Replace reactions with rateRules" ); if (doc->convert(props) != LIBSBML_OPERATION_SUCCESS) { - CCopasiMessage(CCopasiMessage::ERROR, "Couldn't convert reactions to ODEs: %s", doc->getErrorLog()->toString().c_str()); - return false; - } - - std::string newSBML = writeSBMLToString(doc); - delete doc; - return importSBMLFromString(newSBML.c_str()); -} - -bool -CDataModel::convertParametersToGlobal() -{ - std::string sbml = exportSBMLToString(NULL, 3, 1); - - auto * doc = readSBMLFromString(sbml.c_str()); - - ConversionProperties props; - props.addOption("promoteLocalParameters", true, - "Promotes all Local Parameters to Global ones"); - - if (doc->convert(props) != LIBSBML_OPERATION_SUCCESS) - { - CCopasiMessage(CCopasiMessage::ERROR, "Couldn't promote local parameters: %s", doc->getErrorLog()->toString().c_str()); + CCopasiMessage(CCopasiMessage::ERROR, "Couldn't infer reactions: %s", doc->getErrorLog()->toString().c_str()); return false; } diff --git a/copasi/CopasiDataModel/CDataModel.h b/copasi/CopasiDataModel/CDataModel.h index 5116255b83..4db7473118 100644 --- a/copasi/CopasiDataModel/CDataModel.h +++ b/copasi/CopasiDataModel/CDataModel.h @@ -274,11 +274,6 @@ class CDataModel: public CDataContainer, public COutputHandler */ bool convertReactionsToODEs(); - /** - * Converts all local parameters to global ones. - */ - bool convertParametersToGlobal(); - std::string exportSBMLToString(CProcessReport * pProcessReport, int sbmlLevel, int sbmlVersion); bool exportSBML(const std::string & fileName, bool overwriteFile = false, int sbmlLevel = 2, int sbmlVersion = 1, bool exportIncomplete = false, bool exportCOPASIMIRIAM = true, CProcessReport * pProcessReport = NULL); diff --git a/copasi/CopasiSE/CopasiSE.cpp b/copasi/CopasiSE/CopasiSE.cpp index e377a44167..9ff6e6599b 100644 --- a/copasi/CopasiSE/CopasiSE.cpp +++ b/copasi/CopasiSE/CopasiSE.cpp @@ -214,8 +214,7 @@ int main(int argc, char *argv[]) COptions::getValue("License", License); COptions::getValue("ReportFile", ReportFileName); - - // should a report filename be given, ensure that + // should a report filename be given, ensure that // it is an absolute path if (!ReportFileName.empty()) CDirEntry::makePathAbsolute(ReportFileName, COptions::getPWD()); @@ -626,8 +625,8 @@ int exportParametersToIniFile() if (!pDataModel || !pDataModel->getModel()) return -2; - pDataModel->getModel()->refreshActiveParameterSet(); - pDataModel->getModel()->getActiveModelParameterSet().saveToStream(fs, CCore::Framework::Concentration, "ini", ""); + pDataModel->getModel()->getActiveModelParameterSet(). + saveToStream(fs, CCore::Framework::Concentration, "ini", ""); fs.close(); diff --git a/copasi/CopasiUI/CMakeLists.txt b/copasi/CopasiUI/CMakeLists.txt index fd0ce91758..8a78cf8dfb 100644 --- a/copasi/CopasiUI/CMakeLists.txt +++ b/copasi/CopasiUI/CMakeLists.txt @@ -125,8 +125,7 @@ if(NOT APPLE) install(TARGETS CopasiUI DESTINATION bin) # ensure that next to the binaries also dependencies are copied if (WIN32) - option(COPASI_WIN32_SKIP_BUNDLE_UTILS "Skip bundle utilities" ON) - SET(DIRS "" CACHE STRING "Directories containing shared libraries for fixup_bundle") + option(COPASI_WIN32_SKIP_BUNDLE_UTILS "Skip bundle utilities" OFF) mark_as_advanced(COPASI_WIN32_SKIP_BUNDLE_UTILS) if (NOT COPASI_WIN32_SKIP_BUNDLE_UTILS) install(CODE " diff --git a/copasi/UI/CQArrayAnnotationsWidget.cpp b/copasi/UI/CQArrayAnnotationsWidget.cpp index 357d5eea5d..bfdd98fd9a 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.cpp +++ b/copasi/UI/CQArrayAnnotationsWidget.cpp @@ -1,26 +1,26 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the -// University of Virginia, University of Heidelberg, and University -// of Connecticut School of Medicine. -// All rights reserved. - -// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual -// Properties, Inc., University of Heidelberg, and University of -// of Connecticut School of Medicine. -// All rights reserved. - -// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual -// Properties, Inc., University of Heidelberg, and The University -// of Manchester. -// All rights reserved. - -// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual -// Properties, Inc., EML Research, gGmbH, University of Heidelberg, -// and The University of Manchester. -// All rights reserved. - -// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual -// Properties, Inc. and EML Research, gGmbH. -// All rights reserved. +// Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and University of +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and The University +// of Manchester. +// All rights reserved. + +// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., EML Research, gGmbH, University of Heidelberg, +// and The University of Manchester. +// All rights reserved. + +// Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc. and EML Research, gGmbH. +// All rights reserved. #ifdef SunOS #include @@ -626,15 +626,7 @@ void CQArrayAnnotationsWidget::switchToBarChart() #ifdef WITH_QT5_VISUALIZATION if (!m_container) - { - if (!createBarChart()) - { - mpButton->setEnabled(false); - switchToTable(); - return; - } - - } + createBarChart(); fillBarChart(); @@ -947,9 +939,6 @@ void CQArrayAnnotationsWidget::fillBarChart() if (!mpArray) return; #ifdef WITH_QT5_VISUALIZATION - - if (!m_modifier) - return; m_modifier->loadData(mpArray, mRowIndex, mColIndex); @@ -1103,89 +1092,84 @@ void CQArrayAnnotationsWidget::fillBarChart() #endif } -bool CQArrayAnnotationsWidget::createBarChart() +void CQArrayAnnotationsWidget::createBarChart() { - if (!mWithBarChart) - return false; + if (!mWithBarChart) return; #ifdef WITH_QT5_VISUALIZATION m_graph = new Q3DBars(); - if (!m_graph->hasContext()) - { - pdelete(m_graph); - return false; - } m_container = QWidget::createWindowContainer(m_graph); - mpStack->addWidget(m_container); - m_modifier = new CQ3DBarsModifier(this, m_graph); - - m_contextMenu = new QMenu(this); - - QMenu * menu = new QMenu("Theme", m_contextMenu); - menu->addAction(new QAction("Qt", menu)); - menu->addAction(new QAction("Primary Colors", menu)); - menu->addAction(new QAction("Digia", menu)); - menu->addAction(new QAction("Stone Moss", menu)); - menu->addAction(new QAction("Army Blue", menu)); - menu->addAction(new QAction("Retro", menu)); - menu->addAction(new QAction("Ebony", menu)); - menu->addAction(new QAction("Isabelle", menu)); - m_contextMenu->addMenu(menu); // theme - - menu = new QMenu("Selection Mode", m_contextMenu); - menu->addAction(new QAction("None", menu)); - menu->addAction(new QAction("Bar", menu)); - menu->addAction(new QAction("Row", menu)); - menu->addAction(new QAction("Bar and Row", menu)); - menu->addAction(new QAction("Column", menu)); - menu->addAction(new QAction("Bar and Column", menu)); - menu->addAction(new QAction("Row and Column", menu)); - menu->addAction(new QAction("Bar, Row and Column", menu)); - menu->addAction(new QAction("Slice into Row", menu)); - menu->addAction(new QAction("Slice into Row and Item", menu)); - menu->addAction(new QAction("Slice into Column", menu)); - menu->addAction(new QAction("Slice into Column and Item", menu)); - m_contextMenu->addMenu(menu); // selection mode - - menu = new QMenu("Style", m_contextMenu); - menu->addAction(new QAction("Bar", menu)); - menu->addAction(new QAction("Pyramid", menu)); - menu->addAction(new QAction("Cone", menu)); - menu->addAction(new QAction("Cylinder", menu)); - menu->addAction(new QAction("Bevel bar", menu)); - menu->addAction(new QAction("Sphere", menu)); - m_contextMenu->addMenu(menu); // style - - menu = new QMenu("Shadow", m_contextMenu); - menu->addAction(new QAction("None", menu)); - menu->addAction(new QAction("Low", menu)); - menu->addAction(new QAction("Medium", menu)); - menu->addAction(new QAction("High", menu)); - menu->addAction(new QAction("Low Soft", menu)); - menu->addAction(new QAction("Medium Soft", menu)); - menu->addAction(new QAction("High Soft", menu)); - m_contextMenu->addMenu(menu); // style - - m_contextMenu->addSeparator(); - - m_contextMenu->addAction(new QAction("Change label style")); - m_contextMenu->addAction(new QAction("Smooth bars")); - m_contextMenu->addAction(new QAction("Change camera preset")); - m_contextMenu->addAction(new QAction("Zoom to selected bar")); - m_contextMenu->addAction(new QAction("Show background")); - m_contextMenu->addAction(new QAction("Show grid")); - m_contextMenu->addAction(new QAction("Show reflections")); - m_contextMenu->addAction(new QAction("Show Gradients")); - - connect(m_contextMenu, SIGNAL(triggered(QAction *)), m_modifier, SLOT(actionTriggered(QAction *))); - - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotShowContextMenu(const QPoint &))); - + if (m_graph->hasContext()) + { + m_modifier = new CQ3DBarsModifier(this, m_graph); + + m_contextMenu = new QMenu(this); + + QMenu* menu = new QMenu("Theme", m_contextMenu); + menu->addAction(new QAction("Qt", menu)); + menu->addAction(new QAction("Primary Colors", menu)); + menu->addAction(new QAction("Digia", menu)); + menu->addAction(new QAction("Stone Moss", menu)); + menu->addAction(new QAction("Army Blue", menu)); + menu->addAction(new QAction("Retro", menu)); + menu->addAction(new QAction("Ebony", menu)); + menu->addAction(new QAction("Isabelle", menu)); + m_contextMenu->addMenu(menu); // theme + + menu = new QMenu("Selection Mode", m_contextMenu); + menu->addAction(new QAction("None", menu)); + menu->addAction(new QAction("Bar", menu)); + menu->addAction(new QAction("Row", menu)); + menu->addAction(new QAction("Bar and Row", menu)); + menu->addAction(new QAction("Column", menu)); + menu->addAction(new QAction("Bar and Column", menu)); + menu->addAction(new QAction("Row and Column", menu)); + menu->addAction(new QAction("Bar, Row and Column", menu)); + menu->addAction(new QAction("Slice into Row", menu)); + menu->addAction(new QAction("Slice into Row and Item", menu)); + menu->addAction(new QAction("Slice into Column", menu)); + menu->addAction(new QAction("Slice into Column and Item", menu)); + m_contextMenu->addMenu(menu); // selection mode + + menu = new QMenu("Style", m_contextMenu); + menu->addAction(new QAction("Bar", menu)); + menu->addAction(new QAction("Pyramid", menu)); + menu->addAction(new QAction("Cone", menu)); + menu->addAction(new QAction("Cylinder", menu)); + menu->addAction(new QAction("Bevel bar", menu)); + menu->addAction(new QAction("Sphere", menu)); + m_contextMenu->addMenu(menu); // style + + menu = new QMenu("Shadow", m_contextMenu); + menu->addAction(new QAction("None", menu)); + menu->addAction(new QAction("Low", menu)); + menu->addAction(new QAction("Medium", menu)); + menu->addAction(new QAction("High", menu)); + menu->addAction(new QAction("Low Soft", menu)); + menu->addAction(new QAction("Medium Soft", menu)); + menu->addAction(new QAction("High Soft", menu)); + m_contextMenu->addMenu(menu); // style + + m_contextMenu->addSeparator(); + + m_contextMenu->addAction(new QAction("Change label style")); + m_contextMenu->addAction(new QAction("Smooth bars")); + m_contextMenu->addAction(new QAction("Change camera preset")); + m_contextMenu->addAction(new QAction("Zoom to selected bar")); + m_contextMenu->addAction(new QAction("Show background")); + m_contextMenu->addAction(new QAction("Show grid")); + m_contextMenu->addAction(new QAction("Show reflections")); + m_contextMenu->addAction(new QAction("Show Gradients")); + + connect(m_contextMenu, SIGNAL(triggered(QAction*)), m_modifier, SLOT(actionTriggered(QAction*))); + + setContextMenuPolicy(Qt::CustomContextMenu); + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotShowContextMenu(const QPoint &))); + } #else mpPlot3d = new CQBarChart(); @@ -1201,6 +1185,4 @@ bool CQArrayAnnotationsWidget::createBarChart() mBarChartFilled = false; #endif // WITH_QT5_VISUALIZATION - - return true; } diff --git a/copasi/UI/CQArrayAnnotationsWidget.h b/copasi/UI/CQArrayAnnotationsWidget.h index dba8725840..590bfc2c50 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.h +++ b/copasi/UI/CQArrayAnnotationsWidget.h @@ -179,7 +179,7 @@ public slots: void fillTable0(); - bool createBarChart(); + void createBarChart(); void fillBarChart(); diff --git a/copasi/UI/CQCompartmentsWidget.cpp b/copasi/UI/CQCompartmentsWidget.cpp index 8de6a2f3f6..6a46045f70 100644 --- a/copasi/UI/CQCompartmentsWidget.cpp +++ b/copasi/UI/CQCompartmentsWidget.cpp @@ -97,9 +97,9 @@ void CQCompartmentsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQCompartmentsWidget::slotBtnDeleteClicked(bool needFocus) +void CQCompartmentsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblCompartments->hasFocus()) + if (mpTblCompartments->hasFocus()) {deleteSelectedCompartments();} updateDeleteBtns(); @@ -264,7 +264,7 @@ void CQCompartmentsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQCompartmentsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblCompartments->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQCompartmentsWidget.h b/copasi/UI/CQCompartmentsWidget.h index 4f6359b30f..50a055692f 100644 --- a/copasi/UI/CQCompartmentsWidget.h +++ b/copasi/UI/CQCompartmentsWidget.h @@ -60,7 +60,7 @@ class CQCompartmentsWidget : public CopasiWidget, public Ui::CQCompartmentsWidge protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQEventsWidget.cpp b/copasi/UI/CQEventsWidget.cpp index 9773bf5d3b..bed8dfb87e 100644 --- a/copasi/UI/CQEventsWidget.cpp +++ b/copasi/UI/CQEventsWidget.cpp @@ -96,9 +96,9 @@ void CQEventsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQEventsWidget::slotBtnDeleteClicked(bool needFocus) +void CQEventsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblEvents->hasFocus()) + if (mpTblEvents->hasFocus()) {deleteSelectedEvents();} updateDeleteBtns(); @@ -256,7 +256,7 @@ void CQEventsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQEventsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblEvents->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQEventsWidget.h b/copasi/UI/CQEventsWidget.h index f4b4eb3de2..e0f9b4413b 100644 --- a/copasi/UI/CQEventsWidget.h +++ b/copasi/UI/CQEventsWidget.h @@ -60,7 +60,7 @@ class CQEventsWidget : public CopasiWidget, public Ui::CQEventsWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQExternalToolDialog.cpp b/copasi/UI/CQExternalToolDialog.cpp deleted file mode 100644 index b8a6917058..0000000000 --- a/copasi/UI/CQExternalToolDialog.cpp +++ /dev/null @@ -1,244 +0,0 @@ -#include "CQExternalToolDialog.h" - -#include "CQExternalTools.h" - -#include -#include -#include - - -CQExternalToolDialog::CQExternalToolDialog(QWidget * parent, const char * name, bool modal, Qt::WindowFlags fl) - : QDialog(parent, fl) - , mTools() - , mCurrentTool() - , mCurrentIndex(-1) -{ - setupUi(this); -} - -CQExternalToolDialog::~CQExternalToolDialog() -{ -} - -void CQExternalToolDialog::init(CQExternalTools * tools) -{ - if (tools == nullptr) - return; - - bool block = blockSignals(true); - - // clear the textboxes - txtTitle->clear(); - txtCommand->clear(); - txtArguments->clear(); - txtInitialDirectory->clear(); - chkPromptForArguments->setChecked(false); - - // disable them - txtTitle->setEnabled(false); - txtCommand->setEnabled(false); - txtArguments->setEnabled(false); - txtInitialDirectory->setEnabled(false); - chkPromptForArguments->setEnabled(false); - - // create a copy of the tools - mTools.clear(); - lstExternalTools->clear(); - for (auto * tool : tools->getTools()) - { - mTools.append(CQExternalTool(*tool)); - lstExternalTools->addItem(tool->getName()); - } - - // select the first tool - if (!mTools.isEmpty()) - { - lstExternalTools->setCurrentRow(0); - } - - blockSignals(block); -} - -void CQExternalToolDialog::saveTools(bool deleteExisting) -{ - if (deleteExisting) - { - auto exitingFiles = CQExternalTools::getToolFiles(); - for (auto & file : exitingFiles) - { - QFile::remove(file); - } - } - - for (auto & tool : mTools) - { - tool.ensureIniFile(); - tool.save(); - } -} - -void CQExternalToolDialog::slotAddTool() -{ - // add a new tool - CQExternalTool tool; - tool.setName(QString("[Tool %1]").arg(mTools.size() + 1)); - mTools.append(tool); - lstExternalTools->addItem(tool.getName()); -} - -void CQExternalToolDialog::slotDeleteTool() -{ - // get the selected tool - auto index = lstExternalTools->currentRow(); - if (index < 0 || index >= mTools.size()) - return; - - // remove it - mTools.removeAt(index); - delete lstExternalTools->takeItem(index); -} - -void CQExternalToolDialog::slotMoveUp() -{ - // get the selected tool - auto index = lstExternalTools->currentRow(); - if (index <= 1 || index >= mTools.size()) - return; - - // move it up - mTools.move(index, index - 1); - lstExternalTools->insertItem(index - 1, lstExternalTools->takeItem(index)); -} - -void CQExternalToolDialog::slotMoveDown() -{ - // get the selected tool - auto index = lstExternalTools->currentRow(); - if (index < 0 || index >= mTools.size() - 1) - return; - - // move it down - mTools.move(index, index + 1); - lstExternalTools->insertItem(index + 1, lstExternalTools->takeItem(index)); -} - -void CQExternalToolDialog::slotBrowseCommand() -{ - // open a file dialog to select the command - auto command = QFileDialog::getOpenFileName(this, tr("Select Command"), QString(), tr("All Files (*)")); - if (!command.isEmpty()) - txtCommand->setText(command); - -} - -void CQExternalToolDialog::slotShowArgs() -{ - // show a contect menu with default arguments: $cpsFile, $sbmlFile, $omexFile, $copasiExecutable - QMenu menu(this); - menu.addAction("$cpsFile"); - menu.addAction("$sbmlFile"); - menu.addAction("$omexFile"); - menu.addAction("$copasiExecutable"); - - auto action = menu.exec(QCursor::pos()); - if (action) - { - txtArguments->setText(txtArguments->text() + action->text()); - } - -} - -void CQExternalToolDialog::slotBrowseInitialDir() -{ - // open a file dialog to select the initial directory - auto dir = QFileDialog::getExistingDirectory(this, tr("Select Initial Directory")); - if (!dir.isEmpty()) - txtInitialDirectory->setText(dir); -} - -void CQExternalToolDialog::slotItemChanged() -{ - - // get the selected tool - auto index = lstExternalTools->currentRow(); - if (index < 0 || index >= mTools.size()) - { - bool block = blockSignals(true); - - // clear the textboxes - txtTitle->clear(); - txtCommand->clear(); - txtArguments->clear(); - txtInitialDirectory->clear(); - txtIniFile->clear(); - chkPromptForArguments->setChecked(false); - - // disable them - txtTitle->setEnabled(false); - txtCommand->setEnabled(false); - txtArguments->setEnabled(false); - txtInitialDirectory->setEnabled(false); - chkPromptForArguments->setEnabled(false); - - blockSignals(block); - - return; - } - - // if current index is different from the selected index, save the current tool - if (mCurrentIndex != index && mCurrentIndex >= 0 && mCurrentIndex < mTools.size()) - { - mCurrentTool.setName(txtTitle->text()); - mCurrentTool.setCommand(txtCommand->text()); - mCurrentTool.setArguments(txtArguments->text()); - mCurrentTool.setWorkingDirectory(txtInitialDirectory->text()); - mCurrentTool.setPromptForArguments(chkPromptForArguments->isChecked()); - mCurrentTool.setIniFile(txtIniFile->text()); - - mTools[mCurrentIndex] = mCurrentTool; - // update the name in the list - lstExternalTools->item(mCurrentIndex)->setText(mCurrentTool.getName()); - } - - mCurrentIndex = index; - mCurrentTool = mTools[index]; - - bool block = blockSignals(true); - - // set the textboxes - txtTitle->setText(mCurrentTool.getName()); - txtCommand->setText(mCurrentTool.getCommand()); - txtArguments->setText(mCurrentTool.getArguments()); - txtInitialDirectory->setText(mCurrentTool.getWorkingDirectory()); - txtIniFile->setText(mCurrentTool.getIniFile()); - chkPromptForArguments->setChecked(mCurrentTool.promptForArguments()); - - // enable them - txtTitle->setEnabled(true); - txtCommand->setEnabled(true); - txtArguments->setEnabled(true); - txtInitialDirectory->setEnabled(true); - chkPromptForArguments->setEnabled(true); - - blockSignals(block); - -} - -void CQExternalToolDialog::slotUpdateSelected() -{ - if (mCurrentIndex < 0 || mCurrentIndex >= mTools.size()) - return; - - if (signalsBlocked()) - return; - - mCurrentTool.setName(txtTitle->text()); - mCurrentTool.setCommand(txtCommand->text()); - mCurrentTool.setArguments(txtArguments->text()); - mCurrentTool.setWorkingDirectory(txtInitialDirectory->text()); - mCurrentTool.setPromptForArguments(chkPromptForArguments->isChecked()); - mCurrentTool.setIniFile(txtIniFile->text()); - - mTools[mCurrentIndex] = mCurrentTool; - lstExternalTools->item(mCurrentIndex)->setText(mCurrentTool.getName()); -} diff --git a/copasi/UI/CQExternalToolDialog.h b/copasi/UI/CQExternalToolDialog.h deleted file mode 100644 index b77292de36..0000000000 --- a/copasi/UI/CQExternalToolDialog.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef CQ_EXTERNAL_TOOL_DIALOG_H -#define CQ_EXTERNAL_TOOL_DIALOG_H - -#include - -#include "copasi/UI/ui_CQExternalToolDialog.h" - -#include "CQExternalTools.h" - -class CQExternalToolDialog : public QDialog - , public Ui_CQExternalToolDialog -{ - Q_OBJECT - -public: - CQExternalToolDialog(QWidget * parent = 0, const char * name = 0, bool modal = false, Qt::WindowFlags fl = Qt::WindowFlags()); - ~CQExternalToolDialog(); - - void init(CQExternalTools * tools); - - void saveTools(bool deleteExisting); - -public slots: - void slotAddTool(); - void slotDeleteTool(); - void slotMoveUp(); - void slotMoveDown(); - void slotBrowseCommand(); - void slotShowArgs(); - void slotBrowseInitialDir(); - void slotItemChanged(); - void slotUpdateSelected(); - -private: - QList< CQExternalTool > mTools; - - CQExternalTool mCurrentTool; - size_t mCurrentIndex; -}; - -#endif // CQ_EXTERNAL_TOOL_DIALOG_H diff --git a/copasi/UI/CQExternalToolDialog.ui b/copasi/UI/CQExternalToolDialog.ui deleted file mode 100644 index 894b310793..0000000000 --- a/copasi/UI/CQExternalToolDialog.ui +++ /dev/null @@ -1,460 +0,0 @@ - - - CQExternalToolDialog - - - - 0 - 0 - 538 - 418 - - - - External tool - - - - - - - - Title: - - - - - - - - - - Command - - - - - - - - - - - - ... - - - - - - - - - Arguments: - - - - - - - - - - - - > - - - - - - - - - Initial directory - - - - - - - - - - - - ... - - - - - - - - - ini - - - - - - - false - - - - - - - &Prompt for arguments - - - - - - - - - - - - - Menu contents: - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - &Add - - - - - - - &Delete - - - - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - - - - - - Move &Up - - - - - - - Move Do&wn - - - - - - - - - - - - - Qt::Orientation::Horizontal - - - QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok - - - - - - - lstExternalTools - cmdAdd - cmdDelete - cmdMoveUp - cmdMoveDown - txtTitle - txtCommand - cmdBrowseCommand - txtArguments - cmdShowArgContext - txtInitialDirectory - cmdBrowseInitialDir - chkPromptForArguments - - - - - buttonBox - accepted() - CQExternalToolDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - CQExternalToolDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - cmdAdd - clicked() - CQExternalToolDialog - slotAddTool() - - - 488 - 51 - - - 268 - 208 - - - - - cmdBrowseCommand - clicked() - CQExternalToolDialog - slotBrowseCommand() - - - 515 - 279 - - - 268 - 208 - - - - - cmdBrowseInitialDir - clicked() - CQExternalToolDialog - slotBrowseInitialDir() - - - 515 - 339 - - - 268 - 208 - - - - - cmdDelete - clicked() - CQExternalToolDialog - slotDeleteTool() - - - 488 - 81 - - - 268 - 208 - - - - - cmdMoveDown - clicked() - CQExternalToolDialog - slotMoveDown() - - - 488 - 217 - - - 268 - 208 - - - - - cmdMoveUp - clicked() - CQExternalToolDialog - slotMoveUp() - - - 488 - 187 - - - 268 - 208 - - - - - cmdShowArgContext - clicked() - CQExternalToolDialog - slotShowArgs() - - - 516 - 309 - - - 268 - 208 - - - - - lstExternalTools - currentItemChanged(QListWidgetItem*,QListWidgetItem*) - CQExternalToolDialog - slotItemChanged() - - - 227 - 134 - - - 268 - 208 - - - - - txtArguments - textChanged(QString) - CQExternalToolDialog - slotUpdateSelected() - - - 297 - 281 - - - 268 - 208 - - - - - txtTitle - textChanged(QString) - CQExternalToolDialog - slotUpdateSelected() - - - 311 - 222 - - - 268 - 208 - - - - - txtCommand - textChanged(QString) - CQExternalToolDialog - slotUpdateSelected() - - - 297 - 251 - - - 268 - 208 - - - - - txtInitialDirectory - textChanged(QString) - CQExternalToolDialog - slotUpdateSelected() - - - 297 - 311 - - - 268 - 208 - - - - - - slotAddTool() - slotDeleteTool() - slotMoveUp() - slotMoveDown() - slotBrowseCommand() - slotShowArgs() - slotBrowseInitialDir() - slotItemChanged() - slotUpdateSelected() - - diff --git a/copasi/UI/CQExternalTools.cpp b/copasi/UI/CQExternalTools.cpp deleted file mode 100644 index 1ffa6ea287..0000000000 --- a/copasi/UI/CQExternalTools.cpp +++ /dev/null @@ -1,360 +0,0 @@ -#include "CQExternalTools.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include -#include - - - -CQExternalTools::CQExternalTools() - : mpAction(nullptr) - , mpMenu(nullptr) - , mActionToTool() -{ -} - -CQExternalTools::CQExternalTools(const CQExternalTools & other) - : mpAction(other.mpAction) - , mpMenu(other.mpMenu) - , mActionToTool(other.mActionToTool) -{ -} - -CQExternalTools::~CQExternalTools() -{ -} - -void CQExternalTools::init(QMenu * pMenu, QAction * pAction) -{ - mpMenu = pMenu; - mpAction = pAction; - - removeActionsFromMenu(); - - mActionToTool.clear(); - - auto files = getToolFiles(); - QString copasiDir = QString(COptions::getConfigDir().c_str()); - - for (auto & file : files) - { - auto tool = new CQExternalTool(file); - if (!tool->isValid()) - { - delete tool; - continue; - } - - auto action = new QAction(tool->getName(), mpMenu); - QObject::connect(action, &QAction::triggered, tool, &CQExternalTool::execute); - - - mActionToTool[action] = tool; - } - - addActionsToMenu(); -} - -void CQExternalTools::removeActionsFromMenu() -{ - if (!mpMenu || !mpAction) - return; - - for (auto & action : mActionToTool) - { - mpMenu->removeAction(action.first); - delete action.first; - delete action.second; - } -} - -void CQExternalTools::addActionsToMenu() -{ - if (!mpMenu || !mpAction) - return; - - for (auto & action : mActionToTool) - { - mpMenu->insertAction(mpAction, action.first); - } -} - -QStringList CQExternalTools::getToolFiles() -{ - // find all setting files for external tools - // they will be in the configDir as tools*.ini - auto copasiDir = QString(COptions::getConfigDir().c_str()); - - // use the QDir class to find all files that match the pattern - QDir dir(copasiDir); - QStringList filters; - filters << "tools*.ini"; - dir.setNameFilters(filters); - - QStringList files = dir.entryList(); - // now prepend the directory to the file names - for (auto & file : files) - { - file = copasiDir + QString("/") + file; - } - - return files; -} - - -QStringList CQExternalTools::getToolNames() const -{ - QStringList names; - - for (auto & action : mActionToTool) - { - names << action.second->getName(); - } - - return names; -} - -QList< CQExternalTool * > CQExternalTools::getTools() const -{ - QList< CQExternalTool * > tools; - - for (auto & action : mActionToTool) - { - tools << action.second; - } - - return tools; - -} - -CQExternalTool::CQExternalTool() - : mIniFile() - , name() - , toolTip() - , command() - , arguments() - , workingDirectory() - , mPromptForArguments(false) - , mIsValid(false) -{ -} - -CQExternalTool::CQExternalTool(const QString & iniFile) - : mIniFile(iniFile) -{ - QSettings settings(iniFile, QSettings::IniFormat); - - settings.beginGroup("ExternalTool"); - - name = settings.value("name").toString(); - toolTip = settings.value("toolTip").toString(); - command = settings.value("command").toString(); - arguments = settings.value("arguments").toString(); - workingDirectory = settings.value("workingDirectory").toString(); - - mPromptForArguments = settings.value("promptForArguments").toBool(); - - mIsValid = !name.isEmpty(); -} - -CQExternalTool::CQExternalTool(const CQExternalTool & other) - : mIniFile(other.mIniFile) - , name(other.name) - , toolTip(other.toolTip) - , command(other.command) - , arguments(other.arguments) - , workingDirectory(other.workingDirectory) - , mPromptForArguments(other.mPromptForArguments) - , mIsValid(other.mIsValid) -{ -} - -CQExternalTool::~CQExternalTool() -{ -} - -CQExternalTool & CQExternalTool::operator=(const CQExternalTool & other) -{ - if (this != &other) - { - mIniFile = other.mIniFile; - name = other.name; - toolTip = other.toolTip; - command = other.command; - arguments = other.arguments; - workingDirectory = other.workingDirectory; - mPromptForArguments = other.mPromptForArguments; - mIsValid = other.mIsValid; - } - - return *this; -} - -void CQExternalTool::save() -{ - QSettings settings(mIniFile, QSettings::IniFormat); - - settings.beginGroup("ExternalTool"); - - settings.setValue("name", name); - settings.setValue("toolTip", toolTip); - settings.setValue("command", command); - settings.setValue("arguments", arguments); - settings.setValue("workingDirectory", workingDirectory); - - settings.setValue("promptForArguments", mPromptForArguments); - - settings.endGroup(); -} - -void CQExternalTool::ensureIniFile() -{ - // if the ini file is not set, create a new one - if (mIniFile.isEmpty()) - { - auto files = CQExternalTools::getToolFiles(); - QString copasiDir = QString(COptions::getConfigDir().c_str()); - QString iniFile = copasiDir + "/tools1.ini"; - int i = 1; - while (files.contains(iniFile)) - { - iniFile = copasiDir + QString("/tools%1.ini").arg(++i); - } - mIniFile = iniFile; - } -} - -void CQExternalTool::execute() -{ - auto args = arguments; - // if prompt for arguments is set, show a dialog to enter the arguments - if (mPromptForArguments) - { - // show a dialog to enter the arguments - args = QInputDialog::getText(nullptr, "Arguments", "Enter the arguments for the tool", QLineEdit::Normal, arguments); - if (args.isEmpty()) - return; - } - - auto *dm_gui = getDataModel(); - if (!dm_gui) - return; - - auto * dm = dm_gui->getDataModel(); - if (!dm) - return; - - - - // split the arguments into a list - QStringList argList; - QString arg; - bool inQuote = false; - for (auto & c : args) - { - if (c == '\"') - { - inQuote = !inQuote; - continue; - } - - if (c == ' ' && !inQuote) - { - argList << arg; - arg.clear(); - continue; - } - - arg += c; - } - - if (!arg.isEmpty()) - { - argList << arg; - } - - - - // handle special arguments: $cpsFile, $sbmlFile, $omexFile, $copasiExecutable - auto saveDir = QString(COptions::getTemp().c_str()); - - // loop over the arguments and replace the special arguments - for (auto & arg : argList) - { - if (arg == "$copasiExecutable") - { - // determine the path to the currently running copasi - auto copasiExecutable = QCoreApplication::applicationFilePath(); - arg = copasiExecutable; - } - - if (arg == "$cpsFile") - { - auto cpsFile = saveDir + "/temp.cps"; - auto cps = dm->saveModelToString(NULL); - - QFile file(cpsFile); - if (file.open(QIODevice::WriteOnly)) - { - QTextStream stream(&file); - stream << FROM_UTF8(cps); - } - file.close(); - - arg = cpsFile; - } - - if (arg.startsWith("$sbmlFile")) - { - int sbmlLevel = 3; - int sbmlVersion = 2; - if (arg.at(arg.length() - 4) == 'L' && arg.at(arg.length() - 2) == 'V') - { - sbmlLevel = QString(arg.at(arg.length() - 3)).toInt(); - sbmlVersion = QString(arg.at(arg.length() - 1)).toInt(); - } - - auto sbmlFile = saveDir + "/temp.sbml"; - auto sbml = dm->exportSBMLToString(NULL, sbmlLevel, sbmlVersion); - - QFile file(sbmlFile); - if (file.open(QIODevice::WriteOnly)) - { - QTextStream stream(&file); - stream << FROM_UTF8(sbml); - } - file.close(); - - arg = sbmlFile; - } - - if (arg == "$omexFile") - { - auto omexFile = saveDir + "/temp.omex"; - auto omex = dm->exportCombineArchive(TO_UTF8(omexFile), true, true, true, true, true); - arg = omexFile; - } - } - - - // execute the command using QProcess - QProcess process; - process.setWorkingDirectory(workingDirectory); - process.setProgram(command); - process.setWorkingDirectory(workingDirectory); - process.startDetached(command, argList); - -} diff --git a/copasi/UI/CQExternalTools.h b/copasi/UI/CQExternalTools.h deleted file mode 100644 index 359c94f685..0000000000 --- a/copasi/UI/CQExternalTools.h +++ /dev/null @@ -1,136 +0,0 @@ -#ifndef CQ_EXTERNAL_TOOLS_H -#define CQ_EXTERNAL_TOOLS_H - -class QAction; -class QMenu; - -#include -#include -#include - -#include - -class CQExternalTool : public QObject -{ - Q_OBJECT - -public: - CQExternalTool(); - CQExternalTool(const QString & iniFile); - CQExternalTool(const CQExternalTool & other); - ~CQExternalTool(); - - CQExternalTool & operator=(const CQExternalTool & other); - - bool isValid() const - { - return mIsValid; - } - - QString getName() const - { - return name; - } - void setName(const QString & value) - { - name = value; - } - - QString getToolTip() const - { - return toolTip; - } - void setToolTip(const QString & value) - { - toolTip = value; - } - - QString getCommand() const - { - return command; - } - void setCommand(const QString & value) - { - command = value; - } - - QString getArguments() const - { - return arguments; - } - void setArguments(const QString & value) - { - arguments = value; - } - - QString getWorkingDirectory() const - { - return workingDirectory; - } - void setWorkingDirectory(const QString & value) - { - workingDirectory = value; - } - - bool promptForArguments() const - { - return mPromptForArguments; - } - void setPromptForArguments(bool value) - { - mPromptForArguments = value; - } - - QString getIniFile() const - { - return mIniFile; - } - void setIniFile(const QString & value) - { - mIniFile = value; - } - - void ensureIniFile(); - -public slots: - void execute(); - void save(); - -private: - QString mIniFile; - - QString name; - QString toolTip; - QString command; - QString arguments; - QString workingDirectory; - - bool mPromptForArguments; - bool mIsValid; -}; - -class CQExternalTools -{ - -public: - CQExternalTools(); - CQExternalTools(const CQExternalTools & other); - ~CQExternalTools(); - - void init(QMenu * pMenu, QAction * pAction); - - void removeActionsFromMenu(); - void addActionsToMenu(); - - static QStringList getToolFiles(); - QStringList getToolNames() const; - QList< CQExternalTool * > getTools() const; - -private: - QAction * mpAction; - QMenu * mpMenu; - - std::map< QAction *, CQExternalTool * > mActionToTool; -}; - -#endif // CQ_EXTERNAL_TOOLS_H \ No newline at end of file diff --git a/copasi/UI/CQFittingWidget.cpp b/copasi/UI/CQFittingWidget.cpp index 327d3f4119..d54e6ca653 100644 --- a/copasi/UI/CQFittingWidget.cpp +++ b/copasi/UI/CQFittingWidget.cpp @@ -217,12 +217,6 @@ bool CQFittingWidget::saveTaskProtected() pProblem->setCalculateStatistics(mpCheckStatistics->isChecked()); } - if (mpCheckDisplayPopulation->isChecked() != pProblem->getParameter("DisplayPoplations")->getValue< bool >()) - { - mChanged = true; - pProblem->getParameter("DisplayPoplations")->setValue(mpCheckStatistics->isChecked()); - } - if (mpUseTimeSens->isChecked() != pProblem->getUseTimeSens()) { mChanged = true; @@ -279,7 +273,6 @@ bool CQFittingWidget::loadTaskProtected() mpCheckRandomize->setChecked(pProblem->getRandomizeStartValues()); mpCreateParameterSets->setChecked(pProblem->getCreateParameterSets()); mpCheckStatistics->setChecked(pProblem->getCalculateStatistics()); - mpCheckDisplayPopulation->setChecked(pProblem->getParameter("DisplayPoplations")->getValue< bool >()); mpUseTimeSens->setChecked(pProblem->getUseTimeSens()); mpParameters->load(mpDataModel, pProblem->getGroup("OptimizationItemList"), &mExperimentKeyMap, &mCrossValidationKeyMap); @@ -398,6 +391,7 @@ void CQFittingWidget::init() pGroupLayout->setContentsMargins(0, 0, 0, 0); mpTabWidget->setCornerWidget(pGroup); + } void CQFittingWidget::slotIncreaseTabHeight() @@ -407,13 +401,12 @@ void CQFittingWidget::slotIncreaseTabHeight() mpTabWidget->setMinimumHeight(height); } + void CQFittingWidget::slotDecreaseTabHeight() { auto height = mpTabWidget->height(); - if (height < 300) return; - height -= 100; mpTabWidget->setMinimumHeight(height); } diff --git a/copasi/UI/CQFittingWidget.ui b/copasi/UI/CQFittingWidget.ui index 9a3267d379..ba273b586d 100644 --- a/copasi/UI/CQFittingWidget.ui +++ b/copasi/UI/CQFittingWidget.ui @@ -101,16 +101,6 @@ Use Time Sens - - false - - - - - - - Display Population - diff --git a/copasi/UI/CQFunctionsWidget.cpp b/copasi/UI/CQFunctionsWidget.cpp index 736bb3ef4b..8cf4d58e8d 100644 --- a/copasi/UI/CQFunctionsWidget.cpp +++ b/copasi/UI/CQFunctionsWidget.cpp @@ -91,9 +91,9 @@ void CQFunctionsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQFunctionsWidget::slotBtnDeleteClicked(bool needFocus) +void CQFunctionsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblFunctions->hasFocus()) + if (mpTblFunctions->hasFocus()) {deleteSelectedFunctions();} updateDeleteBtns(); @@ -122,7 +122,7 @@ void CQFunctionsWidget::deleteSelectedFunctions() void CQFunctionsWidget::slotBtnClearClicked() { - int ret = CQMessageBox::question(this, tr("Confirm Delete"), "Delete all non-built-in, non-mass-action, Functions?", + int ret = CQMessageBox::question(this, tr("Confirm Delete"), "Delete all non-built-in, non-mass-acion, Functions?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (ret == QMessageBox::Yes) @@ -249,7 +249,7 @@ void CQFunctionsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQFunctionsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblFunctions->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQFunctionsWidget.h b/copasi/UI/CQFunctionsWidget.h index aaf376b15a..ca50ecd88d 100644 --- a/copasi/UI/CQFunctionsWidget.h +++ b/copasi/UI/CQFunctionsWidget.h @@ -55,7 +55,7 @@ class CQFunctionsWidget : public CopasiWidget, public Ui::CQFunctionsWidget protected slots: virtual void updateDeleteBtns(); virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); virtual void dataChanged(const QModelIndex& topLeft, diff --git a/copasi/UI/CQGlobalQuantitiesWidget.cpp b/copasi/UI/CQGlobalQuantitiesWidget.cpp index faefd7e1df..06fd171fd3 100644 --- a/copasi/UI/CQGlobalQuantitiesWidget.cpp +++ b/copasi/UI/CQGlobalQuantitiesWidget.cpp @@ -96,9 +96,9 @@ void CQGlobalQuantitiesWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQGlobalQuantitiesWidget::slotBtnDeleteClicked(bool needFocus) +void CQGlobalQuantitiesWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblGlobalQuantities->hasFocus()) + if (mpTblGlobalQuantities->hasFocus()) {deleteSelectedGlobalQuantities();} updateDeleteBtns(); @@ -257,7 +257,7 @@ void CQGlobalQuantitiesWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQGlobalQuantitiesWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblGlobalQuantities->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQGlobalQuantitiesWidget.h b/copasi/UI/CQGlobalQuantitiesWidget.h index 5f7a1afc7b..9bfe877fd8 100644 --- a/copasi/UI/CQGlobalQuantitiesWidget.h +++ b/copasi/UI/CQGlobalQuantitiesWidget.h @@ -59,7 +59,7 @@ class CQGlobalQuantitiesWidget : public CopasiWidget, public Ui::CQGlobalQuantit protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQLayoutsWidget.cpp b/copasi/UI/CQLayoutsWidget.cpp index 7cedaa1d84..720da8d49b 100644 --- a/copasi/UI/CQLayoutsWidget.cpp +++ b/copasi/UI/CQLayoutsWidget.cpp @@ -317,9 +317,9 @@ void CQLayoutsWidget::slotBtnNewClicked() } // virtual -void CQLayoutsWidget::slotBtnDeleteClicked(bool needFocus) +void CQLayoutsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblLayouts->hasFocus()) + if (mpTblLayouts->hasFocus()) {deleteSelectedLayouts();} } diff --git a/copasi/UI/CQLayoutsWidget.h b/copasi/UI/CQLayoutsWidget.h index a15c0b1e8f..aa4fa03dda 100644 --- a/copasi/UI/CQLayoutsWidget.h +++ b/copasi/UI/CQLayoutsWidget.h @@ -75,7 +75,7 @@ class CQLayoutsWidget : public CopasiWidget, public Ui::CQLayoutsWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQOptimizationWidget.cpp b/copasi/UI/CQOptimizationWidget.cpp index e77cdb4a9b..7e8863923a 100644 --- a/copasi/UI/CQOptimizationWidget.cpp +++ b/copasi/UI/CQOptimizationWidget.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -115,12 +115,6 @@ bool CQOptimizationWidget::saveTaskProtected() pProblem->setCalculateStatistics(mpCheckStatistics->isChecked()); } - if (mpCheckDisplayPopulation->isChecked() != pProblem->getParameter("DisplayPoplations")->getValue< bool >()) - { - mChanged = true; - pProblem->getParameter("DisplayPoplations")->setValue(mpCheckStatistics->isChecked()); - } - mChanged |= mpParameters->save(NULL, NULL); mChanged |= mpConstraints->save(NULL, NULL); @@ -156,7 +150,6 @@ bool CQOptimizationWidget::loadTaskProtected() mpCheckRandomize->setChecked(pProblem->getRandomizeStartValues()); mpCheckStatistics->setChecked(pProblem->getCalculateStatistics()); - mpCheckDisplayPopulation->setChecked(pProblem->getParameter("DisplayPoplations")->getValue< bool >()); mpBoxSubtask->setCurrentIndex(mpBoxSubtask->findText(FROM_UTF8(CTaskEnum::TaskName[pProblem->getSubtaskType()]))); @@ -259,13 +252,14 @@ void CQOptimizationWidget::init() QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotIncreaseTabHeight())); pGroupLayout->addWidget(tb); + tb = new QToolButton(); tb->setText("-"); QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotDecreaseTabHeight())); pGroupLayout->addWidget(tb); - + pGroupLayout->setContentsMargins(0, 0, 0, 0); - + mpTabWidget->setCornerWidget(pGroup); } @@ -279,14 +273,13 @@ void CQOptimizationWidget::slotIncreaseTabHeight() void CQOptimizationWidget::slotDecreaseTabHeight() { auto height = mpTabWidget->height(); - if (height < 300) return; - height -= 100; mpTabWidget->setMinimumHeight(height); } + void CQOptimizationWidget::destroy() {} diff --git a/copasi/UI/CQOptimizationWidget.ui b/copasi/UI/CQOptimizationWidget.ui index e7586c52e9..99a20e224c 100644 --- a/copasi/UI/CQOptimizationWidget.ui +++ b/copasi/UI/CQOptimizationWidget.ui @@ -1,5 +1,29 @@ + Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the + University of Virginia, University of Heidelberg, and University + of Connecticut School of Medicine. + All rights reserved. + + Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc., University of Heidelberg, and University of + of Connecticut School of Medicine. + All rights reserved. + + Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc., University of Heidelberg, and The University + of Manchester. + All rights reserved. + + Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc., EML Research, gGmbH, University of Heidelberg, + and The University of Manchester. + All rights reserved. + + Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc. and EML Research, gGmbH. + All rights reserved. + All rights reserved. CQOptimizationWidget @@ -41,14 +65,14 @@ Expression - Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop false - + @@ -101,7 +125,7 @@ Subtask - Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter false @@ -121,10 +145,10 @@ - Qt::Orientation::Horizontal + Qt::Horizontal - QSizePolicy::Policy::Expanding + QSizePolicy::Expanding @@ -154,13 +178,6 @@ - - - - Display Population - - - @@ -252,8 +269,4 @@ - - slotPageIndexChange(int) - slotSubtaskChanged(QString) - diff --git a/copasi/UI/CQParameterOverviewWidget.cpp b/copasi/UI/CQParameterOverviewWidget.cpp index 4c106e0414..d6a8218247 100644 --- a/copasi/UI/CQParameterOverviewWidget.cpp +++ b/copasi/UI/CQParameterOverviewWidget.cpp @@ -399,11 +399,10 @@ void CQParameterOverviewWidget::slotBtnNew() if (answer == QMessageBox::Save) { // Save the parameter set to a new or existing set - pModel->refreshActiveParameterSet(); saveParameterSet(&pModel->getActiveModelParameterSet()); } - // We need to record all changes to the model + // TODO CRITICAL We need to record all changes to the model pSetToApply->updateModel(); // Notify the GUI that the model state has changed. diff --git a/copasi/UI/CQParameterSetsDM.cpp b/copasi/UI/CQParameterSetsDM.cpp index f91dce5bae..bb9d707db4 100644 --- a/copasi/UI/CQParameterSetsDM.cpp +++ b/copasi/UI/CQParameterSetsDM.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -189,7 +189,7 @@ bool CQParameterSetsDM::insertRows(int position, int rows, const QModelIndex & p while (pModel->getModelParameterSets().getIndex(TO_UTF8(Name)) != C_INVALID_INDEX) Name = QString("Parameter Set %1").arg(LocalTimeStamp().c_str()); - CModelParameterSet * pNew = new CModelParameterSet(pModel, NULL); + CModelParameterSet * pNew = new CModelParameterSet(pModel->getActiveModelParameterSet(), NULL, false); pNew->setObjectName(TO_UTF8(Name)); mpListOfParameterSets->add(pNew, true); ++mFetched; diff --git a/copasi/UI/CQParameterSetsWidget.cpp b/copasi/UI/CQParameterSetsWidget.cpp index 14759ce789..5ea06d936f 100644 --- a/copasi/UI/CQParameterSetsWidget.cpp +++ b/copasi/UI/CQParameterSetsWidget.cpp @@ -93,9 +93,9 @@ void CQParameterSetsWidget::slotBtnNewClicked() } } -void CQParameterSetsWidget::slotBtnDeleteClicked(bool needFocus) +void CQParameterSetsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblParameterSets->hasFocus()) + if (mpTblParameterSets->hasFocus()) {deleteSelected();} updateDeleteBtns(); @@ -273,7 +273,7 @@ void CQParameterSetsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQParameterSetsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblParameterSets->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQParameterSetsWidget.h b/copasi/UI/CQParameterSetsWidget.h index 54b99dbfc8..b9570d4e97 100644 --- a/copasi/UI/CQParameterSetsWidget.h +++ b/copasi/UI/CQParameterSetsWidget.h @@ -50,7 +50,7 @@ class CQParameterSetsWidget : public CopasiWidget, public Ui::CQParameterSetsWid protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQPlotsWidget.cpp b/copasi/UI/CQPlotsWidget.cpp index e2f3db4041..42d4cc8274 100644 --- a/copasi/UI/CQPlotsWidget.cpp +++ b/copasi/UI/CQPlotsWidget.cpp @@ -128,9 +128,9 @@ void CQPlotsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQPlotsWidget::slotBtnDeleteClicked(bool needFocus) +void CQPlotsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblPlots->hasFocus()) + if (mpTblPlots->hasFocus()) {deleteSelectedPlots();} updateDeleteBtns(); @@ -281,7 +281,7 @@ void CQPlotsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQPlotsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { diff --git a/copasi/UI/CQPlotsWidget.h b/copasi/UI/CQPlotsWidget.h index bc6304165c..ff73722261 100644 --- a/copasi/UI/CQPlotsWidget.h +++ b/copasi/UI/CQPlotsWidget.h @@ -55,7 +55,7 @@ class CQPlotsWidget : public CopasiWidget, public Ui::CQPlotsWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotBtnActivateAllClicked(); virtual void slotBtnDeactivateAllClicked(); diff --git a/copasi/UI/CQPreferenceDialog.cpp b/copasi/UI/CQPreferenceDialog.cpp index 619551c2ba..7b2f54bb2f 100644 --- a/copasi/UI/CQPreferenceDialog.cpp +++ b/copasi/UI/CQPreferenceDialog.cpp @@ -36,9 +36,6 @@ #define COL_NAME 0 #define COL_VALUE 1 - -#include - /* * Constructs a CQPreferenceDialog as a child of 'parent', with the * name 'name' and widget flags set to 'f'. @@ -71,133 +68,6 @@ CQPreferenceDialog::~CQPreferenceDialog() } } -#include -#include - -#include -#include -#include -#include -#include - - -void CQPreferenceDialog::slotPropertyChanged() -{ - auto widget = dynamic_cast(sender()); - if (widget == nullptr) - return; - - auto parameter = mWidgetToParameter[widget]; - if (parameter == nullptr) - return; - - if (auto edit = dynamic_cast(widget)) - { - parameter->setValue(edit->text().toStdString()); - } - else if (auto edit = dynamic_cast(widget)) - { - parameter->setValue(edit->isChecked()); - } - else if (auto edit = dynamic_cast(widget)) - { - parameter->setValue(parameter->getType() == CCopasiParameter::Type::UINT ? (unsigned int) edit->value() : edit->value()); - } -} - -void CQPreferenceDialog::initTabsFromSettings(QSettings& settings) -{ - // the ini file will have groups for each tab, each tab should - // have a form layout with the name of the setting as the key - // and the value as the value - - // first we create all the tabs - QStringList groups = settings.childGroups(); - - mWidgetToParameter.clear(); - - for (auto mainGroup : groups) - { - settings.beginGroup(mainGroup); - auto tab = new QWidget(); - auto layout = new QFormLayout(tab); - layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - tab->setLayout(layout); - tabWidget->insertTab(0, tab, mainGroup); - - // each group has child elements with keys: - // - name: the name of the setting - // - type: the type of the setting - // - parameter: the parameter of the COPASI setting to change - // - tooltip: the tooltip of the setting - // - value: the value of the setting - - QStringList childGroups = settings.childGroups(); - for (auto group : childGroups) - { - settings.beginGroup(group); - auto name = settings.value("name").toString(); - auto type = settings.value("type").toString(); - auto parameter = settings.value("parameter").toString(); - auto value = settings.value("value"); - - auto param_path = parameter.split("."); - CCopasiParameter * pNode = mpConfiguration; - for (auto paramName : param_path) - if (pNode && dynamic_cast< CCopasiParameterGroup * >(pNode)) - pNode = dynamic_cast< CCopasiParameterGroup * >(pNode)->getParameter(paramName.toStdString()); - - auto tooltip = settings.value("tooltip").toString(); - - if (type == "string") - { - auto edit = new QLineEdit(value.toString()); - edit->setToolTip(tooltip); - - if (pNode) - edit->setText(FROM_UTF8(pNode->getValue())); - layout->addRow(name, edit); - connect(edit, &QLineEdit::textChanged, this, &CQPreferenceDialog::slotPropertyChanged); - mWidgetToParameter[edit] = pNode; - } - else if (type == "bool") - { - auto edit = new QCheckBox(name); - edit->setChecked(value.toBool()); - if (pNode) - edit->setChecked(pNode->getValue< bool >()); - edit->setToolTip(tooltip); - layout->addRow(edit); - - connect(edit, &QCheckBox::stateChanged, this, &CQPreferenceDialog::slotPropertyChanged); - mWidgetToParameter[edit] = pNode; - } - else if (type == "int") - { - auto edit = new QSpinBox(); - edit->setToolTip(tooltip); - edit->setValue(value.toInt()); - if (pNode) - edit->setValue(pNode->getValue< int >()); - layout->addRow(name, edit); - - connect(edit, QOverload::of(&QSpinBox::valueChanged), this, &CQPreferenceDialog::slotPropertyChanged); - mWidgetToParameter[edit] = pNode; - } - else - { - CQMessageBox::warning(this, "Error", "Unknown type: " + type); - } - - settings.endGroup(); - } - - settings.endGroup(); - } - - tabWidget->setCurrentIndex(0); -} - void CQPreferenceDialog::init() { CConfigurationFile * pConfigFile = CRootContainer::getConfiguration(); @@ -209,32 +79,6 @@ void CQPreferenceDialog::init() mpTreeView->setAdvanced(false); mpTreeView->pushGroup(mpConfiguration); - - - // initialize other tabs from config file - auto copasiDir = COptions::getConfigDir(); - auto preferenceConfigFile = copasiDir + "/preferences.ini"; - if (!CDirEntry::exist(preferenceConfigFile)) - { - // load default preference.ini from resource - Q_INIT_RESOURCE(copasi); - - QFile file(":/preferences.ini"); - if (file.open(QIODevice::ReadOnly)) - { - QFile outFile(FROM_UTF8(preferenceConfigFile)); - if (outFile.open(QIODevice::WriteOnly)) - { - outFile.write(file.readAll()); - outFile.close(); - } - file.close(); - } - } - - - QSettings settings(preferenceConfigFile.c_str(), QSettings::IniFormat, this); - initTabsFromSettings(settings); } void CQPreferenceDialog::slotBtnOk() diff --git a/copasi/UI/CQPreferenceDialog.h b/copasi/UI/CQPreferenceDialog.h index ce67d9297a..b6e87195cb 100644 --- a/copasi/UI/CQPreferenceDialog.h +++ b/copasi/UI/CQPreferenceDialog.h @@ -27,11 +27,7 @@ #include "copasi/UI/ui_CQPreferenceDialog.h" -#include -#include - class CConfigurationFile; -class CCopasiParameter; class CQPreferenceDialog : public QDialog, public Ui::CQPreferenceDialog { @@ -43,19 +39,15 @@ class CQPreferenceDialog : public QDialog, public Ui::CQPreferenceDialog private: void init(); - void initTabsFromSettings(QSettings& settings); - protected slots: private slots: virtual void slotBtnOk(); virtual void slotBtnCancel(); - virtual void slotPropertyChanged(); private: CConfigurationFile * mpConfiguration; - std::map mWidgetToParameter; }; #endif // CQPREFERENCEDIALOG_H diff --git a/copasi/UI/CQPreferenceDialog.ui b/copasi/UI/CQPreferenceDialog.ui index ababa576eb..cf58ae8025 100644 --- a/copasi/UI/CQPreferenceDialog.ui +++ b/copasi/UI/CQPreferenceDialog.ui @@ -1,5 +1,29 @@ + Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the + University of Virginia, University of Heidelberg, and University + of Connecticut School of Medicine. + All rights reserved. + + Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc., University of Heidelberg, and University of + of Connecticut School of Medicine. + All rights reserved. + + Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc., University of Heidelberg, and The University + of Manchester. + All rights reserved. + + Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc., EML Research, gGmbH, University of Heidelberg, + and The University of Manchester. + All rights reserved. + + Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual + Properties, Inc. and EML Research, gGmbH. + All rights reserved. + All rights reserved. CQPreferenceDialog @@ -7,8 +31,8 @@ 0 0 - 797 - 557 + 452 + 346 @@ -17,34 +41,20 @@ true - - - - - 0 - - - - All Setttings - - - - - - - - - + - Qt::Orientation::Horizontal + Qt::Horizontal - QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + @@ -90,8 +100,8 @@ - - slotBtnOk() - slotBtnCancel() - + + slotBtnOk() + slotBtnCancel() + diff --git a/copasi/UI/CQReactionsWidget.cpp b/copasi/UI/CQReactionsWidget.cpp index 8931cdbbca..9ca46b8288 100644 --- a/copasi/UI/CQReactionsWidget.cpp +++ b/copasi/UI/CQReactionsWidget.cpp @@ -97,9 +97,9 @@ void CQReactionsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQReactionsWidget::slotBtnDeleteClicked(bool needFocus) +void CQReactionsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblReactions->hasFocus()) + if (mpTblReactions->hasFocus()) {deleteSelectedReactions();} updateDeleteBtns(); @@ -236,7 +236,7 @@ void CQReactionsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQReactionsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblReactions->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQReactionsWidget.h b/copasi/UI/CQReactionsWidget.h index 03767e8777..79ee87d555 100644 --- a/copasi/UI/CQReactionsWidget.h +++ b/copasi/UI/CQReactionsWidget.h @@ -57,7 +57,7 @@ class CQReactionsWidget : public CopasiWidget, public Ui::CQReactionsWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQReportsWidget.cpp b/copasi/UI/CQReportsWidget.cpp index 1d28bf6a02..c981f3cf50 100644 --- a/copasi/UI/CQReportsWidget.cpp +++ b/copasi/UI/CQReportsWidget.cpp @@ -84,9 +84,9 @@ void CQReportsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQReportsWidget::slotBtnDeleteClicked(bool needFocus) +void CQReportsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblReports->hasFocus()) + if (mpTblReports->hasFocus()) {deleteSelectedReports();} updateDeleteBtns(); @@ -235,7 +235,7 @@ void CQReportsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQReportsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblReports->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQReportsWidget.h b/copasi/UI/CQReportsWidget.h index 7426256476..d11a42a41d 100644 --- a/copasi/UI/CQReportsWidget.h +++ b/copasi/UI/CQReportsWidget.h @@ -55,7 +55,7 @@ class CQReportsWidget : public CopasiWidget, public Ui::CQReportsWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQSBMLFileDialog.cpp b/copasi/UI/CQSBMLFileDialog.cpp index 8c35a134b8..bddb3ec92b 100644 --- a/copasi/UI/CQSBMLFileDialog.cpp +++ b/copasi/UI/CQSBMLFileDialog.cpp @@ -46,8 +46,7 @@ std::pair< QString, std::pair< unsigned C_INT32, unsigned C_INT32 > > CQSBMLFile "Level 2 Version 3 (*.xml);;" "Level 2 Version 4 (*.xml);;" "Level 2 Version 5 (*.xml);;" - "Level 3 Version 1 (*.xml);;" - "Level 3 Version 2 (*.xml)"; + "Level 3 Version 1 (*.xml)"; QString SelectedFilter = QString("Level %1 Version %2 (*.xml)").arg(QString::number(sbmlLevel)).arg(QString::number(sbmlVersion));; diff --git a/copasi/UI/CQSpeciesWidget.cpp b/copasi/UI/CQSpeciesWidget.cpp index 57700530ce..5f26fa8297 100644 --- a/copasi/UI/CQSpeciesWidget.cpp +++ b/copasi/UI/CQSpeciesWidget.cpp @@ -104,9 +104,9 @@ void CQSpeciesWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQSpeciesWidget::slotBtnDeleteClicked(bool needFocus) +void CQSpeciesWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblSpecies->hasFocus()) + if (mpTblSpecies->hasFocus()) {deleteSelectedSpecies();} updateDeleteBtns(); @@ -264,7 +264,7 @@ void CQSpeciesWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQSpeciesWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblSpecies->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQSpeciesWidget.h b/copasi/UI/CQSpeciesWidget.h index f5d4419304..58c58201de 100644 --- a/copasi/UI/CQSpeciesWidget.h +++ b/copasi/UI/CQSpeciesWidget.h @@ -62,7 +62,7 @@ class CQSpeciesWidget : public CopasiWidget, public Ui::CQSpeciesWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQUnitsWidget.cpp b/copasi/UI/CQUnitsWidget.cpp index bddac5d122..1e0dd8c0d4 100644 --- a/copasi/UI/CQUnitsWidget.cpp +++ b/copasi/UI/CQUnitsWidget.cpp @@ -89,9 +89,9 @@ void CQUnitsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQUnitsWidget::slotBtnDeleteClicked(bool needFocus) +void CQUnitsWidget::slotBtnDeleteClicked() { - if (!needFocus || mpTblUnits->hasFocus()) + if (mpTblUnits->hasFocus()) {deleteSelectedUnits();} updateDeleteBtns(); @@ -251,7 +251,7 @@ void CQUnitsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQUnitsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(true); + slotBtnDeleteClicked(); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { QModelIndexList selRows = mpTblUnits->selectionModel()->selectedRows(0); diff --git a/copasi/UI/CQUnitsWidget.h b/copasi/UI/CQUnitsWidget.h index baa14d7994..e1f6fdc6b7 100644 --- a/copasi/UI/CQUnitsWidget.h +++ b/copasi/UI/CQUnitsWidget.h @@ -50,7 +50,7 @@ class CQUnitsWidget : public CopasiWidget, public Ui::CQUnitsWidget protected slots: virtual void slotBtnNewClicked(); - virtual void slotBtnDeleteClicked(bool needFocus=false); + virtual void slotBtnDeleteClicked(); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/FunctionWidget1.cpp b/copasi/UI/FunctionWidget1.cpp index 3331da092e..76c15b67f2 100644 --- a/copasi/UI/FunctionWidget1.cpp +++ b/copasi/UI/FunctionWidget1.cpp @@ -36,8 +36,6 @@ #include "copasi/core/CRootContainer.h" #include "copasi/model/CMetab.h" #include "copasi/model/CModel.h" -#include -#include #include "copasi/utilities/CCopasiException.h" #include "copasi/function/CFunction.h" #include "copasi/function/CFunctionDB.h" @@ -783,7 +781,6 @@ void FunctionWidget1::slotBtnCopy() mObjectCNToCopy = mObjectCN; } - //! Slot for being activated whenever Delete button is clicked void FunctionWidget1::slotBtnDelete() { @@ -807,36 +804,6 @@ void FunctionWidget1::slotBtnDelete() { case QMessageBox::Ok: // Yes or Enter { - - bool dataAppended = false; - - CDataObject::DataObjectSet dependentReactions; - CDataObject::DataObjectSet dependentMetabolites; - CDataObject::DataObjectSet dependentCompartments; - CDataObject::DataObjectSet dependentModelValues; - CDataObject::DataObjectSet dependentEvents; - CDataObject::DataObjectSet dependentEventAssignments; - - dataAppended |= mpDataModel->getModel()->appendAllDependents(*pFunction, - dependentReactions, - dependentMetabolites, - dependentCompartments, - dependentModelValues, - dependentEvents, - dependentEventAssignments); - - if (dataAppended && !dependentReactions.empty()) - { - for (auto* reactionDo : dependentReactions) - { - CReaction* r = const_cast(dynamic_cast< const CReaction * >(reactionDo)); - if (r) - r->setFunction(NULL); - - } - } - - CRootContainer::getFunctionList()->loadedFunctions().remove(mpObject->getObjectName()); protectedNotify(ListViews::ObjectType::FUNCTION, ListViews::DELETE, mObjectCN); diff --git a/copasi/UI/TaskWidget.cpp b/copasi/UI/TaskWidget.cpp index 367fefcdc1..1e0af93ab9 100644 --- a/copasi/UI/TaskWidget.cpp +++ b/copasi/UI/TaskWidget.cpp @@ -47,7 +47,6 @@ #include "CQOptPopulation.h" #include "copasi/utilities/CCopasiTask.h" -#include "copasi/utilities/CCopasiProblem.h" #include "copasi/utilities/CCopasiMethod.h" #include "copasi/utilities/CCopasiException.h" #include "copasi/output/COutputHandler.h" @@ -64,7 +63,6 @@ #include "copasi/core/CRootContainer.h" #include "copasi/commandline/CConfigurationFile.h" #include "copasi/utilities/CMethodFactory.h" -#include "copasi/utilities/CCopasiParameter.h" /* * Constructs a TaskWidget which is a child of 'parent', with the @@ -283,7 +281,7 @@ bool TaskWidget::commonBeforeRunTask() CCopasiMessage::clearDeque(); // create population display if needed - if (mpTask->getProblem()->getParameter("DisplayPoplations") && mpTask->getProblem()->getParameter("DisplayPoplations")->getValue< bool >()) + if (CRootContainer::getConfiguration()->displayPopulations()) { if (dynamic_cast(mpTask) != NULL || dynamic_cast(mpTask) != NULL) @@ -309,7 +307,7 @@ bool TaskWidget::commonAfterRunTask() { if (!mpTask) return false; - if (mpTask->getProblem()->getParameter("DisplayPoplations") && mpTask->getProblem()->getParameter("DisplayPoplations")->getValue()) + if (CRootContainer::getConfiguration()->displayPopulations()) { if (dynamic_cast(mpTask) != NULL || dynamic_cast(mpTask) != NULL) diff --git a/copasi/UI/copasiui3window.cpp b/copasi/UI/copasiui3window.cpp index 256363e8cd..4b4c743fc7 100644 --- a/copasi/UI/copasiui3window.cpp +++ b/copasi/UI/copasiui3window.cpp @@ -38,8 +38,6 @@ #include #include #include -#include - #include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) @@ -89,7 +87,6 @@ #include "copasi/model/CModelExpansion.h" #include "copasi/UI/CQCheckModelWindow.h" #include -#include #include "copasi/model/CModelExpansion.h" @@ -117,9 +114,6 @@ #include -#include -#include - #include #define AutoSaveInterval 10*60*1000 @@ -352,8 +346,6 @@ CopasiUI3Window::CopasiUI3Window(): , mpPopulationDisplay(NULL) , mAutoUpdateCheck(false) , mActionStack() - , mpaShowExternalToolDialog(NULL) - , mpExternaltools(new CQExternalTools) { // There can only be one pMainWindow = this; @@ -423,8 +415,6 @@ CopasiUI3Window::CopasiUI3Window(): QTimer::singleShot(10, this, SLOT(slotAutoCheckForUpdates())); connect(this, SIGNAL(signalDefferedLoadFile(QString)), this, SLOT(slotDefferedLoadFile(QString))); - - mpExternaltools->init(mpTools, mpaShowExternalToolDialog); } CopasiUI3Window::~CopasiUI3Window() @@ -455,7 +445,6 @@ CopasiUI3Window::~CopasiUI3Window() mpDataModelGUI->deregisterListView(mpListView); pdelete(mpDataModelGUI); pdelete(mpListView); - pdelete(mpExternaltools); } void CopasiUI3Window::createActions() @@ -591,9 +580,6 @@ void CopasiUI3Window::createActions() #endif mpaParameterEstimationResult = new QAction("Load Parameter Estimation Protocol", this); connect(mpaParameterEstimationResult, SIGNAL(triggered()), this, SLOT(slotLoadParameterEstimationProtocol())); - - mpaShowExternalToolDialog = new QAction("External Tools...", this); - connect(mpaShowExternalToolDialog, &QAction::triggered, this, &CopasiUI3Window::slotConfigureExternalTools); } void @@ -750,12 +736,6 @@ void CopasiUI3Window::createMenuBar() { QMenu *pFileMenu = menuBar()->addMenu("&File"); pFileMenu->addAction(mpaNew); - #ifdef Q_OS_MACOS - QAction *pOpenNewWindow = new QAction("New Window", this); - pOpenNewWindow->setToolTip("Open a new COPASI instance"); - QObject::connect(pOpenNewWindow, SIGNAL(triggered()), this, SLOT(slotStartNewInstance())); - pFileMenu->addAction(pOpenNewWindow); - #endif pFileMenu->addAction(mpaOpen); pFileMenu->addAction(mpaOpenFromUrl); mpMenuExamples = pFileMenu->addMenu("Examples"); @@ -838,7 +818,6 @@ void CopasiUI3Window::createMenuBar() mpTools->addAction("&Convert to irreversible", this, SLOT(slotConvertToIrreversible())); mpTools->addAction("Convert ODEs -> Reactions", this, SLOT(slotConvertODEsToReactions())); mpTools->addAction("Convert Reactions -> ODEs", this, SLOT(slotConvertReactionsToODEs())); - mpTools->addAction("Convert local to global Parmeters", this, SLOT(slotPromoteLocalParameters())); mpTools->addAction("Create &Events For Timeseries Experiment", this, SLOT(slotCreateEventsForTimeseries())); mpTools->addAction("&Remove SBML Ids from model", this, SLOT(slotClearSbmlIds())); mpTools->addAction(mpaParameterEstimationResult); @@ -848,8 +827,6 @@ void CopasiUI3Window::createMenuBar() mpSBWAction = mpTools->addMenu(mpSBWMenu); #endif // COPASI_SBW_INTEGRATION mpTools->addSeparator(); - mpTools->addAction(mpaShowExternalToolDialog); - mpTools->addSeparator(); mpTools->addAction(mpaUpdateMIRIAM); mpTools->addAction("&Preferences", this, SLOT(slotPreferences())); mpTools->addAction(mpaFontSelectionDialog); @@ -2095,41 +2072,6 @@ void CopasiUI3Window::slotConvertReactionsToODEs() mpListView->resetCache(); } -void CopasiUI3Window::slotPromoteLocalParameters() -{ - assert(mpDataModel != NULL); - CModel * pModel = mpDataModel->getModel(); - - if (!pModel) - return; - - mpDataModelGUI->commit(); - mpDataModelGUI->notify(ListViews::ObjectType::MODEL, ListViews::DELETE, - mpDataModel->getModel()->getCN()); - mpListView->clearCurrentWidget(); - mpListView->switchToOtherWidget(ListViews::WidgetType::COPASI, CRegisteredCommonName()); - mpListView->resetCache(); - - if (this->mpSliders) - this->mpSliders->reset(); - - CCopasiMessage::clearDeque(); - - if (!mpDataModel->convertParametersToGlobal()) - { - // Display error messages. - CQMessageBox::information(this, "Conversion Failed", - CCopasiMessage::getAllMessageText().c_str(), - QMessageBox::Ok | QMessageBox::Default, - QMessageBox::NoButton); - CCopasiMessage::clearDeque(); - } - - mpDataModel->changed(); - mpDataModelGUI->notify(ListViews::ObjectType::MODEL, ListViews::ADD, CRegisteredCommonName()); - mpListView->resetCache(); -} - void CopasiUI3Window::slotShowSliders(bool flag) { mpaSliders->setChecked(flag); @@ -3941,18 +3883,6 @@ void CopasiUI3Window::slotFileOpenFromUrl(QString url) mpDataModelGUI->downloadFileFromUrl(TO_UTF8(url), TmpFileName); } -void CopasiUI3Window::slotConfigureExternalTools() -{ - CQExternalToolDialog dlg; - dlg.init(mpExternaltools); - if (dlg.exec() == QDialog::Accepted) - { - dlg.saveTools(true); - mpExternaltools->init(mpTools, mpaShowExternalToolDialog); - } - -} - void CopasiUI3Window::activateElement(const std::string& activate) { // resolve display name first @@ -4216,11 +4146,6 @@ void CopasiUI3Window::slotHandleCopasiScheme(const QUrl& url) #endif } -void CopasiUI3Window::slotStartNewInstance() -{ - QProcess::startDetached(qApp->applicationFilePath()); -} - void CopasiUI3Window::slotCheckForUpdate() { #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) diff --git a/copasi/UI/copasiui3window.h b/copasi/UI/copasiui3window.h index 1aeb6e91a9..c59392904f 100644 --- a/copasi/UI/copasiui3window.h +++ b/copasi/UI/copasiui3window.h @@ -79,7 +79,6 @@ class CModelVersionHierarchy; class CQOptPopulation; class CDataModel; class CUndoStack; -class CQExternalTools; enum CopasiUIActions { @@ -202,12 +201,8 @@ public slots: void slotFileOpen(QString file = QString()); void slotFileOpenFromUrl(QString url = QString()); - void slotConfigureExternalTools(); - void slotHandleCopasiScheme(const QUrl& url); - void slotStartNewInstance(); - public: /** * performs the next action from the action stack @@ -261,7 +256,6 @@ protected slots: void slotConvertToIrreversible(); void slotConvertODEsToReactions(); void slotConvertReactionsToODEs(); - void slotPromoteLocalParameters(); void slotCreateEventsForTimeseries(); void listViewsFolderChanged(const QModelIndex & index); @@ -501,11 +495,6 @@ protected slots: std::deque< std::pair < CopasiUIActions, std::string > > mActionStack; - QAction * mpaShowExternalToolDialog; - - - CQExternalTools * mpExternaltools; - #ifdef COPASI_SBW_INTEGRATION public: /** diff --git a/copasi/bindings/common/downcast_common.cpp b/copasi/bindings/common/downcast_common.cpp index f649328470..d357f8bc27 100644 --- a/copasi/bindings/common/downcast_common.cpp +++ b/copasi/bindings/common/downcast_common.cpp @@ -418,10 +418,7 @@ GetDowncastSwigTypeForMethod(CCopasiMethod* method) { pInfo = SWIGTYPE_p_CSensMethod; } - else if (dynamic_cast(method)) - { - pInfo = SWIGTYPE_p_CLNAMethod; - } + return pInfo; } @@ -558,10 +555,6 @@ GetDowncastSwigTypeForProblem(CCopasiProblem* problem) { pInfo = GetDowncastSwigTypeForCOptProblem(static_cast(problem)); } - else if (dynamic_cast(problem)) - { - pInfo = SWIGTYPE_p_CTimeSensProblem; - } else if (dynamic_cast(problem)) { pInfo = SWIGTYPE_p_CTrajectoryProblem; @@ -616,10 +609,6 @@ GetDowncastSwigTypeForTask(CCopasiTask* task) { pInfo = SWIGTYPE_p_CLNATask; } - else if (dynamic_cast(task)) - { - pInfo = SWIGTYPE_p_CTimeSensTask; - } else if (dynamic_cast(task)) { pInfo = SWIGTYPE_p_CTrajectoryTask; diff --git a/copasi/bindings/csharp/CMakeLists.txt b/copasi/bindings/csharp/CMakeLists.txt index da801c806e..59b7e27acb 100644 --- a/copasi/bindings/csharp/CMakeLists.txt +++ b/copasi/bindings/csharp/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the # University of Virginia, University of Heidelberg, and University # of Connecticut School of Medicine. # All rights reserved. @@ -157,12 +157,6 @@ add_custom_target(binding_csharp_swig DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/csharp include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -if (MSVC) - # the build fails when compiled with packages as the object file is too - # big adding the big flag makes it work! - add_definitions(/bigobj) -endif(MSVC) - add_library(binding_csharp_native_lib SHARED ${CMAKE_CURRENT_BINARY_DIR}/copasi_wrapper.cpp) add_dependencies(binding_csharp_native_lib binding_csharp_swig) diff --git a/copasi/bindings/csharp/local.cpp b/copasi/bindings/csharp/local.cpp index 74be0cecd4..70b1d63935 100644 --- a/copasi/bindings/csharp/local.cpp +++ b/copasi/bindings/csharp/local.cpp @@ -39,9 +39,6 @@ #include #include -#include - - // Now we specify the definitions // for the type determination methods diff --git a/copasi/bindings/swig/CCopasiTask.i b/copasi/bindings/swig/CCopasiTask.i index b6ac0bdf67..0f6d779fc9 100644 --- a/copasi/bindings/swig/CCopasiTask.i +++ b/copasi/bindings/swig/CCopasiTask.i @@ -70,10 +70,8 @@ %warnfilter(325) CDescription; %warnfilter(325) CResult; -#if (!defined SWIGJAVA) %template(TaskSubTypeVector) std::vector; %template(MethodSubTypeVector) std::vector; -#endif %include "copasi/utilities/CTaskEnum.h" %include "copasi/utilities/CCopasiTask.h" diff --git a/copasi/bindings/swig/CDataObject.i b/copasi/bindings/swig/CDataObject.i index 9bf90e30ab..952afdf3bb 100644 --- a/copasi/bindings/swig/CDataObject.i +++ b/copasi/bindings/swig/CDataObject.i @@ -116,9 +116,7 @@ namespace std { #if !defined(SWIGR) && !defined(SWIGPERL) && !defined(SWIGOCTAVE) %template(DataObjectSet) set< const CDataObject * >; -#if (!defined SWIGJAVA) %template(DataObjectMap) map< const CDataObject *, const CDataObject * >; -#endif %template(DataObjectVector) vector< const CDataObject * >; %template(VectorOfDataObjectVector) vector< vector< const CDataObject * > >; #endif // !defined(SWIGR) && !defined(SWIGPERL) && !defined(SWIGOCTAVE) diff --git a/copasi/bindings/swig/CDataVector.i b/copasi/bindings/swig/CDataVector.i index 396f4749f5..c58f665f6b 100644 --- a/copasi/bindings/swig/CDataVector.i +++ b/copasi/bindings/swig/CDataVector.i @@ -361,9 +361,7 @@ %template(ReferenceVector) CDataVector; %template(ModificationVector) CDataVector; -#if (!defined SWIGJAVA) %template(ObjectListTypeStdVector) std::vector; -#endif typedef CDataVectorN EventVectorN; diff --git a/copasi/bindings/swig/CModel.i b/copasi/bindings/swig/CModel.i index 54e53dc90d..6dac6b86a7 100644 --- a/copasi/bindings/swig/CModel.i +++ b/copasi/bindings/swig/CModel.i @@ -49,12 +49,10 @@ %template(ObjectStdVector) std::vector; typedef std::vector ObjectStdVector; -#if (!defined SWIGJAVA) %template(StringUnitMap) std::map< std::string, CUnit >; typedef std::map< std::string, CUnit > StringUnitMap; %template(StringDoubleMap) std::map< std::string, double >; typedef std::map< std::string, double > StringDoubleMap; -#endif %ignore CUnit::getSymbolComponents; %ignore CUnit::SymbolComponent; diff --git a/copasi/bindings/swig/copasi.i b/copasi/bindings/swig/copasi.i index 6a9d8aa645..b170e7e6d8 100644 --- a/copasi/bindings/swig/copasi.i +++ b/copasi/bindings/swig/copasi.i @@ -78,7 +78,6 @@ LIBCOMBINE_CPP_NAMESPACE_USE #include "local.cpp" #include -#include /** * This method is used to get the C_INVALID_INDEX @@ -353,9 +352,6 @@ size_t INVALID_INDEX(); %include %include -%include -%include -%include %ignore COptMethodPS::COptMethodPS(const COptMethodPS&); %ignore COptMethodPS::COptMethodPS(const CDataContainer *); diff --git a/copasi/commandline/COptions.h b/copasi/commandline/COptions.h index 6ade83eb5a..70e5443196 100644 --- a/copasi/commandline/COptions.h +++ b/copasi/commandline/COptions.h @@ -39,7 +39,6 @@ #include "copasi/commandline/CLocaleString.h" - class COptions { class COptionValue @@ -154,14 +153,6 @@ class COptions static std::string getConfigDir(void); - static std::string getCopasiDir(void); - - static std::string getHome(void); - - static std::string getTemp(void); - - static std::string getConfigFile(void); - private: template< class CType > static void setValue(const std::string & name, const CType & value) @@ -174,7 +165,12 @@ class COptions return; } + static std::string getCopasiDir(void); + + static std::string getHome(void); + static std::string getTemp(void); + static std::string getConfigFile(void); }; #endif // COPASI_COptions diff --git a/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp b/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp index 2e6ca305c8..0c6ba24b35 100644 --- a/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp +++ b/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp @@ -546,7 +546,6 @@ CEvaluationNode* CEvaluationNodeNormalizer::normalizeCEvaluationNodeLogical(cons case CEvaluationNode::SubType::NE: case CEvaluationNode::SubType::LT: case CEvaluationNode::SubType::LE: - case CEvaluationNode::SubType::IMPLIES: pResult = new CEvaluationNodeLogical(pNode->subType(), pNode->getData()); pTmpResult = CEvaluationNodeNormalizer::normalize(dynamic_cast(pNode->getChild())); diff --git a/copasi/compareExpressions/ConvertToCEvaluationNode.cpp b/copasi/compareExpressions/ConvertToCEvaluationNode.cpp index c6f92c22a7..18873df4dc 100644 --- a/copasi/compareExpressions/ConvertToCEvaluationNode.cpp +++ b/copasi/compareExpressions/ConvertToCEvaluationNode.cpp @@ -2514,19 +2514,6 @@ CNormalLogical* createLogical(const CEvaluationNode* pNode) pResult = createLogical(pAndNode); delete pAndNode; break; - - case CEvaluationNode::SubType::IMPLIES: - // replace A implies B by NOT(A) OR B - pA = dynamic_cast< const CEvaluationNode * >(pNode->getChild()); - pB = dynamic_cast< const CEvaluationNode * >(pA->getSibling()); - pNotNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::NOT, "NOT"); - pNotNode->addChild(pA->copyBranch()); - pOrNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::OR, "OR"); - pOrNode->addChild(pNotNode); - pOrNode->addChild(pB->copyBranch()); - pResult = createLogical(pOrNode); - delete pOrNode; - break; case CEvaluationNode::SubType::AND: pLeftLogical = createLogical(dynamic_cast(pNode->getChild())); diff --git a/copasi/core/CFlags.h b/copasi/core/CFlags.h index 6f6ba0e84e..6a1950f9c5 100644 --- a/copasi/core/CFlags.h +++ b/copasi/core/CFlags.h @@ -110,7 +110,7 @@ template < class Enum > class CFlags : public std::bitset< static_cast< size_t > */ bool operator != (const CFlags< Enum > & rhs) const { - return !(bitset::operator == ((bitset) rhs)); + return bitset::operator != ((bitset) rhs); } /** diff --git a/copasi/function/CEvaluationLexer.lpp b/copasi/function/CEvaluationLexer.lpp index 37d8d7f34d..9208586ffa 100644 --- a/copasi/function/CEvaluationLexer.lpp +++ b/copasi/function/CEvaluationLexer.lpp @@ -162,14 +162,6 @@ ID (\"([^\\\"]|\\.)*\"|[a-z_A-Z][a-z_A-Z0-9]*) return TOKEN_LOGICAL_XOR; %} -"implies" %{ - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::IMPLIES, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_XOR; -%} - (or|OR|\|\|) %{ BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::OR, @@ -206,231 +198,231 @@ ID (\"([^\\\"]|\\.)*\"|[a-z_A-Z][a-z_A-Z0-9]*) mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (log10|LOG10)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG10, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (exp|EXP)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::EXP, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (sin|SIN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (cos|COS)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COS, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (tan|TAN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TAN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (sec|SEC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SEC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (csc|CSC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (cot|COT)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COT, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (sinh|SINH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SINH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (cosh|COSH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COSH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (tanh|TANH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TANH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (sech|SECH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SECH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (csch|CSCH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSCH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (coth|COTH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COTH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (asin|ASIN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSIN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (acos|ACOS)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOS, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (atan|ATAN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTAN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arcsec|ARCSEC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSEC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arccsc|ARCCSC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arccot|ARCCOT)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOT, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arcsinh|ARCSINH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSINH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arccosh|ARCCOSH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOSH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arctanh|ARCTANH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTANH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arcsech|ARCSECH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSECH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arccsch|ARCCSCH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSCH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (arccoth|ARCCOTH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOTH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (sign|SIGN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIGN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (sqrt|SQRT)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SQRT, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (abs|ABS)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ABS, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (floor|FLOOR)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FLOOR, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (ceil|CEIL)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CEIL, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (factorial|FACTORIAL)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FACTORIAL, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (uniform|UNIFORM)/\( %{ @@ -451,7 +443,7 @@ ID (\"([^\\\"]|\\.)*\"|[a-z_A-Z][a-z_A-Z0-9]*) mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RPOISSON, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_1; + return TOKEN_FUNCTION; %} (normal|NORMAL)/\( %{ @@ -465,14 +457,14 @@ ID (\"([^\\\"]|\\.)*\"|[a-z_A-Z][a-z_A-Z0-9]*) mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MAX, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_2; %} (min|MIN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MIN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_2; %} (delay|DELAY)/\( %{ @@ -565,14 +557,6 @@ ID (\"([^\\\"]|\\.)*\"|[a-z_A-Z][a-z_A-Z0-9]*) return TOKEN_OPERATOR_REMAINDER; %} -"quot" %{ - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::QUOTIENT, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_REMAINDER; -%} - "+" %{ BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::PLUS, diff --git a/copasi/function/CEvaluationLexer_lex.cpp b/copasi/function/CEvaluationLexer_lex.cpp index 1aa8fba2fe..aa1e072f1a 100644 --- a/copasi/function/CEvaluationLexer_lex.cpp +++ b/copasi/function/CEvaluationLexer_lex.cpp @@ -1,5 +1,28 @@ +// Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. -#line 3 "" +// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and University of +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and The University +// of Manchester. +// All rights reserved. + +// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., EML Research, gGmbH, University of Heidelberg, +// and The University of Manchester. +// All rights reserved. + +// Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc. and EML Research, gGmbH. +// All rights reserved. + +#line 2 "" #define YY_INT_ALIGNED short int @@ -8,18 +31,36 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif - /* The c++ scanner is a mess. The FlexLexer.h header file relies on the - * following macro. This is required in order to pass the c++-multiple-scanners - * test in the regression suite. We get reports that it breaks inheritance. - * We will address this in a future release of flex, or omit the C++ scanner - * altogether. - */ - #define yyFlexLexer CEvaluationFlexLexer +/* The c++ scanner is a mess. The FlexLexer.h header file relies on the + * following macro. This is required in order to pass the c++-multiple-scanners + * test in the regression suite. We get reports that it breaks inheritance. + * We will address this in a future release of flex, or omit the C++ scanner + * altogether. + */ +#define yyFlexLexer CEvaluationFlexLexer + +#ifdef yyalloc +#define CEvaluationalloc_ALREADY_DEFINED +#else +#define yyalloc CEvaluationalloc +#endif + +#ifdef yyrealloc +#define CEvaluationrealloc_ALREADY_DEFINED +#else +#define yyrealloc CEvaluationrealloc +#endif + +#ifdef yyfree +#define CEvaluationfree_ALREADY_DEFINED +#else +#define yyfree CEvaluationfree +#endif /* First, we deal with platform-specific or compiler-specific issues. */ @@ -37,7 +78,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -54,7 +95,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -87,12 +128,16 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ -#include +#include #include #include #include @@ -111,32 +156,26 @@ typedef unsigned int flex_uint32_t; /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - +#define YY_NEW_FILE yyrestart(yyin) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -172,89 +211,87 @@ extern int yyleng; #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yy_size_t yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) + do \ + {\ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while (0) +#define unput(c) yyunput(c, (yytext_ptr)) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state - { - - std::streambuf* yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; +{ + + std::streambuf* yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - - }; +}; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* We provide macros for accessing buffer states in case in the @@ -263,46 +300,41 @@ struct yy_buffer_state * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - +#define YY_CURRENT_BUFFER ((yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -void *CEvaluationalloc (yy_size_t ); -void *CEvaluationrealloc (void *,yy_size_t ); -void CEvaluationfree (void * ); +void *yyalloc(yy_size_t); +void *yyrealloc(void *, yy_size_t); +void yyfree(void *); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ + {\ + if (! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ + {\ + if (! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; #define yytext_ptr yytext @@ -312,421 +344,418 @@ typedef unsigned char YY_CHAR; * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 83 -#define YY_END_OF_BUFFER 84 + (yytext_ptr) = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; +#define YY_NUM_RULES 81 +#define YY_END_OF_BUFFER 82 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[402] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84, 82, - 81, 81, 8, 82, 75, 78, 66, 77, 65, 1, - 1, 82, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 82, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 76, 79, 82, 70, 82, 68, 73, 74, - 69, 10, 82, 12, 82, 82, 82, 82, 82, 82, - 82, 67, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 80, 80, 81, 0, 80, 0, 1, - 1, 0, 0, 0, 20, 0, 64, 80, 80, 80, - - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 3, 80, - 80, 80, 80, 80, 80, 80, 0, 0, 19, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 13, 15, 9, 14, 11, - 0, 12, 10, 18, 0, 0, 0, 0, 0, 0, - 80, 80, 1, 0, 1, 21, 63, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 62, 80, 80, 80, 80, 7, 80, 8, - - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 16, 0, 71, 0, 51, 80, 80, - 80, 80, 80, 80, 80, 26, 80, 30, 80, 29, - 80, 80, 24, 80, 80, 80, 80, 80, 80, 22, - 80, 59, 60, 80, 80, 28, 80, 80, 25, 80, - 80, 27, 80, 4, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, - 72, 38, 80, 80, 80, 80, 80, 37, 39, 53, - - 32, 36, 35, 80, 80, 80, 5, 80, 80, 80, - 80, 80, 80, 34, 49, 31, 50, 33, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 0, 80, 80, 80, 80, 80, 80, 61, 80, 80, - 52, 56, 80, 23, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 0, 80, - 42, 80, 41, 80, 40, 80, 80, 80, 80, 80, - 80, 58, 80, 80, 80, 80, 80, 17, 44, 48, - 47, 46, 43, 45, 80, 80, 6, 57, 55, 80, - 80, 80, 80, 80, 80, 54, 80, 80, 80, 2, - - 0 - } ; - -static yyconst YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 1, 1, 6, 7, 1, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 1, 1, 19, - 20, 21, 1, 1, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 31, 31, 42, 43, 31, - 44, 45, 46, 47, 31, 1, 48, 49, 50, 51, - - 52, 53, 54, 55, 56, 31, 31, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 31, 31, 67, - 68, 31, 69, 70, 71, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst YY_CHAR yy_meta[72] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 1, 1, 1, 1, 3, 3, 3, - 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, - 1 - } ; - -static yyconst flex_uint16_t yy_base[407] = - { 0, - 0, 0, 0, 0, 71, 0, 139, 140, 839, 840, - 143, 145, 840, 144, 840, 840, 840, 840, 840, 140, - 145, 134, 162, 830, 152, 156, 161, 172, 159, 182, - 160, 188, 197, 176, 200, 205, 180, 130, 175, 169, - 204, 164, 207, 209, 212, 185, 214, 215, 220, 226, - 233, 227, 840, 840, 817, 840, 829, 840, 840, 840, - 840, 815, 814, 813, 798, 794, 210, 218, 804, 791, - 793, 840, 768, 764, 194, 767, 195, 764, 771, 759, - 755, 760, 749, 244, 241, 251, 246, 810, 814, 251, - 276, 293, 0, 227, 840, 813, 806, 806, 234, 277, - - 275, 287, 276, 289, 292, 297, 305, 279, 306, 299, - 300, 805, 308, 312, 310, 314, 315, 316, 804, 317, - 318, 331, 319, 321, 328, 333, 298, 808, 840, 337, - 338, 342, 343, 345, 350, 352, 353, 354, 358, 363, - 362, 356, 359, 364, 360, 365, 366, 367, 370, 371, - 369, 368, 374, 372, 373, 840, 840, 840, 840, 840, - 785, 840, 840, 840, 771, 757, 746, 755, 745, 741, - 377, 376, 418, 370, 373, 0, 840, 795, 401, 429, - 433, 437, 375, 434, 435, 443, 386, 438, 439, 441, - 440, 444, 793, 446, 387, 793, 792, 791, 448, 790, - - 447, 449, 450, 453, 451, 454, 466, 458, 442, 452, - 479, 480, 457, 481, 482, 485, 486, 487, 488, 490, - 489, 492, 495, 388, 497, 493, 491, 499, 501, 496, - 504, 500, 507, 840, 740, 840, 731, 786, 786, 527, - 502, 503, 785, 784, 783, 781, 781, 779, 779, 777, - 777, 505, 775, 510, 533, 516, 525, 521, 511, 774, - 394, 773, 772, 556, 557, 771, 771, 770, 768, 768, - 767, 765, 765, 764, 559, 512, 518, 523, 513, 514, - 515, 561, 519, 569, 571, 572, 575, 522, 576, 715, - 840, 761, 579, 577, 581, 582, 587, 760, 759, 758, - - 757, 756, 755, 755, 583, 584, 754, 753, 752, 585, - 751, 592, 590, 749, 748, 747, 746, 745, 589, 591, - 594, 595, 598, 599, 596, 600, 603, 604, 602, 606, - 701, 612, 618, 620, 621, 623, 624, 743, 626, 634, - 742, 728, 625, 726, 726, 632, 635, 627, 629, 630, - 631, 638, 643, 646, 659, 662, 663, 665, 668, 721, - 717, 717, 715, 713, 711, 711, 710, 708, 664, 666, - 667, 705, 705, 701, 668, 669, 670, 840, 699, 697, - 693, 691, 690, 688, 671, 675, 688, 686, 391, 672, - 673, 681, 389, 683, 679, 265, 682, 686, 684, 253, - - 840, 739, 742, 744, 747, 162 - } ; - -static yyconst flex_int16_t yy_def[407] = - { 0, - 401, 1, 1, 1, 401, 5, 1, 1, 401, 401, - 401, 401, 401, 402, 401, 401, 401, 401, 401, 401, - 401, 403, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 405, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 404, 404, 401, 402, 401, 402, 401, - 401, 401, 406, 403, 401, 403, 401, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 405, 405, 401, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 404, 404, 401, 401, 401, 406, 401, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 401, 404, 404, 404, 404, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 401, 401, 401, 401, 401, 404, 404, - 404, 404, 404, 404, 404, 401, 404, 401, 404, 401, - 404, 404, 401, 404, 404, 404, 404, 404, 404, 401, - 404, 401, 401, 404, 404, 401, 404, 404, 401, 404, - 404, 401, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 401, - 401, 401, 404, 404, 404, 404, 404, 401, 401, 401, - - 401, 401, 401, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 401, 401, 401, 401, 401, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 401, 404, 404, 404, 404, 404, 404, 401, 404, 404, - 401, 401, 404, 401, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 401, 404, - 401, 404, 401, 404, 401, 404, 404, 404, 404, 404, - 404, 401, 404, 404, 404, 404, 404, 401, 401, 401, - 401, 401, 401, 401, 404, 404, 404, 401, 401, 404, - 404, 404, 404, 404, 404, 401, 404, 404, 404, 404, - - 0, 401, 401, 401, 401, 401 - } ; - -static yyconst flex_uint16_t yy_nxt[912] = - { 0, - 10, 11, 12, 13, 14, 10, 10, 15, 16, 10, - 17, 18, 19, 10, 10, 20, 21, 21, 22, 10, - 10, 23, 24, 25, 26, 27, 28, 29, 24, 30, - 24, 31, 32, 33, 24, 34, 24, 24, 35, 36, - 37, 24, 24, 38, 10, 10, 10, 39, 24, 40, - 41, 42, 43, 44, 24, 45, 46, 47, 48, 24, - 49, 24, 24, 50, 51, 52, 24, 24, 53, 10, - 54, 10, 11, 12, 55, 10, 56, 57, 15, 16, - 58, 59, 18, 60, 10, 61, 10, 10, 10, 62, - 63, 64, 65, 10, 10, 10, 66, 10, 67, 10, - - 10, 10, 68, 10, 69, 70, 10, 10, 10, 10, - 10, 10, 71, 10, 10, 10, 10, 72, 73, 10, - 10, 10, 74, 10, 75, 10, 76, 77, 78, 79, - 80, 10, 81, 10, 10, 10, 10, 82, 10, 53, - 83, 54, 10, 10, 86, 86, 86, 86, 88, 10, - 10, 10, 10, 90, 95, 91, 91, 91, 90, 97, - 91, 91, 91, 97, 176, 92, 97, 97, 97, 97, - 92, 97, 84, 84, 128, 129, 97, 104, 96, 97, - 111, 107, 97, 97, 99, 100, 105, 97, 89, 97, - 106, 92, 97, 109, 114, 97, 92, 85, 85, 101, - - 102, 103, 108, 110, 97, 119, 93, 97, 112, 115, - 120, 97, 97, 126, 97, 113, 97, 116, 117, 97, - 135, 97, 97, 130, 131, 121, 124, 97, 136, 122, - 139, 118, 137, 97, 97, 160, 123, 132, 133, 134, - 97, 97, 125, 158, 144, 160, 158, 95, 97, 162, - 88, 97, 86, 86, 140, 138, 142, 163, 162, 163, - 97, 145, 147, 141, 112, 117, 173, 173, 173, 146, - 143, 96, 178, 177, 148, 119, 92, 150, 171, 149, - 153, 151, 97, 97, 97, 155, 97, 152, 147, 90, - 89, 91, 91, 91, 97, 154, 97, 182, 180, 97, - - 172, 92, 92, 174, 97, 174, 97, 97, 175, 175, - 175, 179, 97, 97, 188, 97, 181, 97, 183, 97, - 186, 97, 97, 97, 97, 97, 97, 92, 97, 189, - 184, 185, 192, 191, 194, 97, 187, 190, 97, 195, - 97, 202, 128, 129, 97, 97, 201, 197, 198, 97, - 97, 196, 97, 199, 206, 200, 205, 97, 203, 97, - 97, 97, 208, 97, 204, 97, 97, 97, 207, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 175, 175, 175, 175, 175, - 175, 210, 212, 97, 260, 260, 396, 209, 211, 177, - - 178, 97, 216, 261, 286, 213, 245, 252, 97, 311, - 217, 223, 219, 222, 199, 214, 215, 224, 218, 220, - 227, 221, 228, 197, 198, 226, 196, 229, 233, 225, - 230, 200, 231, 173, 173, 173, 97, 232, 225, 239, - 97, 246, 248, 92, 97, 253, 97, 97, 97, 97, - 250, 97, 240, 97, 97, 97, 266, 97, 97, 97, - 269, 272, 247, 249, 97, 97, 243, 241, 242, 92, - 244, 251, 254, 97, 257, 259, 258, 267, 255, 256, - 264, 270, 273, 268, 275, 265, 97, 97, 246, 248, - 271, 274, 250, 97, 253, 97, 97, 97, 266, 97, - - 97, 276, 97, 97, 97, 239, 97, 97, 269, 97, - 97, 272, 97, 245, 97, 277, 278, 97, 97, 97, - 97, 97, 97, 97, 297, 97, 97, 295, 97, 97, - 97, 296, 97, 279, 97, 247, 249, 243, 244, 251, - 97, 307, 309, 305, 310, 267, 280, 304, 283, 284, - 285, 274, 281, 282, 287, 270, 288, 268, 273, 289, - 271, 293, 308, 97, 97, 294, 97, 306, 97, 322, - 324, 320, 325, 323, 326, 321, 97, 312, 97, 97, - 304, 308, 97, 97, 97, 329, 97, 311, 97, 97, - 97, 97, 97, 319, 97, 313, 97, 97, 97, 97, - - 334, 97, 97, 97, 335, 97, 97, 97, 339, 97, - 97, 97, 307, 97, 343, 336, 309, 332, 333, 97, - 337, 340, 328, 345, 346, 361, 347, 363, 365, 327, - 97, 97, 97, 97, 97, 330, 361, 363, 365, 97, - 360, 97, 97, 350, 351, 97, 362, 354, 364, 366, - 97, 367, 368, 97, 348, 349, 352, 353, 356, 369, - 345, 357, 355, 370, 371, 373, 97, 374, 358, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 360, 97, 362, 364, 366, 97, 386, 97, 97, - 97, 97, 367, 97, 177, 97, 177, 368, 177, 177, - - 392, 177, 395, 385, 375, 177, 393, 177, 389, 387, - 398, 400, 388, 177, 376, 384, 391, 383, 382, 177, - 381, 373, 374, 177, 380, 177, 377, 394, 379, 393, - 397, 378, 390, 372, 177, 400, 177, 387, 399, 87, - 87, 87, 94, 94, 94, 98, 98, 127, 127, 127, - 177, 177, 359, 177, 177, 177, 177, 177, 344, 342, - 341, 97, 338, 177, 177, 177, 177, 177, 177, 177, - 331, 97, 318, 177, 317, 316, 177, 315, 314, 177, - 177, 177, 177, 177, 303, 177, 302, 177, 301, 177, - 300, 299, 298, 292, 177, 291, 290, 97, 97, 263, - - 262, 177, 238, 234, 237, 236, 235, 157, 234, 157, - 401, 97, 193, 97, 177, 401, 401, 97, 164, 170, - 169, 164, 156, 168, 167, 159, 166, 165, 164, 156, - 159, 161, 160, 159, 158, 157, 156, 97, 401, 9, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401 - } ; - -static yyconst flex_int16_t yy_chk[912] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 7, 8, 11, 11, 12, 12, 14, 7, - 8, 7, 8, 20, 22, 20, 20, 20, 21, 25, - 21, 21, 21, 26, 406, 20, 29, 31, 27, 23, - 21, 42, 7, 8, 38, 38, 40, 25, 22, 28, - 29, 26, 39, 34, 23, 23, 25, 37, 14, 30, - 25, 20, 46, 28, 31, 32, 21, 7, 8, 23, - - 23, 23, 27, 28, 33, 34, 20, 35, 30, 32, - 34, 41, 36, 37, 43, 30, 44, 32, 33, 45, - 40, 47, 48, 39, 39, 35, 36, 49, 40, 35, - 42, 33, 40, 50, 52, 67, 35, 39, 39, 39, - 51, 99, 36, 68, 46, 75, 77, 94, 85, 67, - 87, 84, 86, 86, 43, 41, 44, 68, 75, 77, - 400, 47, 48, 43, 45, 84, 90, 90, 90, 47, - 45, 94, 99, 396, 48, 49, 90, 50, 84, 49, - 51, 50, 101, 103, 100, 52, 108, 50, 85, 91, - 87, 91, 91, 91, 102, 51, 104, 103, 101, 105, - - 85, 91, 90, 92, 106, 92, 110, 111, 92, 92, - 92, 100, 107, 109, 108, 113, 102, 115, 104, 114, - 106, 116, 117, 118, 120, 121, 123, 91, 124, 109, - 105, 105, 111, 110, 113, 125, 107, 109, 122, 114, - 126, 121, 127, 127, 130, 131, 120, 116, 117, 132, - 133, 115, 134, 118, 124, 118, 123, 135, 122, 136, - 137, 138, 126, 142, 122, 139, 143, 145, 125, 141, - 140, 144, 146, 147, 148, 152, 151, 149, 150, 154, - 155, 153, 183, 172, 171, 174, 174, 174, 175, 175, - 175, 132, 134, 187, 195, 224, 393, 131, 133, 389, - - 130, 261, 137, 195, 224, 135, 183, 187, 179, 261, - 138, 143, 140, 142, 171, 136, 136, 144, 139, 140, - 150, 141, 151, 146, 147, 149, 145, 151, 155, 148, - 152, 148, 153, 173, 173, 173, 180, 154, 172, 179, - 181, 184, 185, 173, 182, 188, 189, 191, 190, 209, - 186, 192, 180, 194, 201, 199, 202, 203, 205, 210, - 204, 206, 184, 185, 213, 208, 181, 180, 180, 173, - 182, 186, 188, 207, 191, 194, 192, 202, 189, 190, - 199, 204, 206, 203, 208, 201, 211, 212, 214, 215, - 205, 207, 216, 217, 218, 219, 221, 220, 227, 222, - - 226, 210, 223, 230, 225, 209, 228, 232, 229, 241, - 242, 231, 252, 213, 233, 210, 210, 254, 259, 276, - 279, 280, 281, 256, 242, 277, 283, 241, 258, 288, - 278, 241, 257, 217, 240, 214, 215, 211, 212, 216, - 255, 256, 258, 254, 259, 227, 218, 252, 221, 222, - 223, 232, 219, 220, 225, 229, 226, 228, 231, 233, - 230, 240, 257, 264, 265, 240, 275, 255, 282, 277, - 278, 276, 280, 277, 281, 276, 284, 264, 285, 286, - 279, 283, 287, 289, 294, 288, 293, 286, 295, 296, - 305, 306, 310, 275, 297, 265, 319, 313, 320, 312, - - 294, 321, 322, 325, 295, 323, 324, 326, 305, 329, - 327, 328, 282, 330, 310, 296, 284, 293, 293, 332, - 297, 306, 287, 312, 313, 333, 319, 334, 335, 285, - 336, 337, 343, 339, 348, 289, 349, 350, 351, 346, - 332, 340, 347, 321, 322, 352, 333, 325, 334, 335, - 353, 336, 337, 354, 320, 320, 323, 324, 327, 339, - 328, 329, 326, 340, 343, 346, 355, 347, 330, 356, - 357, 369, 358, 370, 371, 375, 376, 377, 385, 390, - 391, 348, 386, 349, 350, 351, 395, 370, 392, 397, - 394, 399, 352, 398, 388, 387, 384, 353, 383, 382, - - 385, 381, 392, 369, 354, 380, 386, 379, 374, 371, - 395, 398, 373, 372, 355, 368, 376, 367, 366, 365, - 364, 357, 358, 363, 362, 361, 356, 390, 360, 391, - 394, 359, 375, 345, 344, 399, 342, 377, 397, 402, - 402, 402, 403, 403, 403, 404, 404, 405, 405, 405, - 341, 338, 331, 318, 317, 316, 315, 314, 311, 309, - 308, 307, 304, 303, 302, 301, 300, 299, 298, 292, - 290, 274, 273, 272, 271, 270, 269, 268, 267, 266, - 263, 262, 260, 253, 251, 250, 249, 248, 247, 246, - 245, 244, 243, 239, 238, 237, 235, 200, 198, 197, - - 196, 193, 178, 170, 169, 168, 167, 166, 165, 161, - 128, 119, 112, 98, 97, 96, 89, 88, 83, 82, - 81, 80, 79, 78, 76, 74, 73, 71, 70, 69, - 66, 65, 64, 63, 62, 57, 55, 24, 9, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401 - } ; +{ + flex_int32_t yy_verify; + flex_int32_t yy_nxt; +}; +static const flex_int16_t yy_accept[391] = +{ + 0, + 0, 0, 0, 0, 0, 0, 0, 0, 82, 80, + 79, 79, 8, 80, 73, 76, 65, 75, 64, 1, + 1, 80, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 80, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 74, 77, 80, 69, 80, 67, 71, 72, + 68, 10, 80, 12, 80, 80, 80, 80, 80, 80, + 80, 66, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 78, 78, 79, 0, 78, 0, 1, 1, 0, + 0, 0, 19, 0, 63, 78, 78, 78, 78, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 3, 78, 78, 78, + 78, 78, 78, 78, 0, 0, 18, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 13, 15, 9, 14, 11, 0, 12, + 10, 17, 0, 0, 0, 0, 78, 78, 1, 0, + 1, 20, 62, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 61, 78, + 78, 78, 78, 7, 78, 8, 78, 78, 78, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 16, + 70, 50, 78, 78, 78, 78, 78, 78, 78, 25, + 78, 29, 78, 28, 78, 78, 23, 78, 78, 78, + 78, 78, 78, 21, 78, 58, 59, 78, 78, 27, + 78, 78, 24, 78, 78, 26, 78, 4, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 37, 78, 78, 78, 78, 78, 36, + 38, 52, 31, 35, 34, 78, 78, 78, 5, 78, + + 78, 78, 78, 78, 78, 33, 48, 30, 49, 32, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 60, 78, + 78, 51, 55, 78, 22, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 41, 78, 40, 78, 39, 78, 78, 78, 78, 78, + 78, 57, 78, 78, 78, 78, 78, 43, 47, 46, + 45, 42, 44, 78, 78, 6, 56, 54, 78, 78, + 78, 78, 78, 78, 53, 78, 78, 78, 2, 0 +}; + +static const YY_CHAR yy_ec[256] = +{ + 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 1, 1, 6, 7, 1, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 18, 18, 18, 18, 18, 18, 18, 1, 1, 19, + 20, 21, 1, 1, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 31, 31, 42, 43, 31, + 44, 45, 46, 47, 31, 1, 48, 49, 50, 51, + + 52, 53, 54, 55, 56, 31, 31, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 31, 31, 67, + 68, 31, 69, 70, 71, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 +}; + +static const YY_CHAR yy_meta[72] = +{ + 0, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, + 1, 3, 3, 3, 3, 3, 3, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, + 1 +}; + +static const flex_int16_t yy_base[396] = +{ + 0, + 0, 0, 0, 0, 71, 0, 139, 140, 830, 831, + 143, 145, 831, 144, 831, 831, 831, 831, 831, 140, + 145, 134, 162, 821, 152, 156, 161, 172, 159, 182, + 160, 188, 197, 176, 200, 205, 180, 130, 175, 169, + 204, 164, 207, 209, 212, 185, 214, 215, 220, 226, + 233, 227, 831, 831, 808, 831, 820, 831, 831, 831, + 831, 806, 805, 804, 789, 785, 210, 218, 795, 782, + 784, 831, 759, 755, 194, 195, 756, 763, 751, 753, + 742, 244, 241, 251, 246, 803, 807, 251, 276, 293, + 0, 227, 831, 806, 799, 799, 234, 277, 275, 287, + + 276, 289, 292, 297, 305, 279, 306, 299, 300, 798, + 308, 312, 310, 314, 315, 316, 797, 317, 318, 331, + 319, 321, 328, 333, 298, 801, 831, 337, 338, 342, + 343, 345, 350, 352, 353, 354, 358, 363, 362, 356, + 359, 364, 360, 365, 366, 367, 370, 371, 369, 368, + 374, 372, 373, 831, 831, 831, 831, 831, 778, 831, + 831, 831, 764, 750, 749, 736, 377, 376, 418, 370, + 373, 0, 831, 790, 401, 429, 433, 437, 375, 434, + 435, 443, 386, 438, 439, 441, 440, 444, 788, 446, + 387, 788, 787, 786, 448, 785, 447, 449, 450, 453, + + 451, 454, 466, 458, 442, 452, 479, 480, 457, 481, + 482, 485, 486, 487, 488, 490, 489, 492, 495, 388, + 497, 493, 491, 499, 501, 496, 504, 500, 507, 831, + 831, 783, 783, 527, 502, 503, 782, 781, 780, 778, + 778, 776, 776, 774, 774, 505, 772, 510, 533, 516, + 525, 521, 511, 771, 394, 770, 769, 556, 557, 768, + 768, 767, 765, 765, 764, 762, 762, 761, 559, 512, + 518, 523, 513, 514, 515, 561, 519, 569, 571, 572, + 575, 522, 576, 759, 579, 577, 581, 582, 587, 758, + 757, 756, 755, 754, 753, 753, 583, 584, 752, 751, + + 750, 585, 749, 592, 590, 747, 746, 745, 744, 743, + 589, 591, 594, 595, 598, 599, 596, 600, 603, 604, + 602, 606, 612, 618, 620, 621, 623, 624, 742, 626, + 634, 728, 726, 625, 725, 724, 632, 635, 627, 629, + 630, 631, 638, 643, 646, 659, 662, 663, 665, 721, + 717, 717, 715, 713, 711, 711, 710, 708, 664, 666, + 667, 705, 705, 701, 668, 669, 670, 699, 697, 693, + 691, 690, 688, 671, 675, 688, 686, 391, 672, 673, + 681, 389, 683, 679, 265, 682, 686, 684, 253, 831, + 739, 742, 744, 747, 162 +}; + +static const flex_int16_t yy_def[396] = +{ + 0, + 390, 1, 1, 1, 390, 5, 1, 1, 390, 390, + 390, 390, 390, 391, 390, 390, 390, 390, 390, 390, + 390, 392, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 394, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 393, 393, 390, 391, 390, 391, 390, 390, 390, + 395, 392, 390, 392, 390, 393, 393, 393, 393, 393, + + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 394, 394, 390, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 393, 393, 390, 390, + 390, 395, 390, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 390, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 390, + 390, 390, 393, 393, 393, 393, 393, 393, 393, 390, + 393, 390, 393, 390, 393, 393, 390, 393, 393, 393, + 393, 393, 393, 390, 393, 390, 390, 393, 393, 390, + 393, 393, 390, 393, 393, 390, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 390, 393, 393, 393, 393, 393, 390, + 390, 390, 390, 390, 390, 393, 393, 393, 393, 393, + + 393, 393, 393, 393, 393, 390, 390, 390, 390, 390, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 390, 393, + 393, 390, 390, 393, 390, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + 390, 393, 390, 393, 390, 393, 393, 393, 393, 393, + 393, 390, 393, 393, 393, 393, 393, 390, 390, 390, + 390, 390, 390, 393, 393, 393, 390, 390, 393, 393, + 393, 393, 393, 393, 390, 393, 393, 393, 393, 0, + 390, 390, 390, 390, 390 +}; + +static const flex_int16_t yy_nxt[903] = +{ + 0, + 10, 11, 12, 13, 14, 10, 10, 15, 16, 10, + 17, 18, 19, 10, 10, 20, 21, 21, 22, 10, + 10, 23, 24, 25, 26, 27, 28, 29, 24, 30, + 24, 31, 32, 33, 24, 34, 24, 24, 35, 36, + 37, 24, 24, 38, 10, 10, 10, 39, 24, 40, + 41, 42, 43, 44, 24, 45, 46, 47, 48, 24, + 49, 24, 24, 50, 51, 52, 24, 24, 53, 10, + 54, 10, 11, 12, 55, 10, 56, 57, 15, 16, + 58, 59, 18, 60, 10, 61, 10, 10, 10, 62, + 63, 64, 65, 10, 10, 10, 66, 10, 67, 10, + + 10, 10, 68, 10, 69, 70, 10, 10, 10, 10, + 10, 10, 71, 10, 10, 10, 10, 72, 73, 10, + 10, 10, 74, 10, 75, 10, 10, 76, 77, 78, + 79, 10, 10, 10, 10, 10, 10, 80, 10, 53, + 81, 54, 10, 10, 84, 84, 84, 84, 86, 10, + 10, 10, 10, 88, 93, 89, 89, 89, 88, 95, + 89, 89, 89, 95, 172, 90, 95, 95, 95, 95, + 90, 95, 82, 82, 126, 127, 95, 102, 94, 95, + 109, 105, 95, 95, 97, 98, 103, 95, 87, 95, + 104, 90, 95, 107, 112, 95, 90, 83, 83, 99, + + 100, 101, 106, 108, 95, 117, 91, 95, 110, 113, + 118, 95, 95, 124, 95, 111, 95, 114, 115, 95, + 133, 95, 95, 128, 129, 119, 122, 95, 134, 120, + 137, 116, 135, 95, 95, 158, 121, 130, 131, 132, + 95, 95, 123, 156, 142, 158, 156, 93, 95, 160, + 86, 95, 84, 84, 138, 136, 140, 161, 160, 161, + 95, 143, 145, 139, 110, 115, 169, 169, 169, 144, + 141, 94, 174, 173, 146, 117, 90, 148, 167, 147, + 151, 149, 95, 95, 95, 153, 95, 150, 145, 88, + 87, 89, 89, 89, 95, 152, 95, 178, 176, 95, + + 168, 90, 90, 170, 95, 170, 95, 95, 171, 171, + 171, 175, 95, 95, 184, 95, 177, 95, 179, 95, + 182, 95, 95, 95, 95, 95, 95, 90, 95, 185, + 180, 181, 188, 187, 190, 95, 183, 186, 95, 191, + 95, 198, 126, 127, 95, 95, 197, 193, 194, 95, + 95, 192, 95, 195, 202, 196, 201, 95, 199, 95, + 95, 95, 204, 95, 200, 95, 95, 95, 203, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 171, 171, 171, 171, 171, + 171, 206, 208, 95, 254, 254, 385, 205, 207, 173, + + 174, 95, 212, 255, 280, 209, 239, 246, 95, 303, + 213, 219, 215, 218, 195, 210, 211, 220, 214, 216, + 223, 217, 224, 193, 194, 222, 192, 225, 229, 221, + 226, 196, 227, 169, 169, 169, 95, 228, 221, 233, + 95, 240, 242, 90, 95, 247, 95, 95, 95, 95, + 244, 95, 234, 95, 95, 95, 260, 95, 95, 95, + 263, 266, 241, 243, 95, 95, 237, 235, 236, 90, + 238, 245, 248, 95, 251, 253, 252, 261, 249, 250, + 258, 264, 267, 262, 269, 259, 95, 95, 240, 242, + 265, 268, 244, 95, 247, 95, 95, 95, 260, 95, + + 95, 270, 95, 95, 95, 233, 95, 95, 263, 95, + 95, 266, 95, 239, 95, 271, 272, 95, 95, 95, + 95, 95, 95, 95, 289, 95, 95, 287, 95, 95, + 95, 288, 95, 273, 95, 241, 243, 237, 238, 245, + 95, 299, 301, 297, 302, 261, 274, 296, 277, 278, + 279, 268, 275, 276, 281, 264, 282, 262, 267, 283, + 265, 285, 300, 95, 95, 286, 95, 298, 95, 314, + 316, 312, 317, 315, 318, 313, 95, 304, 95, 95, + 296, 300, 95, 95, 95, 321, 95, 303, 95, 95, + 95, 95, 95, 311, 95, 305, 95, 95, 95, 95, + + 325, 95, 95, 95, 326, 95, 95, 95, 330, 95, + 95, 95, 299, 95, 334, 327, 301, 323, 324, 95, + 328, 331, 320, 336, 337, 351, 338, 353, 355, 319, + 95, 95, 95, 95, 95, 322, 351, 353, 355, 95, + 350, 95, 95, 341, 342, 95, 352, 345, 354, 356, + 95, 357, 358, 95, 339, 340, 343, 344, 347, 359, + 336, 348, 346, 360, 361, 363, 95, 364, 349, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 350, 95, 352, 354, 356, 95, 375, 95, 95, + 95, 95, 357, 95, 173, 95, 173, 358, 173, 173, + + 381, 173, 384, 374, 365, 173, 382, 173, 378, 376, + 387, 389, 377, 173, 366, 373, 380, 372, 371, 173, + 370, 363, 364, 173, 369, 173, 367, 383, 368, 382, + 386, 362, 379, 173, 173, 389, 173, 376, 388, 85, + 85, 85, 92, 92, 92, 96, 96, 125, 125, 125, + 173, 173, 173, 173, 173, 173, 335, 333, 332, 95, + 329, 173, 173, 173, 173, 173, 173, 173, 95, 310, + 173, 309, 308, 173, 307, 306, 173, 173, 173, 173, + 173, 295, 173, 294, 173, 293, 173, 292, 291, 290, + 284, 173, 95, 95, 257, 256, 173, 232, 230, 231, + + 155, 230, 155, 390, 95, 189, 95, 173, 390, 390, + 95, 162, 166, 162, 154, 165, 157, 164, 163, 162, + 154, 157, 159, 158, 157, 156, 155, 154, 95, 390, + 9, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + + 390, 390 +}; + +static const flex_int16_t yy_chk[903] = +{ + 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 7, 8, 11, 11, 12, 12, 14, 7, + 8, 7, 8, 20, 22, 20, 20, 20, 21, 25, + 21, 21, 21, 26, 395, 20, 29, 31, 27, 23, + 21, 42, 7, 8, 38, 38, 40, 25, 22, 28, + 29, 26, 39, 34, 23, 23, 25, 37, 14, 30, + 25, 20, 46, 28, 31, 32, 21, 7, 8, 23, + + 23, 23, 27, 28, 33, 34, 20, 35, 30, 32, + 34, 41, 36, 37, 43, 30, 44, 32, 33, 45, + 40, 47, 48, 39, 39, 35, 36, 49, 40, 35, + 42, 33, 40, 50, 52, 67, 35, 39, 39, 39, + 51, 97, 36, 68, 46, 75, 76, 92, 83, 67, + 85, 82, 84, 84, 43, 41, 44, 68, 75, 76, + 389, 47, 48, 43, 45, 82, 88, 88, 88, 47, + 45, 92, 97, 385, 48, 49, 88, 50, 82, 49, + 51, 50, 99, 101, 98, 52, 106, 50, 83, 89, + 85, 89, 89, 89, 100, 51, 102, 101, 99, 103, + + 83, 89, 88, 90, 104, 90, 108, 109, 90, 90, + 90, 98, 105, 107, 106, 111, 100, 113, 102, 112, + 104, 114, 115, 116, 118, 119, 121, 89, 122, 107, + 103, 103, 109, 108, 111, 123, 105, 107, 120, 112, + 124, 119, 125, 125, 128, 129, 118, 114, 115, 130, + 131, 113, 132, 116, 122, 116, 121, 133, 120, 134, + 135, 136, 124, 140, 120, 137, 141, 143, 123, 139, + 138, 142, 144, 145, 146, 150, 149, 147, 148, 152, + 153, 151, 179, 168, 167, 170, 170, 170, 171, 171, + 171, 130, 132, 183, 191, 220, 382, 129, 131, 378, + + 128, 255, 135, 191, 220, 133, 179, 183, 175, 255, + 136, 141, 138, 140, 167, 134, 134, 142, 137, 138, + 148, 139, 149, 144, 145, 147, 143, 149, 153, 146, + 150, 146, 151, 169, 169, 169, 176, 152, 168, 175, + 177, 180, 181, 169, 178, 184, 185, 187, 186, 205, + 182, 188, 176, 190, 197, 195, 198, 199, 201, 206, + 200, 202, 180, 181, 209, 204, 177, 176, 176, 169, + 178, 182, 184, 203, 187, 190, 188, 198, 185, 186, + 195, 200, 202, 199, 204, 197, 207, 208, 210, 211, + 201, 203, 212, 213, 214, 215, 217, 216, 223, 218, + + 222, 206, 219, 226, 221, 205, 224, 228, 225, 235, + 236, 227, 246, 209, 229, 206, 206, 248, 253, 270, + 273, 274, 275, 250, 236, 271, 277, 235, 252, 282, + 272, 235, 251, 213, 234, 210, 211, 207, 208, 212, + 249, 250, 252, 248, 253, 223, 214, 246, 217, 218, + 219, 228, 215, 216, 221, 225, 222, 224, 227, 229, + 226, 234, 251, 258, 259, 234, 269, 249, 276, 271, + 272, 270, 274, 271, 275, 270, 278, 258, 279, 280, + 273, 277, 281, 283, 286, 282, 285, 280, 287, 288, + 297, 298, 302, 269, 289, 259, 311, 305, 312, 304, + + 286, 313, 314, 317, 287, 315, 316, 318, 297, 321, + 319, 320, 276, 322, 302, 288, 278, 285, 285, 323, + 289, 298, 281, 304, 305, 324, 311, 325, 326, 279, + 327, 328, 334, 330, 339, 283, 340, 341, 342, 337, + 323, 331, 338, 313, 314, 343, 324, 317, 325, 326, + 344, 327, 328, 345, 312, 312, 315, 316, 319, 330, + 320, 321, 318, 331, 334, 337, 346, 338, 322, 347, + 348, 359, 349, 360, 361, 365, 366, 367, 374, 379, + 380, 339, 375, 340, 341, 342, 384, 360, 381, 386, + 383, 388, 343, 387, 377, 376, 373, 344, 372, 371, + + 374, 370, 381, 359, 345, 369, 375, 368, 364, 361, + 384, 387, 363, 362, 346, 358, 366, 357, 356, 355, + 354, 348, 349, 353, 352, 351, 347, 379, 350, 380, + 383, 336, 365, 335, 333, 388, 332, 367, 386, 391, + 391, 391, 392, 392, 392, 393, 393, 394, 394, 394, + 329, 310, 309, 308, 307, 306, 303, 301, 300, 299, + 296, 295, 294, 293, 292, 291, 290, 284, 268, 267, + 266, 265, 264, 263, 262, 261, 260, 257, 256, 254, + 247, 245, 244, 243, 242, 241, 240, 239, 238, 237, + 233, 232, 196, 194, 193, 192, 189, 174, 166, 165, + + 164, 163, 159, 126, 117, 110, 96, 95, 94, 87, + 86, 81, 80, 79, 78, 77, 74, 73, 71, 70, + 69, 66, 65, 64, 63, 62, 57, 55, 24, 9, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + + 390, 390 +}; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -735,10 +764,10 @@ static yyconst flex_int16_t yy_chk[912] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" +#line 1 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" /* scanner for kinetic functions */ -#line 10 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" +#line 10 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" #include #include "copasi/copasi.h" @@ -751,15 +780,16 @@ static yyconst flex_int16_t yy_chk[912] = #endif #define YY_USER_INIT \ - mpNode = NULL;\ - mPosition = 0;\ - mpNodeList = new std::vector< CEvaluationNode * >; + mpNode = NULL;\ + mPosition = 0;\ + mpNodeList = new std::vector< CEvaluationNode * >; #define COMMON_ACTION \ - mPosition += yyleng;\ - mpNodeList->push_back(mpNode); + mPosition += yyleng;\ + mpNodeList->push_back(mpNode); -#line 763 "" +#line 764 "" +#line 765 "" #define INITIAL 0 #define sSIGNorVALUE 1 @@ -778,11 +808,11 @@ static yyconst flex_int16_t yy_chk[912] = #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy(char *, const char *, int); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen(const char *); #endif #ifndef YY_NO_INPUT @@ -801,7 +831,7 @@ static int yy_flex_strlen (yyconst char * ); /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO -#define ECHO LexerOutput( yytext, yyleng ) +#define ECHO LexerOutput(yytext, yyleng) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -809,9 +839,9 @@ static int yy_flex_strlen (yyconst char * ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ -\ - if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + \ + if ((int)(result = LexerInput((char *) buf, max_size )) < 0 ) \ + YY_FATAL_ERROR("input in flex scanner failed" ); #endif @@ -830,7 +860,7 @@ static int yy_flex_strlen (yyconst char * ); /* Report a fatal error. */ #ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) LexerError( msg ) +#define YY_FATAL_ERROR(msg) LexerError(msg) #endif /* end tables serialization structures and prototypes */ @@ -856,1899 +886,2003 @@ static int yy_flex_strlen (yyconst char * ); #endif #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if (!(yy_init)) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if (!(yy_start)) + (yy_start) = 1; /* first start state */ - if ( ! yyin ) - yyin.rdbuf(std::cin.rdbuf()); + if (! yyin) + yyin.rdbuf(std::cin.rdbuf()); - if ( ! yyout ) - yyout.rdbuf(std::cout.rdbuf()); + if (! yyout) + yyout.rdbuf(std::cout.rdbuf()); - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } + if (! YY_CURRENT_BUFFER) + { + yyensure_buffer_stack(); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin, YY_BUF_SIZE); + } - yy_load_buffer_state( ); - } + yy_load_buffer_state(); + } - { -#line 36 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" + { +#line 36 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" -#line 900 "" +#line 902 "" - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + while (/*CONSTCOND*/1) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); - /* Support of yytext. */ - *yy_cp = (yy_hold_char); + /* Support of yytext. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = (yy_start); yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 402 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; - ++yy_cp; - } - while ( yy_current_state != 401 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); + + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + + if (yy_accept[yy_current_state]) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) + { + yy_current_state = (int) yy_def[yy_current_state]; + + if (yy_current_state >= 391) + yy_c = yy_meta[yy_c]; + } + + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while (yy_current_state != 390); + + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 37 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeNumber(CEvaluationNode::SubType::DOUBLE, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 2: -YY_RULE_SETUP -#line 45 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::EXPONENTIALE, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 3: -YY_RULE_SETUP -#line 53 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::PI, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 4: -YY_RULE_SETUP -#line 61 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::True, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_VALUE; - - YY_BREAK -case 5: -YY_RULE_SETUP -#line 69 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::False, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_VALUE; - - YY_BREAK -case 6: -YY_RULE_SETUP -#line 77 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::Infinity, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 7: -YY_RULE_SETUP -#line 85 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::NaN, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 8: -YY_RULE_SETUP -#line 93 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sVALUE); - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::NOT, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_NOT; - - YY_BREAK -case 9: -YY_RULE_SETUP -#line 101 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::LE, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_LE; - - YY_BREAK -case 10: -YY_RULE_SETUP -#line 109 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::LT, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_LT; - - YY_BREAK -case 11: -YY_RULE_SETUP -#line 117 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::GE, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_GE; - - YY_BREAK -case 12: -YY_RULE_SETUP -#line 125 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::GT, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_GT; - - YY_BREAK -case 13: -YY_RULE_SETUP -#line 133 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::NE, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_NE; - - YY_BREAK -case 14: -YY_RULE_SETUP -#line 141 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::EQ, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_EQ; - - YY_BREAK -case 15: -YY_RULE_SETUP -#line 149 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::AND, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_AND; - - YY_BREAK -case 16: -YY_RULE_SETUP -#line 157 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::XOR, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_XOR; - - YY_BREAK -case 17: -YY_RULE_SETUP -#line 165 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::IMPLIES, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_XOR; - - YY_BREAK -case 18: -YY_RULE_SETUP -#line 173 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::OR, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_OR; - - YY_BREAK -case 19: -/* rule 19 can match eol */ -YY_RULE_SETUP -#line 181 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeUnit(CEvaluationNode::SubType::DEFAULT, - yytext); - COMMON_ACTION; - return TOKEN_UNIT; - - YY_BREAK -case 20: -/* rule 20 can match eol */ -YY_RULE_SETUP -#line 189 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeObject(CEvaluationNode::SubType::CN, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 21: -YY_RULE_SETUP -#line 197 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeObject(CEvaluationNode::SubType::POINTER, - yytext); - COMMON_ACTION; - return TOKEN_NUMBER; - - YY_BREAK -case 22: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 205 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 23: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 212 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG10, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 24: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 219 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::EXP, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 25: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 226 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIN, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 26: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 233 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COS, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 27: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 240 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TAN, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 28: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 247 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SEC, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 29: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 254 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSC, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 30: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 261 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COT, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 31: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 268 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SINH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 32: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 275 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COSH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 33: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 282 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TANH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 34: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 289 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SECH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 35: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 296 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSCH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 36: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 303 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COTH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 37: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 310 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSIN, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 38: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 317 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOS, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 39: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 324 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTAN, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 40: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 331 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSEC, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 41: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 338 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSC, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 42: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 345 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOT, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 43: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 352 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSINH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 44: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 359 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOSH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 45: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 366 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTANH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 46: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 373 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSECH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 47: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 380 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSCH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 48: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 387 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOTH, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 49: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 394 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIGN, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 50: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 401 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SQRT, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 51: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 408 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ABS, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 52: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 415 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FLOOR, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 53: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 422 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CEIL, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 54: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 429 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FACTORIAL, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 55: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 436 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RUNIFORM, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_2; - - YY_BREAK -case 56: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 443 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RGAMMA, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_2; - - YY_BREAK -case 57: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 450 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RPOISSON, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_1; - - YY_BREAK -case 58: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 457 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RNORMAL, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_2; - - YY_BREAK -case 59: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 464 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MAX, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION; - - YY_BREAK -case 60: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 471 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MIN, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION; - - YY_BREAK -case 61: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 478 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeDelay(CEvaluationNode::SubType::DELAY, - yytext); - COMMON_ACTION; - return TOKEN_FUNCTION_2; - - YY_BREAK -case 62: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 485 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mpNode = new CEvaluationNodeChoice(CEvaluationNode::SubType::IF, - yytext); - COMMON_ACTION; - return TOKEN_LOGICAL_CHOICE; - - YY_BREAK -case 63: -/* rule 63 can match eol */ -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -YY_LINENO_REWIND_TO(yy_cp - 1); -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 492 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - { - std::string tmp(yytext); - mpNode = new CEvaluationNodeCall(CEvaluationNode::SubType::EXPRESSION, - tmp.substr(0, tmp.length() - 1)); - } - COMMON_ACTION; - return TOKEN_CALL; - - YY_BREAK -case 64: -/* rule 64 can match eol */ -YY_RULE_SETUP -#line 502 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - { - std::string tmp(yytext); - mpNode = new CEvaluationNodeCall(CEvaluationNode::SubType::FUNCTION, - tmp.substr(0, tmp.length() - 1)); - } - COMMON_ACTION; - return TOKEN_CALL; - - YY_BREAK -case 65: -YY_RULE_SETUP -#line 512 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sVALUE); - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MINUS, - yytext); - COMMON_ACTION; - return TOKEN_SIGN; - - YY_BREAK -case 66: -YY_RULE_SETUP -#line 520 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sVALUE); - mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::PLUS, - yytext); - COMMON_ACTION; - return TOKEN_SIGN; - - YY_BREAK -case 67: -YY_RULE_SETUP -#line 528 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::POWER, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_POWER; - - YY_BREAK -case 68: -YY_RULE_SETUP -#line 536 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MULTIPLY, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_MULTIPLY; - - YY_BREAK -case 69: -YY_RULE_SETUP -#line 544 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::DIVIDE, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_MULTIPLY; - - YY_BREAK -case 70: -YY_RULE_SETUP -#line 552 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MODULUS, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_MODULUS; - - YY_BREAK -case 71: -YY_RULE_SETUP -#line 560 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::REMAINDER, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_REMAINDER; - - YY_BREAK -case 72: -YY_RULE_SETUP -#line 568 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::QUOTIENT, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_REMAINDER; - - YY_BREAK -case 73: -YY_RULE_SETUP -#line 576 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::PLUS, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_PLUS; - - YY_BREAK -case 74: -YY_RULE_SETUP -#line 584 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MINUS, - yytext); - COMMON_ACTION; - return TOKEN_OPERATOR_PLUS; - - YY_BREAK -case 75: -YY_RULE_SETUP -#line 592 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mPosition += yyleng; - // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::OPEN, - // yytext); - // COMMON_ACTION; - return TOKEN_STRUCTURE_OPEN; - - YY_BREAK -case 76: -YY_RULE_SETUP -#line 601 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mPosition += yyleng; - // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::VECTOR_OPEN, - // yytext); - // COMMON_ACTION; - return TOKEN_STRUCTURE_VECTOR_OPEN; - - YY_BREAK -case 77: -YY_RULE_SETUP -#line 610 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sSIGNorVALUE); - mPosition += yyleng; - // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::COMMA, - // yytext); - // COMMON_ACTION; - return TOKEN_STRUCTURE_COMMA; - - YY_BREAK -case 78: -YY_RULE_SETUP -#line 619 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mPosition += yyleng; - // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::CLOSE, - // yytext); - // COMMON_ACTION; - return TOKEN_STRUCTURE_CLOSE; - - YY_BREAK -case 79: -YY_RULE_SETUP -#line 628 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mPosition += yyleng; - // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::VECTOR_CLOSE, - // yytext); - // COMMON_ACTION; - return TOKEN_STRUCTURE_VECTOR_CLOSE; - - YY_BREAK -case 80: -/* rule 80 can match eol */ -YY_RULE_SETUP -#line 637 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - BEGIN(sOPERATOR); - mpNode = new CEvaluationNodeVariable(CEvaluationNode::SubType::DEFAULT, - yytext); - COMMON_ACTION; - return TOKEN_VARIABLE; - - YY_BREAK -case 81: -/* rule 81 can match eol */ -YY_RULE_SETUP -#line 645 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - mPosition += yyleng; - // mpNode = new CEvaluationNodeWhiteSpace(CEvaluationNode::SubType::DEFAULT, - // yytext); - // COMMON_ACTION; - - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(sSIGNorVALUE): -case YY_STATE_EOF(sOPERATOR): -case YY_STATE_EOF(sVALUE): -#line 652 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" -return 0; - YY_BREAK -case 82: -YY_RULE_SETUP -#line 654 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - CCopasiMessage(CCopasiMessage::ERROR, MCFunction + 2, mPosition); - return YYERRCODE; - - YY_BREAK -case 83: -YY_RULE_SETUP -#line 659 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" -ECHO; - YY_BREAK -#line 1964 "" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch (yy_act) + { + /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + + case 1: + YY_RULE_SETUP +#line 37 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeNumber(CEvaluationNode::SubType::DOUBLE, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 2: + YY_RULE_SETUP +#line 45 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::EXPONENTIALE, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 3: + YY_RULE_SETUP +#line 53 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::PI, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 4: + YY_RULE_SETUP +#line 61 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::True, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_VALUE; + + YY_BREAK + + case 5: + YY_RULE_SETUP +#line 69 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::False, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_VALUE; + + YY_BREAK + + case 6: + YY_RULE_SETUP +#line 77 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::Infinity, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 7: + YY_RULE_SETUP +#line 85 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::NaN, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 8: + YY_RULE_SETUP +#line 93 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sVALUE); + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::NOT, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_NOT; + + YY_BREAK + + case 9: + YY_RULE_SETUP +#line 101 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::LE, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_LE; + + YY_BREAK + + case 10: + YY_RULE_SETUP +#line 109 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::LT, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_LT; + + YY_BREAK + + case 11: + YY_RULE_SETUP +#line 117 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::GE, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_GE; + + YY_BREAK + + case 12: + YY_RULE_SETUP +#line 125 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::GT, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_GT; + + YY_BREAK + + case 13: + YY_RULE_SETUP +#line 133 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::NE, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_NE; + + YY_BREAK + + case 14: + YY_RULE_SETUP +#line 141 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::EQ, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_EQ; + + YY_BREAK + + case 15: + YY_RULE_SETUP +#line 149 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::AND, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_AND; + + YY_BREAK + + case 16: + YY_RULE_SETUP +#line 157 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::XOR, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_XOR; + + YY_BREAK + + case 17: + YY_RULE_SETUP +#line 165 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::OR, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_OR; + + YY_BREAK + + case 18: + /* rule 18 can match eol */ + YY_RULE_SETUP +#line 173 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeUnit(CEvaluationNode::SubType::DEFAULT, + yytext); + COMMON_ACTION; + return TOKEN_UNIT; + + YY_BREAK + + case 19: + /* rule 19 can match eol */ + YY_RULE_SETUP +#line 181 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeObject(CEvaluationNode::SubType::CN, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 20: + YY_RULE_SETUP +#line 189 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeObject(CEvaluationNode::SubType::POINTER, + yytext); + COMMON_ACTION; + return TOKEN_NUMBER; + + YY_BREAK + + case 21: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 197 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 22: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 204 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG10, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 23: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 211 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::EXP, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 24: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 218 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIN, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 25: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 225 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COS, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 26: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 232 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TAN, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 27: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 239 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SEC, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 28: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 246 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSC, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 29: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 253 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COT, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 30: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 260 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SINH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 31: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 267 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COSH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 32: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 274 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TANH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 33: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 281 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SECH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 34: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 288 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSCH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 35: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 295 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COTH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 36: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 302 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSIN, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 37: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 309 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOS, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 38: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 316 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTAN, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 39: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 323 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSEC, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 40: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 330 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSC, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 41: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 337 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOT, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 42: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 344 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSINH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 43: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 351 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOSH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 44: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 358 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTANH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 45: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 365 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSECH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 46: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 372 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSCH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 47: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 379 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOTH, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 48: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 386 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIGN, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 49: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 393 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SQRT, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 50: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 400 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ABS, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 51: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 407 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FLOOR, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 52: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 414 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CEIL, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 53: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 421 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FACTORIAL, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 54: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 428 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RUNIFORM, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_2; + + YY_BREAK + + case 55: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 435 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RGAMMA, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_2; + + YY_BREAK + + case 56: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 442 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RPOISSON, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + YY_BREAK + + case 57: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 449 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RNORMAL, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_2; + + YY_BREAK + + case 58: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 456 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MAX, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_2; + + YY_BREAK + + case 59: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 463 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MIN, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_2; + + YY_BREAK + + case 60: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 470 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeDelay(CEvaluationNode::SubType::DELAY, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_2; + + YY_BREAK + + case 61: + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 477 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeChoice(CEvaluationNode::SubType::IF, + yytext); + COMMON_ACTION; + return TOKEN_LOGICAL_CHOICE; + + YY_BREAK + + case 62: + /* rule 62 can match eol */ + *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ + YY_LINENO_REWIND_TO(yy_cp - 1); + (yy_c_buf_p) = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP +#line 484 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + { + std::string tmp(yytext); + mpNode = new CEvaluationNodeCall(CEvaluationNode::SubType::EXPRESSION, + tmp.substr(0, tmp.length() - 1)); + } + COMMON_ACTION; + return TOKEN_CALL; + + YY_BREAK + + case 63: + /* rule 63 can match eol */ + YY_RULE_SETUP +#line 494 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + { + std::string tmp(yytext); + mpNode = new CEvaluationNodeCall(CEvaluationNode::SubType::FUNCTION, + tmp.substr(0, tmp.length() - 1)); + } + COMMON_ACTION; + return TOKEN_CALL; + + YY_BREAK + + case 64: + YY_RULE_SETUP +#line 504 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sVALUE); + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MINUS, + yytext); + COMMON_ACTION; + return TOKEN_SIGN; + + YY_BREAK + + case 65: + YY_RULE_SETUP +#line 512 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sVALUE); + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::PLUS, + yytext); + COMMON_ACTION; + return TOKEN_SIGN; + + YY_BREAK + + case 66: + YY_RULE_SETUP +#line 520 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::POWER, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_POWER; + + YY_BREAK + + case 67: + YY_RULE_SETUP +#line 528 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MULTIPLY, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_MULTIPLY; + + YY_BREAK + + case 68: + YY_RULE_SETUP +#line 536 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::DIVIDE, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_MULTIPLY; + + YY_BREAK + + case 69: + YY_RULE_SETUP +#line 544 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MODULUS, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_MODULUS; + + YY_BREAK + + case 70: + YY_RULE_SETUP +#line 552 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::REMAINDER, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_REMAINDER; + + YY_BREAK + + case 71: + YY_RULE_SETUP +#line 560 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::PLUS, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_PLUS; + + YY_BREAK + + case 72: + YY_RULE_SETUP +#line 568 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MINUS, + yytext); + COMMON_ACTION; + return TOKEN_OPERATOR_PLUS; + + YY_BREAK + + case 73: + YY_RULE_SETUP +#line 576 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mPosition += yyleng; + // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::OPEN, + // yytext); + // COMMON_ACTION; + return TOKEN_STRUCTURE_OPEN; + + YY_BREAK + + case 74: + YY_RULE_SETUP +#line 585 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mPosition += yyleng; + // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::VECTOR_OPEN, + // yytext); + // COMMON_ACTION; + return TOKEN_STRUCTURE_VECTOR_OPEN; + + YY_BREAK + + case 75: + YY_RULE_SETUP +#line 594 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sSIGNorVALUE); + mPosition += yyleng; + // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::COMMA, + // yytext); + // COMMON_ACTION; + return TOKEN_STRUCTURE_COMMA; + + YY_BREAK + + case 76: + YY_RULE_SETUP +#line 603 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mPosition += yyleng; + // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::CLOSE, + // yytext); + // COMMON_ACTION; + return TOKEN_STRUCTURE_CLOSE; + + YY_BREAK + + case 77: + YY_RULE_SETUP +#line 612 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mPosition += yyleng; + // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::VECTOR_CLOSE, + // yytext); + // COMMON_ACTION; + return TOKEN_STRUCTURE_VECTOR_CLOSE; + + YY_BREAK + + case 78: + /* rule 78 can match eol */ + YY_RULE_SETUP +#line 621 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + BEGIN(sOPERATOR); + mpNode = new CEvaluationNodeVariable(CEvaluationNode::SubType::DEFAULT, + yytext); + COMMON_ACTION; + return TOKEN_VARIABLE; + + YY_BREAK + + case 79: + /* rule 79 can match eol */ + YY_RULE_SETUP +#line 629 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mPosition += yyleng; + // mpNode = new CEvaluationNodeWhiteSpace(CEvaluationNode::SubType::DEFAULT, + // yytext); + // COMMON_ACTION; + + YY_BREAK + + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(sSIGNorVALUE): + case YY_STATE_EOF(sOPERATOR): + case YY_STATE_EOF(sVALUE): +#line 636 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + return 0; + YY_BREAK + + case 80: + YY_RULE_SETUP +#line 638 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + CCopasiMessage(CCopasiMessage::ERROR, MCFunction + 2, mPosition); + return YYERRCODE; + + YY_BREAK + + case 81: + YY_RULE_SETUP +#line 643 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + ECHO; + YY_BREAK +#line 1944 "" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) + { + /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans(yy_current_state); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if (yy_next_state) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + } + } + + else switch (yy_get_next_buffer()) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if (yywrap()) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if (!(yy_did_buffer_switch_on_eof)) + YY_NEW_FILE; + } + + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found"); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* The contents of this function are C++ specific, so the () macro is not used. * This constructor simply maintains backward compatibility. * DEPRECATED */ -yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ): - yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()), - yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) +yyFlexLexer::yyFlexLexer(std::istream* arg_yyin, std::ostream* arg_yyout): + yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()), + yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) { - ctor_common(); + ctor_common(); } /* The contents of this function are C++ specific, so the () macro is not used. */ -yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ): - yyin(arg_yyin.rdbuf()), - yyout(arg_yyout.rdbuf()) +yyFlexLexer::yyFlexLexer(std::istream& arg_yyin, std::ostream& arg_yyout): + yyin(arg_yyin.rdbuf()), + yyout(arg_yyout.rdbuf()) { - ctor_common(); + ctor_common(); } /* The contents of this function are C++ specific, so the () macro is not used. */ void yyFlexLexer::ctor_common() { - yy_c_buf_p = 0; - yy_init = 0; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno + yy_c_buf_p = 0; + yy_init = 0; + yy_start = 0; + yy_flex_debug = 0; + yylineno = 1; // this will only get updated if %option yylineno - yy_did_buffer_switch_on_eof = 0; + yy_did_buffer_switch_on_eof = 0; - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; + yy_looking_for_trail_begin = 0; + yy_more_flag = 0; + yy_more_len = 0; + yy_more_offset = yy_prev_more_offset = 0; - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = NULL; + yy_start_stack_ptr = yy_start_stack_depth = 0; + yy_start_stack = NULL; - yy_buffer_stack = NULL; - yy_buffer_stack_top = 0; - yy_buffer_stack_max = 0; - - yy_state_buf = 0; + yy_buffer_stack = NULL; + yy_buffer_stack_top = 0; + yy_buffer_stack_max = 0; + yy_state_buf = 0; } /* The contents of this function are C++ specific, so the () macro is not used. */ yyFlexLexer::~yyFlexLexer() { - delete [] yy_state_buf; - CEvaluationfree(yy_start_stack ); - yy_delete_buffer( YY_CURRENT_BUFFER ); - CEvaluationfree(yy_buffer_stack ); + delete [] yy_state_buf; + yyfree(yy_start_stack); + yy_delete_buffer(YY_CURRENT_BUFFER); + yyfree(yy_buffer_stack); } /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) +void yyFlexLexer::switch_streams(std::istream& new_in, std::ostream& new_out) { - // was if( new_in ) - yy_delete_buffer( YY_CURRENT_BUFFER ); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); + // was if(new_in) + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer(yy_create_buffer(new_in, YY_BUF_SIZE)); - // was if( new_out ) - yyout.rdbuf(new_out.rdbuf()); + // was if(new_out) + yyout.rdbuf(new_out.rdbuf()); } /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) +void yyFlexLexer::switch_streams(std::istream* new_in, std::ostream* new_out) { - if( ! new_in ) { - new_in = &yyin; - } + if (! new_in) + { + new_in = &yyin; + } - if ( ! new_out ) { - new_out = &yyout; - } + if (! new_out) + { + new_out = &yyout; + } - switch_streams(*new_in, *new_out); + switch_streams(*new_in, *new_out); } #ifdef YY_INTERACTIVE -int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) +int yyFlexLexer::LexerInput(char* buf, int /* max_size */) #else -int yyFlexLexer::LexerInput( char* buf, int max_size ) +int yyFlexLexer::LexerInput(char* buf, int max_size) #endif { - if ( yyin.eof() || yyin.fail() ) - return 0; + if (yyin.eof() || yyin.fail()) + return 0; #ifdef YY_INTERACTIVE - yyin.get( buf[0] ); + yyin.get(buf[0]); - if ( yyin.eof() ) - return 0; + if (yyin.eof()) + return 0; - if ( yyin.bad() ) - return -1; + if (yyin.bad()) + return -1; - return 1; + return 1; #else - (void) yyin.read( buf, max_size ); + (void) yyin.read(buf, max_size); + + if (yyin.bad()) + return -1; + else + return yyin.gcount(); - if ( yyin.bad() ) - return -1; - else - return yyin.gcount(); #endif } -void yyFlexLexer::LexerOutput( const char* buf, int size ) +void yyFlexLexer::LexerOutput(const char* buf, int size) { - (void) yyout.write( buf, size ); + (void) yyout.write(buf, size); } /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ int yyFlexLexer::yy_get_next_buffer() { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - yy_size_t number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - CEvaluationrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) CEvaluationrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed"); + + if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) + { + /* Don't try to fill the buffer, so this is an EOF. */ + if ((yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int)((yy_c_buf_p) - (yytext_ptr) - 1); + + for (i = 0; i < number_to_move; ++i) + *(dest++) = *(source++); + + if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while (num_to_read <= 0) + { + /* Not enough room in the buffer - grow it. */ - return ret_val; + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int)((yy_c_buf_p) - b->yy_ch_buf); + + if (b->yy_is_our_buffer) + { + int new_size = b->yy_buf_size * 2; + + if (new_size <= 0) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf, + (yy_size_t)(b->yy_buf_size + 2)); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if (! b->yy_ch_buf) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow"); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + } + + if (num_to_read > YY_READ_BUF_SIZE) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ((yy_n_chars) == 0) + { + if (number_to_move == YY_MORE_ADJ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) + { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size); + + if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); + + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ - yy_state_type yyFlexLexer::yy_get_previous_state() +yy_state_type yyFlexLexer::yy_get_previous_state() { - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 402 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; - } - - return yy_current_state; + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + + for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + + if (yy_accept[yy_current_state]) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) + { + yy_current_state = (int) yy_def[yy_current_state]; + + if (yy_current_state >= 391) + yy_c = yy_meta[yy_c]; + } + + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans(current_state ); */ - yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) +yy_state_type yyFlexLexer::yy_try_NUL_trans(yy_state_type yy_current_state) { - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 402 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; - yy_is_jam = (yy_current_state == 401); - - return yy_is_jam ? 0 : yy_current_state; + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + + if (yy_accept[yy_current_state]) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + + while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) + { + yy_current_state = (int) yy_def[yy_current_state]; + + if (yy_current_state >= 391) + yy_c = yy_meta[yy_c]; + } + + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 390); + + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT - void yyFlexLexer::yyunput( int c, char* yy_bp) +void yyFlexLexer::yyunput(int c, char* yy_bp) { - char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; + char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) + { + /* need to shift things up to make room */ + /* +2 for EOB chars. */ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + *--dest = *--source; + + yy_cp += (int)(dest - source); + yy_bp += (int)(dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) + YY_FATAL_ERROR("flex scanner push-back overflow"); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; } #endif - int yyFlexLexer::yyinput() +int yyFlexLexer::yyinput() { - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { + /* need more input */ + int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + ++(yy_c_buf_p); + + switch (yy_get_next_buffer()) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if (yywrap()) + return 0; + + if (!(yy_did_buffer_switch_on_eof)) + YY_NEW_FILE; + #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - return c; + return c; } /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void yyFlexLexer::yyrestart( std::istream& input_file ) +void yyFlexLexer::yyrestart(std::istream& input_file) { - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); + + if (! YY_CURRENT_BUFFER) + { + yyensure_buffer_stack(); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin, YY_BUF_SIZE); + } + + yy_init_buffer(YY_CURRENT_BUFFER, input_file); + yy_load_buffer_state(); } /** Delegate to the new version that takes an istream reference. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ -void yyFlexLexer::yyrestart( std::istream* input_file ) +void yyFlexLexer::yyrestart(std::istream* input_file) { - yyrestart( *input_file ); + if (! input_file) + { + input_file = &yyin; + } + + yyrestart(*input_file); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ - void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +void yyFlexLexer::yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) { - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; + yyensure_buffer_stack(); + + if (YY_CURRENT_BUFFER == new_buffer) + return; + + if (YY_CURRENT_BUFFER) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } - void yyFlexLexer::yy_load_buffer_state() +void yyFlexLexer::yy_load_buffer_state() { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) +YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream& file, int size) { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) CEvaluationalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof(struct yy_buffer_state)); - b->yy_buf_size = size; + if (! b) + YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) CEvaluationalloc((yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + b->yy_buf_size = size; - b->yy_is_our_buffer = 1; + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc((yy_size_t)(b->yy_buf_size + 2)); - yy_init_buffer( b, file ); + if (! b->yy_ch_buf) + YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - return b; + b->yy_is_our_buffer = 1; + + yy_init_buffer(b, file); + + return b; } /** Delegate creation of buffers to the new version that takes an istream reference. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) +YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream* file, int size) { - return yy_create_buffer( *file, size ); + return yy_create_buffer(*file, size); } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ - void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) +void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b) { - - if ( ! b ) - return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if (! b) + return; - if ( b->yy_is_our_buffer ) - CEvaluationfree((void *) b->yy_ch_buf ); + if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - CEvaluationfree((void *) b ); + if (b->yy_is_our_buffer) + yyfree((void *) b->yy_ch_buf); + + yyfree((void *) b); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file ) +void yyFlexLexer::yy_init_buffer(YY_BUFFER_STATE b, std::istream& file) { - int oerrno = errno; - - yy_flush_buffer( b ); + int oerrno = errno; - b->yy_input_file = file.rdbuf(); - b->yy_fill_buffer = 1; + yy_flush_buffer(b); - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; + b->yy_input_file = file.rdbuf(); + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER) + { + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; } - b->yy_is_interactive = 0; - errno = oerrno; + b->yy_is_interactive = 0; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) +void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b) { - if ( ! b ) - return; + if (! b) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + if (b == YY_CURRENT_BUFFER) + yy_load_buffer_state(); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) +void yyFlexLexer::yypush_buffer_state(YY_BUFFER_STATE new_buffer) { - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if (YY_CURRENT_BUFFER) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state(); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void yyFlexLexer::yypop_buffer_state (void) +void yyFlexLexer::yypop_buffer_state(void) { - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER); + YY_CURRENT_BUFFER_LVALUE = NULL; + + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) + { + yy_load_buffer_state(); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. @@ -2756,110 +2890,115 @@ void yyFlexLexer::yypop_buffer_state (void) */ void yyFlexLexer::yyensure_buffer_stack(void) { - int num_to_alloc; - - if (!(yy_buffer_stack)) { + yy_size_t num_to_alloc; - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ + if (!(yy_buffer_stack)) + { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)CEvaluationalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)CEvaluationrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) + { + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + if (!(yy_buffer_stack)) + YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } - void yyFlexLexer::yy_push_state( int _new_state ) +void yyFlexLexer::yy_push_state(int _new_state) { - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; + if ((yy_start_stack_ptr) >= (yy_start_stack_depth)) + { + yy_size_t new_size; - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_size_t)(yy_start_stack_depth) * sizeof(int); - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) CEvaluationalloc(new_size ); + if (!(yy_start_stack)) + (yy_start_stack) = (int *) yyalloc(new_size); - else - (yy_start_stack) = (int *) CEvaluationrealloc((void *) (yy_start_stack),new_size ); + else + (yy_start_stack) = (int *) yyrealloc( + (void *)(yy_start_stack), new_size); - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } + if (!(yy_start_stack)) + YY_FATAL_ERROR("out of memory expanding start-condition stack"); + } - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - BEGIN(_new_state); + BEGIN(_new_state); } - void yyFlexLexer::yy_pop_state() +void yyFlexLexer::yy_pop_state() { - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); + if (--(yy_start_stack_ptr) < 0) + YY_FATAL_ERROR("start-condition stack underflow"); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } - int yyFlexLexer::yy_top_state() +int yyFlexLexer::yy_top_state() { - return (yy_start_stack)[(yy_start_stack_ptr) - 1]; + return (yy_start_stack)[(yy_start_stack_ptr) - 1]; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif -void yyFlexLexer::LexerError( yyconst char* msg ) +void yyFlexLexer::LexerError(const char* msg) { - std::cerr << msg << std::endl; - exit( YY_EXIT_FAILURE ); + std::cerr << msg << std::endl; + exit(YY_EXIT_FAILURE); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yy_size_t yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + do \ + {\ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while (0) /* Accessor methods (get/set functions) to struct members. */ @@ -2868,52 +3007,51 @@ void yyFlexLexer::LexerError( yyconst char* msg ) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy(char* s1, const char * s2, int n) { - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; + + int i; + + for (i = 0; i < n; ++i) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen(const char * s) { - int n; - for ( n = 0; s[n]; ++n ) - ; + int n; + + for (n = 0; s[n]; ++n) + ; - return n; + return n; } #endif -void *CEvaluationalloc (yy_size_t size ) +void *yyalloc(yy_size_t size) { - return malloc(size); + return malloc(size); } -void *CEvaluationrealloc (void * ptr, yy_size_t size ) +void *yyrealloc(void * ptr, yy_size_t size) { - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); } -void CEvaluationfree (void * ptr ) +void yyfree(void * ptr) { - free( (char *) ptr ); /* see CEvaluationrealloc() for (char *) cast */ + free((char *) ptr); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 659 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" - - - +#line 643 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" diff --git a/copasi/function/CEvaluationNode.cpp b/copasi/function/CEvaluationNode.cpp index 8016caeaf6..bb1c2c0093 100644 --- a/copasi/function/CEvaluationNode.cpp +++ b/copasi/function/CEvaluationNode.cpp @@ -97,7 +97,6 @@ const CEnumAnnotation< std::string, CEvaluationNode::SubType > CEvaluationNode:: "Ge", "Gt", "If", - "Implies", // IMPLIES "Infinity", "Integer", "Invalid", @@ -121,7 +120,6 @@ const CEnumAnnotation< std::string, CEvaluationNode::SubType > CEvaluationNode:: "Power", "Rationale", "Remainder", - "Quotient", // QUOTIENT "Rgamma", "Rnormal", "Rpoisson", @@ -588,7 +586,7 @@ CEvaluationNode* CEvaluationNode::simplifyNode(const std::vector::const_iterator itTargetUnit = targetUnits.find(const_cast< CEvaluationNode * >(this)); std::map < CEvaluationNode *, CValidatedUnit >::const_iterator itCurrentUnit = currentUnits.find(const_cast< CEvaluationNode * >(this)); - if (itTargetUnit == targetUnits.end() || itCurrentUnit == currentUnits.end()) - return CValidatedUnit(); - CValidatedUnit Result(CValidatedUnit::merge(itTargetUnit->second, itCurrentUnit->second)); if (Result.conflict() && diff --git a/copasi/function/CEvaluationNode.h b/copasi/function/CEvaluationNode.h index 6028e14543..c2e8eea18c 100644 --- a/copasi/function/CEvaluationNode.h +++ b/copasi/function/CEvaluationNode.h @@ -104,7 +104,6 @@ class CEvaluationNode : public CCopasiNode< std::string > EXP, True, XOR, - IMPLIES, RATIONALE, AND, CLOSE, @@ -121,7 +120,6 @@ class CEvaluationNode : public CCopasiNode< std::string > NE, TAN, REMAINDER, - QUOTIENT, GT, SEC, CSC, @@ -371,7 +369,7 @@ class CEvaluationNode : public CCopasiNode< std::string > * Create a new invalid ASTNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode* toAST(const CDataModel* pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; /** * Copy a node and assign new children child1 and child2 diff --git a/copasi/function/CEvaluationNodeCall.cpp b/copasi/function/CEvaluationNodeCall.cpp index 63849760b3..d98d9507b9 100644 --- a/copasi/function/CEvaluationNodeCall.cpp +++ b/copasi/function/CEvaluationNodeCall.cpp @@ -462,7 +462,7 @@ CEvaluationNode * CEvaluationNodeCall::fromAST(const ASTNode * pASTNode, const s return pNode; } -ASTNode * CEvaluationNodeCall::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationNodeCall::toAST(const CDataModel* pDataModel) const { ASTNode* pNode = NULL; @@ -479,7 +479,7 @@ ASTNode * CEvaluationNodeCall::toAST(const CDataModel * pDataModel, int sbmlLeve while (child) { - pNode->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + pNode->addChild(child->toAST(pDataModel)); child = static_cast(child->getSibling()); } diff --git a/copasi/function/CEvaluationNodeCall.h b/copasi/function/CEvaluationNodeCall.h index 2505c131c6..7230bd7013 100644 --- a/copasi/function/CEvaluationNodeCall.h +++ b/copasi/function/CEvaluationNodeCall.h @@ -172,7 +172,7 @@ class CEvaluationNodeCall : public CEvaluationNode * Create a new ASTNode corresponding to this choice node. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Add a child to a node. diff --git a/copasi/function/CEvaluationNodeChoice.cpp b/copasi/function/CEvaluationNodeChoice.cpp index b911d48f64..2f96352a3b 100644 --- a/copasi/function/CEvaluationNodeChoice.cpp +++ b/copasi/function/CEvaluationNodeChoice.cpp @@ -256,7 +256,7 @@ CEvaluationNode * CEvaluationNodeChoice::fromAST(const ASTNode * pASTNode, const return pNode; } -ASTNode * CEvaluationNodeChoice::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationNodeChoice::toAST(const CDataModel* pDataModel) const { ASTNode* node = new ASTNode(AST_FUNCTION_PIECEWISE); const CEvaluationNode* child1 = dynamic_cast(this->getChild()); @@ -267,9 +267,9 @@ ASTNode * CEvaluationNodeChoice::toAST(const CDataModel * pDataModel, int sbmlLe assert(child3 != NULL); // the condition is the second child to the AST node but the first child in // the CEvaluationNode - node->addChild(child2->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(child1->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(child3->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child2->toAST(pDataModel)); + node->addChild(child1->toAST(pDataModel)); + node->addChild(child3->toAST(pDataModel)); return node; } diff --git a/copasi/function/CEvaluationNodeChoice.h b/copasi/function/CEvaluationNodeChoice.h index 0f0686067c..5b006b3310 100644 --- a/copasi/function/CEvaluationNodeChoice.h +++ b/copasi/function/CEvaluationNodeChoice.h @@ -124,7 +124,7 @@ class CEvaluationNodeChoice : public CEvaluationNode * Create a new ASTNode corresponding to this choice node. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeConstant.cpp b/copasi/function/CEvaluationNodeConstant.cpp index aff8ac6c0d..84433dc906 100644 --- a/copasi/function/CEvaluationNodeConstant.cpp +++ b/copasi/function/CEvaluationNodeConstant.cpp @@ -230,7 +230,7 @@ CEvaluationNode * CEvaluationNodeConstant::fromAST(const ASTNode * pASTNode, con return new CEvaluationNodeConstant(subType, data); } -ASTNode* CEvaluationNodeConstant::toAST(const CDataModel* /*pDataModel*/, int, int) const +ASTNode* CEvaluationNodeConstant::toAST(const CDataModel* /*pDataModel*/) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); diff --git a/copasi/function/CEvaluationNodeConstant.h b/copasi/function/CEvaluationNodeConstant.h index fef50760bf..a0573947f3 100644 --- a/copasi/function/CEvaluationNodeConstant.h +++ b/copasi/function/CEvaluationNodeConstant.h @@ -97,7 +97,7 @@ class CEvaluationNodeConstant : public CEvaluationNode * Create a new ASTNode corresponding to this ConstantNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeDelay.cpp b/copasi/function/CEvaluationNodeDelay.cpp index 56997f9579..c4a74c50b5 100644 --- a/copasi/function/CEvaluationNodeDelay.cpp +++ b/copasi/function/CEvaluationNodeDelay.cpp @@ -232,14 +232,14 @@ CEvaluationNode * CEvaluationNodeDelay::fromAST(const ASTNode * pASTNode, const return pConvertedNode; } -ASTNode * CEvaluationNodeDelay::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion ) const +ASTNode* CEvaluationNodeDelay::toAST(const CDataModel* pDataModel) const { ASTNode* pNode = new ASTNode(AST_FUNCTION_DELAY); const CEvaluationNode* child = static_cast(this->getChild()); while (child) { - pNode->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + pNode->addChild(child->toAST(pDataModel)); child = static_cast(child->getSibling()); } diff --git a/copasi/function/CEvaluationNodeDelay.h b/copasi/function/CEvaluationNodeDelay.h index 1c3d09dce1..c300a1c2de 100644 --- a/copasi/function/CEvaluationNodeDelay.h +++ b/copasi/function/CEvaluationNodeDelay.h @@ -120,7 +120,7 @@ class CEvaluationNodeDelay : public CEvaluationNode * Create a new ASTNode corresponding to this delay node. * @return ASTNode* return a pointer to the newly created node; */ - ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeFunction.cpp b/copasi/function/CEvaluationNodeFunction.cpp index 2a7ec9a771..9b3c7030f0 100644 --- a/copasi/function/CEvaluationNodeFunction.cpp +++ b/copasi/function/CEvaluationNodeFunction.cpp @@ -29,7 +29,6 @@ #include "CEvaluationNode.h" #include "CEvaluationTree.h" #include "copasi/utilities/CValidatedUnit.h" -#include "copasi/utilities/CBalanceTree.h" #include "copasi/randomGenerator/CRandom.h" @@ -61,55 +60,22 @@ C_FLOAT64 CEvaluationNodeFunction::rpoisson(C_FLOAT64 mu) } // static -C_FLOAT64 CEvaluationNodeFunction::max(CEvaluationNodeFunction * pNode) +C_FLOAT64 CEvaluationNodeFunction::max(C_FLOAT64 x1, C_FLOAT64 x2) { - return pNode->max(); -} - -C_FLOAT64 CEvaluationNodeFunction::max() -{ - CEvaluationNode * pChild = static_cast< CEvaluationNode * >(getChild()); - - if (pChild == nullptr) - return std::numeric_limits< C_FLOAT64 >::quiet_NaN(); - - C_FLOAT64 Result = *pChild->getValuePointer(); - - while ((pChild = static_cast(pChild->getSibling())) != nullptr) - if (Result < *pChild->getValuePointer()) - Result = *pChild->getValuePointer(); - - return Result; + return std::max(x1, x2); } // static -C_FLOAT64 CEvaluationNodeFunction::min(CEvaluationNodeFunction * pNode) -{ - return pNode->min(); -} - -C_FLOAT64 CEvaluationNodeFunction::min() +C_FLOAT64 CEvaluationNodeFunction::min(C_FLOAT64 x1, C_FLOAT64 x2) { - CEvaluationNode * pChild = static_cast< CEvaluationNode * >(getChild()); - - if (pChild == nullptr) - return std::numeric_limits< C_FLOAT64 >::quiet_NaN(); - - C_FLOAT64 Result = *pChild->getValuePointer(); - - while ((pChild = static_cast(pChild->getSibling())) != nullptr) - if (Result > *pChild->getValuePointer()) - Result = *pChild->getValuePointer(); - - return Result; + return std::min(x1, x2); } CEvaluationNodeFunction::CEvaluationNodeFunction(): CEvaluationNode(MainType::FUNCTION, SubType::INVALID, ""), - mpFunction1(NULL), + mpFunction(NULL), mpFunction2(NULL), mpFunction4(NULL), - mpFunction(NULL), mpArgNode1(NULL), mpArgNode2(NULL), mpArgNode3(NULL), @@ -125,10 +91,9 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(): CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, const Data & data): CEvaluationNode(MainType::FUNCTION, subType, data), - mpFunction1(NULL), + mpFunction(NULL), mpFunction2(NULL), mpFunction4(NULL), - mpFunction(NULL), mpArgNode1(NULL), mpArgNode2(NULL), mpArgNode3(NULL), @@ -143,147 +108,147 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, switch (subType) { case SubType::LOG: - mpFunction1 = log; + mpFunction = log; break; case SubType::LOG10: - mpFunction1 = log10; + mpFunction = log10; break; case SubType::EXP: - mpFunction1 = exp; + mpFunction = exp; break; case SubType::SIN: - mpFunction1 = sin; + mpFunction = sin; break; case SubType::COS: - mpFunction1 = cos; + mpFunction = cos; break; case SubType::TAN: - mpFunction1 = tan; + mpFunction = tan; break; case SubType::SEC: - mpFunction1 = sec; + mpFunction = sec; break; case SubType::CSC: - mpFunction1 = csc; + mpFunction = csc; break; case SubType::COT: - mpFunction1 = cot; + mpFunction = cot; break; case SubType::SINH: - mpFunction1 = sinh; + mpFunction = sinh; break; case SubType::COSH: - mpFunction1 = cosh; + mpFunction = cosh; break; case SubType::TANH: - mpFunction1 = tanh; + mpFunction = tanh; break; case SubType::SECH: - mpFunction1 = sech; + mpFunction = sech; break; case SubType::CSCH: - mpFunction1 = csch; + mpFunction = csch; break; case SubType::COTH: - mpFunction1 = coth; + mpFunction = coth; break; case SubType::ARCSIN: - mpFunction1 = asin; + mpFunction = asin; break; case SubType::ARCCOS: - mpFunction1 = acos; + mpFunction = acos; break; case SubType::ARCTAN: - mpFunction1 = atan; + mpFunction = atan; break; case SubType::ARCSEC: - mpFunction1 = arcsec; + mpFunction = arcsec; break; case SubType::ARCCSC: - mpFunction1 = arccsc; + mpFunction = arccsc; break; case SubType::ARCCOT: - mpFunction1 = arccot; + mpFunction = arccot; break; case SubType::ARCSINH: - mpFunction1 = asinh; + mpFunction = asinh; break; case SubType::ARCCOSH: - mpFunction1 = acosh; + mpFunction = acosh; break; case SubType::ARCTANH: - mpFunction1 = atanh; + mpFunction = atanh; break; case SubType::ARCSECH: - mpFunction1 = asech; + mpFunction = asech; break; case SubType::ARCCSCH: - mpFunction1 = acsch; + mpFunction = acsch; break; case SubType::ARCCOTH: - mpFunction1 = acoth; + mpFunction = acoth; break; case SubType::SIGN: - mpFunction1 = sign; + mpFunction = sign; break; case SubType::SQRT: - mpFunction1 = sqrt; + mpFunction = sqrt; break; case SubType::ABS: - mpFunction1 = fabs; + mpFunction = fabs; break; case SubType::FLOOR: - mpFunction1 = floor; + mpFunction = floor; break; case SubType::CEIL: - mpFunction1 = ceil; + mpFunction = ceil; break; case SubType::FACTORIAL: - mpFunction1 = factorial; + mpFunction = factorial; break; case SubType::MINUS: - mpFunction1 = minus; + mpFunction = minus; break; case SubType::PLUS: - mpFunction1 = plus; + mpFunction = plus; break; case SubType::NOT: - mpFunction1 = copasiNot; + mpFunction = copasiNot; break; case SubType::RUNIFORM: @@ -303,7 +268,7 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, break; case SubType::RPOISSON: - mpFunction1 = rpoisson; + mpFunction = rpoisson; if (!mpRandom) mpRandom = CRandom::createGenerator(); @@ -319,15 +284,15 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, break; case SubType::MAX: - mpFunction = max; + mpFunction2 = max; break; case SubType::MIN: - mpFunction = min; + mpFunction2 = min; break; default: - mpFunction1 = NULL; + mpFunction = NULL; fatalError(); break; } @@ -337,7 +302,7 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, CEvaluationNodeFunction::CEvaluationNodeFunction(const CEvaluationNodeFunction & src): CEvaluationNode(src), - mpFunction1(src.mpFunction1), + mpFunction(src.mpFunction), mpFunction2(src.mpFunction2), mpFunction4(src.mpFunction4), mpArgNode1(src.mpArgNode1), @@ -364,9 +329,6 @@ CIssue CEvaluationNodeFunction::compile() success &= mpArgNode1->setValueType(mValueType); if (mpFunction) - return CIssue::Success; - - if (mpFunction1) { if (mpArgNode1->getSibling() == NULL) return CIssue::Success; @@ -423,18 +385,9 @@ std::string CEvaluationNodeFunction::getInfix(const std::vector< std::string > & case SubType::RUNIFORM: case SubType::RNORMAL: case SubType::RGAMMA: - return mData + "(" + children[0] + "," + children[1] + ")"; - case SubType::MAX: case SubType::MIN: - { - std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) - { - return first + "," + second; - }); - - return mData + "(" + Arguments + ")"; - } + return mData + "(" + children[0] + "," + children[1] + ")"; case SubType::RPOISSON: return mData + "(" + children[0] + ")"; @@ -462,18 +415,9 @@ std::string CEvaluationNodeFunction::getDisplayString(const std::vector< std::st case SubType::RUNIFORM: case SubType::RNORMAL: case SubType::RGAMMA: - return mData + "(" + children[0] + "," + children[1] + ")"; - case SubType::MAX: case SubType::MIN: - { - std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) - { - return first + "," + second; - }); - - return mData + "(" + Arguments + ")"; - } + return mData + "(" + children[0] + "," + children[1] + ")"; case SubType::RPOISSON: return mData + "(" + children[0] + ")"; @@ -679,18 +623,9 @@ std::string CEvaluationNodeFunction::getCCodeString(const std::vector< std::stri case SubType::RUNIFORM: case SubType::RNORMAL: case SubType::RGAMMA: - return data + "(" + children[0] + "," + children[1] + ")"; - case SubType::MAX: case SubType::MIN: - { - std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) - { - return first + "," + second; - }); - - return mData + "(" + Arguments + ")"; - } + return data + "(" + children[0] + "," + children[1] + ")"; default: return data + "(" + children[0] + ")"; @@ -780,18 +715,9 @@ std::string CEvaluationNodeFunction::getBerkeleyMadonnaString(const std::vector< case SubType::RUNIFORM: case SubType::RNORMAL: case SubType::RGAMMA: - return data + "(" + children[0] + "," + children[1] + ")"; - case SubType::MAX: case SubType::MIN: - { - std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) - { - return first + "," + second; - }); - - return mData + "(" + Arguments + ")"; - } + return data + "(" + children[0] + "," + children[1] + ")"; default: return data + "(" + children[0] + ")"; @@ -883,18 +809,9 @@ std::string CEvaluationNodeFunction::getXPPString(const std::vector< std::string case SubType::RUNIFORM: case SubType::RNORMAL: case SubType::RGAMMA: - return data + "(" + children[0] + "," + children[1] + ")"; - case SubType::MAX: case SubType::MIN: - { - std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) - { - return first + "," + second; - }); - - return mData + "(" + Arguments + ")"; - } + return data + "(" + children[0] + "," + children[1] + ")"; default: return data + "(" + children[0] + ")"; @@ -918,7 +835,6 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con std::string data = ""; bool allowTwo = false; - bool allowN = false; if (type == AST_FUNCTION_ROOT) { @@ -1145,14 +1061,12 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con subType = SubType::MAX; data = "max"; allowTwo = iMax == 2; - allowN = true; break; case AST_FUNCTION_MIN: subType = SubType::MIN; data = "min"; allowTwo = iMax == 2; - allowN = true; break; default: @@ -1161,7 +1075,7 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con break; } - if (!allowTwo && !allowN) + if (!allowTwo) { assert(iMax == 1); } @@ -1170,20 +1084,16 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con if (!children.empty()) { - int maxChildren = - allowN ? children.size() : allowTwo ? 2 - : 1; + pNode->addChild(children[0]); - for (int i = 0; i < maxChildren; ++i) - { - pNode->addChild(children[i]); - } + if (allowTwo) + pNode->addChild(children[1]); } return pNode; } -ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); @@ -1340,7 +1250,7 @@ ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbml // the node will be replaced by its only child needFirstArg = false; delete node; - node = dynamic_cast(this->getChild())->toAST(pDataModel, sbmlLevel, sbmlVersion); + node = dynamic_cast(this->getChild())->toAST(pDataModel); break; case SubType::NOT: @@ -1354,8 +1264,8 @@ ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbml node->setName("RUNIFORM"); const CEvaluationNode* child = dynamic_cast(this->getChild()); const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child->toAST(pDataModel)); + node->addChild(sibling->toAST(pDataModel)); } break; @@ -1366,8 +1276,8 @@ ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbml node->setName("RNORMAL"); const CEvaluationNode* child = dynamic_cast(this->getChild()); const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child->toAST(pDataModel)); + node->addChild(sibling->toAST(pDataModel)); } break; @@ -1378,8 +1288,8 @@ ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbml node->setName("RGAMMA"); const CEvaluationNode* child = dynamic_cast(this->getChild()); const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child->toAST(pDataModel)); + node->addChild(sibling->toAST(pDataModel)); } break; @@ -1389,57 +1299,31 @@ ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbml node->setType(AST_FUNCTION); node->setName("RPOISSON"); const CEvaluationNode* child = dynamic_cast(this->getChild()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child->toAST(pDataModel)); } break; case SubType::MAX: - { - needFirstArg = false; - if (sbmlLevel == 3 && sbmlVersion > 1) - { - node->setType(AST_FUNCTION_MAX); - const CEvaluationNode * child = dynamic_cast< const CEvaluationNode * >(this->getChild()); - while (child != NULL) - { - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - child = dynamic_cast< const CEvaluationNode * > (child->getSibling()); - } - } - else - { - node->setType(AST_FUNCTION); - node->setName("MAX"); - const CEvaluationNode * child = dynamic_cast< const CEvaluationNode * >(this->getChild()); - const CEvaluationNode * sibling = dynamic_cast< const CEvaluationNode * >(child->getSibling()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); - } + { + needFirstArg = false; + node->setType(AST_FUNCTION); + node->setName("MAX"); + const CEvaluationNode* child = dynamic_cast(this->getChild()); + const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); + node->addChild(child->toAST(pDataModel)); + node->addChild(sibling->toAST(pDataModel)); } break; case SubType::MIN: { needFirstArg = false; - if (sbmlLevel == 3 && sbmlVersion > 1) - { - node->setType(AST_FUNCTION_MIN); - const CEvaluationNode * child = dynamic_cast< const CEvaluationNode * >(this->getChild()); - while (child != NULL) - { - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - child = dynamic_cast< const CEvaluationNode * >(child->getSibling()); - } - } - else - { - node->setType(AST_FUNCTION); - node->setName("MIN"); - const CEvaluationNode * child = dynamic_cast< const CEvaluationNode * >(this->getChild()); - const CEvaluationNode * sibling = dynamic_cast< const CEvaluationNode * >(child->getSibling()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); - } + node->setType(AST_FUNCTION); + node->setName("MIN"); + const CEvaluationNode* child = dynamic_cast(this->getChild()); + const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); + node->addChild(child->toAST(pDataModel)); + node->addChild(sibling->toAST(pDataModel)); } break; // :TODO: Bug 894: Implement me. @@ -1465,7 +1349,7 @@ ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbml if (needFirstArg) { const CEvaluationNode* child = dynamic_cast(this->getChild()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child->toAST(pDataModel)); } } @@ -1911,6 +1795,8 @@ std::string CEvaluationNodeFunction::getMMLString(const std::vector< std::string case SubType::RUNIFORM: case SubType::RNORMAL: case SubType::RGAMMA: + case SubType::MAX: + case SubType::MIN: out << "" << std::endl; out << "" << mData << "" << std::endl; @@ -1931,28 +1817,6 @@ std::string CEvaluationNodeFunction::getMMLString(const std::vector< std::string out << "" << std::endl; break; - case SubType::MAX: - case SubType::MIN: - out << "" << std::endl; - - out << "" << mData << "" << std::endl; - out << "" << std::endl; - out << "(" << std::endl; - - { - std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) - { - return "\n" + first + " , \n" + second + "\n"; - }); - - out << Arguments; - } - - out << ") " << std::endl; - out << "" << std::endl; - out << "" << std::endl; - break; - case SubType::RPOISSON: out << "" << std::endl; diff --git a/copasi/function/CEvaluationNodeFunction.h b/copasi/function/CEvaluationNodeFunction.h index 5f4ff05b52..411a94ea32 100644 --- a/copasi/function/CEvaluationNodeFunction.h +++ b/copasi/function/CEvaluationNodeFunction.h @@ -89,9 +89,9 @@ class CEvaluationNodeFunction : public CEvaluationNode */ virtual inline void calculate() override { - if (mpFunction1) + if (mpFunction) { - mValue = (*mpFunction1)(*mpArgValue1); + mValue = (*mpFunction)(*mpArgValue1); } else if (mpFunction2) { @@ -101,10 +101,6 @@ class CEvaluationNodeFunction : public CEvaluationNode { mValue = (*mpFunction4)(*mpArgValue1, *mpArgValue2, *mpArgValue3, *mpArgValue4); } - else if (mpFunction) - { - mValue = (*mpFunction)(this); - } } /** @@ -180,7 +176,7 @@ class CEvaluationNodeFunction : public CEvaluationNode * Create a new ASTNode corresponding to this FunctionNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Create a simplified node for an operatorNode with children from vector (if not exist, = NULL), @@ -286,17 +282,15 @@ class CEvaluationNodeFunction : public CEvaluationNode static C_FLOAT64 rpoisson(C_FLOAT64 mu); - static C_FLOAT64 max(CEvaluationNodeFunction * pNode); + static C_FLOAT64 max(C_FLOAT64 x1, + C_FLOAT64 x2); - static C_FLOAT64 min(CEvaluationNodeFunction * pNode); + static C_FLOAT64 min(C_FLOAT64 x1, + C_FLOAT64 x2); // Attributes private: - C_FLOAT64 max(); - - C_FLOAT64 min(); - - C_FLOAT64(*mpFunction1)(C_FLOAT64 arg1); + C_FLOAT64(*mpFunction)(C_FLOAT64 arg1); C_FLOAT64(*mpFunction2)(C_FLOAT64 arg1, C_FLOAT64 arg2); @@ -306,8 +300,6 @@ class CEvaluationNodeFunction : public CEvaluationNode C_FLOAT64 arg3, C_FLOAT64 arg4); - C_FLOAT64(*mpFunction)(CEvaluationNodeFunction * pNode); - CEvaluationNode * mpArgNode1; CEvaluationNode * mpArgNode2; CEvaluationNode * mpArgNode3; diff --git a/copasi/function/CEvaluationNodeLogical.cpp b/copasi/function/CEvaluationNodeLogical.cpp index e9746fc94c..94a88cd14d 100644 --- a/copasi/function/CEvaluationNodeLogical.cpp +++ b/copasi/function/CEvaluationNodeLogical.cpp @@ -60,10 +60,6 @@ CEvaluationNodeLogical::CEvaluationNodeLogical(const SubType & subType, mPrecedence = PRECEDENCE_LOGIG_XOR; break; - case SubType::IMPLIES: - mPrecedence = PRECEDENCE_LOGIG_XOR; - break; - case SubType::AND: mPrecedence = PRECEDENCE_LOGIG_AND; break; @@ -129,7 +125,6 @@ CIssue CEvaluationNodeLogical::compile() case SubType::OR: case SubType::XOR: case SubType::AND: - case SubType::IMPLIES: Result &= mpLeftNode->setValueType(ValueType::Boolean); Result &= mpRightNode->setValueType(ValueType::Boolean); break; @@ -429,7 +424,6 @@ CValidatedUnit CEvaluationNodeLogical::getUnit(const CMathContainer & /* contain case SubType::OR: case SubType::XOR: case SubType::AND: - case SubType::IMPLIES: if (!(units[0] == CBaseUnit::dimensionless) || !(units[1] == CBaseUnit::dimensionless)) { @@ -466,7 +460,6 @@ CValidatedUnit CEvaluationNodeLogical::setUnit(const CMathContainer & container, case SubType::OR: case SubType::XOR: case SubType::AND: - case SubType::IMPLIES: targetUnits[mpLeftNode] = CValidatedUnit(CBaseUnit::dimensionless, false); targetUnits[mpRightNode] = CValidatedUnit(CBaseUnit::dimensionless, false); break; @@ -514,11 +507,6 @@ CEvaluationNode * CEvaluationNodeLogical::fromAST(const ASTNode * pASTNode, cons data = "or"; break; - case AST_LOGICAL_IMPLIES: - subType = SubType::IMPLIES; - data = "implies"; - break; - case AST_LOGICAL_XOR: subType = SubType::XOR; data = "xor"; @@ -600,7 +588,6 @@ CEvaluationNode * CEvaluationNodeLogical::fromAST(const ASTNode * pASTNode, cons case SubType::GT: case SubType::LE: case SubType::LT: - case SubType::IMPLIES: // all these are binary assert(iMax == 2); pNode = new CEvaluationNodeLogical(subType, data); @@ -616,7 +603,7 @@ CEvaluationNode * CEvaluationNodeLogical::fromAST(const ASTNode * pASTNode, cons return pNode; } -ASTNode * CEvaluationNodeLogical::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationNodeLogical::toAST(const CDataModel* pDataModel) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); @@ -635,10 +622,6 @@ ASTNode * CEvaluationNodeLogical::toAST(const CDataModel * pDataModel, int sbmlL node->setType(AST_LOGICAL_XOR); break; - case SubType::IMPLIES: - node->setType(AST_LOGICAL_IMPLIES); - break; - case SubType::EQ: node->setType(AST_RELATIONAL_EQ); break; @@ -675,8 +658,8 @@ ASTNode * CEvaluationNodeLogical::toAST(const CDataModel * pDataModel, int sbmlL { const CEvaluationNode* child1 = dynamic_cast(this->getChild()); const CEvaluationNode* child2 = dynamic_cast(child1->getSibling()); - node->addChild(child1->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(child2->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child1->toAST(pDataModel)); + node->addChild(child2->toAST(pDataModel)); } return node; @@ -710,10 +693,6 @@ std::string CEvaluationNodeLogical::getMMLString(const std::vector< std::string data = " xor "; break; - case SubType::IMPLIES: - data = " implies "; - break; - case SubType::EQ: data = "="; break; diff --git a/copasi/function/CEvaluationNodeLogical.h b/copasi/function/CEvaluationNodeLogical.h index 6b6c0c698b..4e501cf3bd 100644 --- a/copasi/function/CEvaluationNodeLogical.h +++ b/copasi/function/CEvaluationNodeLogical.h @@ -82,10 +82,6 @@ class CEvaluationNodeLogical : public CEvaluationNode (*mpLeftValue < 0.5 && *mpRightValue > 0.5)) ? 1.0 : 0.0; break; - case SubType::IMPLIES: - mValue = (*mpLeftValue < 0.5 || *mpRightValue > 0.5) ? 1.0 : 0.0; - break; - case SubType::AND: mValue = (*mpLeftValue > 0.5 && *mpRightValue > 0.5) ? 1.0 : 0.0; @@ -193,7 +189,7 @@ class CEvaluationNodeLogical : public CEvaluationNode * Create a new ASTNode corresponding to this OperatorNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeNumber.cpp b/copasi/function/CEvaluationNodeNumber.cpp index fab14323fa..d666573d3d 100644 --- a/copasi/function/CEvaluationNodeNumber.cpp +++ b/copasi/function/CEvaluationNodeNumber.cpp @@ -228,7 +228,7 @@ CEvaluationNode * CEvaluationNodeNumber::fromAST(const ASTNode * pASTNode, const return pNode; } -ASTNode* CEvaluationNodeNumber::toAST(const CDataModel* /* pDataModel */, int, int) const +ASTNode* CEvaluationNodeNumber::toAST(const CDataModel* /* pDataModel */) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); diff --git a/copasi/function/CEvaluationNodeNumber.h b/copasi/function/CEvaluationNodeNumber.h index a22e666180..67504aa9a5 100644 --- a/copasi/function/CEvaluationNodeNumber.h +++ b/copasi/function/CEvaluationNodeNumber.h @@ -72,7 +72,7 @@ class CEvaluationNodeNumber : public CEvaluationNode * Create a new ASTNode corresponding to this NumberNode. * @return ASTNode* return a pointer to the newly created node; */ - ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + ASTNode* toAST(const CDataModel* pDataModel) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeObject.cpp b/copasi/function/CEvaluationNodeObject.cpp index bf868ab0f2..724dc509a1 100644 --- a/copasi/function/CEvaluationNodeObject.cpp +++ b/copasi/function/CEvaluationNodeObject.cpp @@ -444,34 +444,24 @@ CEvaluationNode * CEvaluationNodeObject::fromAST(const ASTNode * pASTNode, const return pNode; } -ASTNode * CEvaluationNodeObject::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationNodeObject::toAST(const CDataModel* pDataModel) const { ASTNode* node = new ASTNode(); node->setType(AST_NAME); if (mRegisteredObjectCN == "rateOf" || mData == "") { - const CEvaluationNode * child = dynamic_cast< const CEvaluationNode * >(this->getChild()); - if (child == NULL) - fatalError(); + node->setType(AST_FUNCTION); + const CEvaluationNode* child = dynamic_cast(this->getChild()); - if (sbmlLevel == 3 && sbmlVersion > 1) - { - node->setType(AST_FUNCTION_RATE_OF); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - } - else - { - node->setType(AST_FUNCTION); + if (child == NULL) fatalError(); - const CEvaluationNodeObject * sibling = dynamic_cast< const CEvaluationNodeObject * >(this->getChild()->getSibling()); + const CEvaluationNodeObject* sibling = dynamic_cast(this->getChild()->getSibling()); - if (sibling == NULL) - fatalError(); + if (sibling == NULL) fatalError(); - node->setName(sibling->getObjectCN().c_str()); - node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); - } + node->setName(sibling->getObjectCN().c_str()); + node->addChild(child->toAST(pDataModel)); return node; } diff --git a/copasi/function/CEvaluationNodeObject.h b/copasi/function/CEvaluationNodeObject.h index 9e09757e17..7ba323035d 100644 --- a/copasi/function/CEvaluationNodeObject.h +++ b/copasi/function/CEvaluationNodeObject.h @@ -156,7 +156,7 @@ class CEvaluationNodeObject : public CEvaluationNode * Converts this node to an ASTNode. * @return ASTNode the resulting ASTNode. */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Retrieve the CN of the referred object. diff --git a/copasi/function/CEvaluationNodeOperator.cpp b/copasi/function/CEvaluationNodeOperator.cpp index 67b8f60ae7..0ba793459e 100644 --- a/copasi/function/CEvaluationNodeOperator.cpp +++ b/copasi/function/CEvaluationNodeOperator.cpp @@ -92,11 +92,6 @@ CEvaluationNodeOperator::CEvaluationNodeOperator(const SubType & subType, mpOperator = &CEvaluationNodeOperator::s_remainder; break; - case SubType::QUOTIENT: - mPrecedence = PRECEDENCE_OPERATOR_REMAINDER; - mpOperator = &CEvaluationNodeOperator::s_quotient; - break; - default: break; } @@ -183,13 +178,6 @@ void CEvaluationNodeOperator::s_remainder() mValue = fmod(*mpLeftValue, *mpRightValue); } -void CEvaluationNodeOperator::s_quotient() -{ - // Definition: A = quotient * B + remainder - // => quotient = (A - remainder)/B - mValue = (*mpLeftValue - fmod(*mpLeftValue, *mpRightValue)) / *mpRightValue; -} - void CEvaluationNodeOperator::s_invalid() { mValue = std::numeric_limits< C_FLOAT64 >::quiet_NaN(); @@ -207,16 +195,14 @@ std::string CEvaluationNodeOperator::getInfix(const std::vector< std::string > & else Infix = children[0]; - if (SubType::REMAINDER == mSubType - || SubType::QUOTIENT == mSubType) + if (SubType::REMAINDER == (mSubType)) { Infix += " "; } Infix += mData; - if (SubType::REMAINDER == mSubType - || SubType::QUOTIENT == mSubType) + if (SubType::REMAINDER == (mSubType)) { Infix += " "; } @@ -244,16 +230,14 @@ std::string CEvaluationNodeOperator::getDisplayString(const std::vector< std::st else DisplayString = children[0]; - if (SubType::REMAINDER == mSubType - || SubType::QUOTIENT == mSubType) + if (SubType::REMAINDER == (mSubType)) { DisplayString += " "; } DisplayString += mData; - if (SubType::REMAINDER == mSubType - || SubType::QUOTIENT == mSubType) + if (SubType::REMAINDER == (mSubType)) { DisplayString += " "; } @@ -283,9 +267,6 @@ std::string CEvaluationNodeOperator::getCCodeString(const std::vector< std::stri if (subType == SubType::REMAINDER) DisplayString = "fmod("; - if (subType == SubType::QUOTIENT) - DisplayString = "(int)("; - if (subType == SubType::MODULUS) DisplayString = "(int)"; @@ -298,7 +279,6 @@ std::string CEvaluationNodeOperator::getCCodeString(const std::vector< std::stri { case SubType::POWER: case SubType::REMAINDER: - case SubType::QUOTIENT: DisplayString += ","; break; @@ -317,8 +297,7 @@ std::string CEvaluationNodeOperator::getCCodeString(const std::vector< std::stri DisplayString += children[1]; if (subType == SubType::POWER || - subType == SubType::REMAINDER || - subType == SubType::QUOTIENT) + subType == SubType::REMAINDER) DisplayString += ")"; return DisplayString; @@ -371,9 +350,6 @@ std::string CEvaluationNodeOperator::getXPPString(const std::vector< std::string subType == SubType::REMAINDER) DisplayString = "mod("; - if (subType == SubType::QUOTIENT) - DisplayString = "flr("; - if (*mpLeftNode < * (CEvaluationNode *)this) DisplayString += "(" + children[0] + ")"; else @@ -386,10 +362,6 @@ std::string CEvaluationNodeOperator::getXPPString(const std::vector< std::string DisplayString += ","; break; - case SubType::QUOTIENT: - DisplayString += "/"; - break; - default: DisplayString += mData; break; @@ -401,8 +373,7 @@ std::string CEvaluationNodeOperator::getXPPString(const std::vector< std::string DisplayString += children[1]; if (subType == SubType::MODULUS || - subType == SubType::REMAINDER || - subType == SubType::QUOTIENT) + subType == SubType::REMAINDER) DisplayString += ")"; return DisplayString; @@ -451,17 +422,11 @@ CEvaluationNode * CEvaluationNodeOperator::fromAST(const ASTNode * pASTNode, con data = "^"; break; - case AST_FUNCTION_QUOTIENT: - subType = SubType::QUOTIENT; - data = "quot"; - break; - case AST_FUNCTION_REM: subType = SubType::REMAINDER; - data = "%"; + data = "mod"; break; - default: subType = SubType::INVALID; fatalError(); @@ -494,7 +459,7 @@ CEvaluationNode * CEvaluationNodeOperator::fromAST(const ASTNode * pASTNode, con } } // handle binary operators (POWER,/) - else if (type == AST_DIVIDE || type == AST_POWER || type == AST_FUNCTION_POWER || type == AST_FUNCTION_REM || type == AST_FUNCTION_QUOTIENT) + else if (type == AST_DIVIDE || type == AST_POWER || type == AST_FUNCTION_POWER || type == AST_FUNCTION_REM) { switch (pASTNode->getNumChildren()) { @@ -540,11 +505,10 @@ CEvaluationNode * CEvaluationNodeOperator::fromAST(const ASTNode * pASTNode, con return pNode; } -ASTNode * CEvaluationNodeOperator::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationNodeOperator::toAST(const CDataModel* pDataModel) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); - bool skipChildren = false; switch (subType) { @@ -563,19 +527,7 @@ ASTNode * CEvaluationNodeOperator::toAST(const CDataModel * pDataModel, int sbml case SubType::MODULUS: case SubType::REMAINDER: // replace this with a more complex subtree - if (sbmlLevel == 3 && sbmlVersion > 1) - { - node->setType(AST_FUNCTION_REM); - } - else - { - CEvaluationNodeOperator::createModuloTree(this, node, pDataModel, sbmlLevel, sbmlVersion); - skipChildren = true; - } - break; - - case SubType::QUOTIENT: - node->setType(AST_FUNCTION_QUOTIENT); + CEvaluationNodeOperator::createModuloTree(this, node, pDataModel); break; case SubType::PLUS: @@ -591,12 +543,12 @@ ASTNode * CEvaluationNodeOperator::toAST(const CDataModel * pDataModel, int sbml } // for all but S_INVALID and S_MODULUS two children have to be converted - if (subType != SubType::INVALID && !skipChildren) + if (subType != SubType::INVALID && subType != SubType::MODULUS) { const CEvaluationNode* child1 = dynamic_cast(this->getChild()); const CEvaluationNode* child2 = dynamic_cast(child1->getSibling()); - node->addChild(child1->toAST(pDataModel, sbmlLevel, sbmlVersion)); - node->addChild(child2->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child1->toAST(pDataModel)); + node->addChild(child2->toAST(pDataModel)); } return node; @@ -1459,7 +1411,7 @@ CEvaluationNode* CEvaluationNodeOperator::simplifyNode(const std::vectorsetType(AST_MINUS); ASTNode* tmpASTNode = new ASTNode(AST_DIVIDE); - tmpASTNode->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); - tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(x->toAST(pDataModel)); + tmpASTNode->addChild(y->toAST(pDataModel)); ASTNode* tmpASTNode2 = new ASTNode(AST_FUNCTION_CEILING); tmpASTNode2->addChild(tmpASTNode); tmpASTNode = new ASTNode(AST_TIMES); - tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(y->toAST(pDataModel)); tmpASTNode->addChild(tmpASTNode2); - pASTNodeTrue->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); + pASTNodeTrue->addChild(x->toAST(pDataModel)); pASTNodeTrue->addChild(tmpASTNode); pASTNode->addChild(pASTNodeTrue); // now comes the condition @@ -1504,7 +1456,7 @@ bool CEvaluationNodeOperator::createModuloTree(const CEvaluationNodeOperator * p // < tmpASTNode = new ASTNode(AST_RELATIONAL_LT); // x - tmpASTNode->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(x->toAST(pDataModel)); // 0 tmpASTNode2 = new ASTNode(AST_INTEGER); tmpASTNode2->setValue(0); @@ -1514,7 +1466,7 @@ bool CEvaluationNodeOperator::createModuloTree(const CEvaluationNodeOperator * p // < tmpASTNode = new ASTNode(AST_RELATIONAL_LT); // y - tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(y->toAST(pDataModel)); // 0 tmpASTNode2 = new ASTNode(AST_INTEGER); tmpASTNode2->setValue(0); @@ -1526,14 +1478,14 @@ bool CEvaluationNodeOperator::createModuloTree(const CEvaluationNodeOperator * p ASTNode* pASTNodeFalse = new ASTNode(); pASTNodeFalse->setType(AST_MINUS); tmpASTNode = new ASTNode(AST_DIVIDE); - tmpASTNode->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); - tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(x->toAST(pDataModel)); + tmpASTNode->addChild(y->toAST(pDataModel)); tmpASTNode2 = new ASTNode(AST_FUNCTION_FLOOR); tmpASTNode2->addChild(tmpASTNode); tmpASTNode = new ASTNode(AST_TIMES); - tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(y->toAST(pDataModel)); tmpASTNode->addChild(tmpASTNode2); - pASTNodeFalse->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); + pASTNodeFalse->addChild(x->toAST(pDataModel)); pASTNodeFalse->addChild(tmpASTNode); pASTNode->addChild(pASTNodeFalse); result = true; @@ -1721,31 +1673,6 @@ std::string CEvaluationNodeOperator::getMMLString(const std::vector< std::string if (flag) out << "" << std::endl; - out << "" << std::endl; - break; - - case SubType::QUOTIENT: - out << "" << std::endl; - - //do we need "()" ? - flag = (*mpLeftNode < * (CEvaluationNode *)this); - - if (flag) out << "" << std::endl; - - out << children[0]; - - if (flag) out << "" << std::endl; - - out << "" << "quotient" << "" << std::endl; - - flag = !(*(CEvaluationNode *)this < *mpRightNode); - - if (flag) out << "" << std::endl; - - out << children[1]; - - if (flag) out << "" << std::endl; - out << "" << std::endl; break; } @@ -1757,10 +1684,6 @@ std::string CEvaluationNodeOperator::getMMLString(const std::vector< std::string CValidatedUnit CEvaluationNodeOperator::getUnit(const CMathContainer & container, const std::vector< CValidatedUnit > & units) const { - - if (units.empty()) - return CValidatedUnit(CBaseUnit::undefined, true); - switch (mSubType) { case SubType::POWER: @@ -1823,19 +1746,16 @@ CValidatedUnit CEvaluationNodeOperator::getUnit(const CMathContainer & container break; case SubType::MULTIPLY: - if (units.size() > 1) return units[0] * units[1]; break; case SubType::DIVIDE: case SubType::MODULUS: - if (units.size() > 1) return units[0] * units[1].exponentiate(-1); break; case SubType::PLUS: case SubType::MINUS: - if (units.size() > 1) return CValidatedUnit::merge(units[0], units[1]); break; @@ -1901,9 +1821,6 @@ CValidatedUnit CEvaluationNodeOperator::setUnit(const CMathContainer & container std::map < CEvaluationNode *, CValidatedUnit >::const_iterator itLeft = currentUnits.find(mpLeftNode); std::map < CEvaluationNode *, CValidatedUnit >::const_iterator itRight = currentUnits.find(mpRightNode); - if (itRight == currentUnits.end()) - break; - if (itLeft->second.isUndefined() || mpLeftNode->getChild() != NULL) { @@ -1915,7 +1832,8 @@ CValidatedUnit CEvaluationNodeOperator::setUnit(const CMathContainer & container targetUnits[mpLeftNode].setConflict(Result.conflict()); } - if (itRight->second.isUndefined() || mpRightNode->getChild() != NULL) + if (itRight->second.isUndefined() || + mpRightNode->getChild() != NULL) { targetUnits[mpRightNode] = Result * itLeft->second.exponentiate(-1.0); } @@ -1933,9 +1851,6 @@ CValidatedUnit CEvaluationNodeOperator::setUnit(const CMathContainer & container std::map < CEvaluationNode *, CValidatedUnit >::const_iterator itLeft = currentUnits.find(mpLeftNode); std::map < CEvaluationNode *, CValidatedUnit >::const_iterator itRight = currentUnits.find(mpRightNode); - if (itRight == currentUnits.end() || mpRightNode == NULL) - break; - if (itLeft->second.isUndefined() || mpLeftNode->getChild() != NULL) { diff --git a/copasi/function/CEvaluationNodeOperator.h b/copasi/function/CEvaluationNodeOperator.h index 7bca163ab7..b0a7747d77 100644 --- a/copasi/function/CEvaluationNodeOperator.h +++ b/copasi/function/CEvaluationNodeOperator.h @@ -142,7 +142,7 @@ class CEvaluationNodeOperator : public CEvaluationNode * Create a new ASTNode corresponding to this OperatorNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Create a simplified node for an operatorNode with children from vector (if not exist, = NULL), @@ -156,9 +156,9 @@ class CEvaluationNodeOperator : public CEvaluationNode * @param const CEvaluationNodeOperator* pNode the modulo * operator node to be converted. * @param const ASTNode* pASTNode the root node for the SBML math expression - * @return bool which is true on successful conversion. + * @return bool which is true on sucessfull conversion. */ - bool createModuloTree(const CEvaluationNodeOperator * pNode, ASTNode * pASTNode, const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + bool createModuloTree(const CEvaluationNodeOperator* pNode, ASTNode* pASTNode, const CDataModel* pDataModel) const; /** * Build the MathML string @@ -184,7 +184,6 @@ class CEvaluationNodeOperator : public CEvaluationNode void s_plus(); void s_minus(); void s_remainder(); - void s_quotient(); void s_invalid(); // Attributes diff --git a/copasi/function/CEvaluationNodeStructure.cpp b/copasi/function/CEvaluationNodeStructure.cpp index 73f924b456..2c7490004d 100644 --- a/copasi/function/CEvaluationNodeStructure.cpp +++ b/copasi/function/CEvaluationNodeStructure.cpp @@ -65,7 +65,7 @@ CEvaluationNodeStructure::CEvaluationNodeStructure(const CEvaluationNodeStructur CEvaluationNodeStructure::~CEvaluationNodeStructure() {} -ASTNode* CEvaluationNodeStructure::toAST(const CDataModel* /*pDataModel*/, int, int) const +ASTNode* CEvaluationNodeStructure::toAST(const CDataModel* /*pDataModel*/) const { fatalError(); return NULL; diff --git a/copasi/function/CEvaluationNodeStructure.h b/copasi/function/CEvaluationNodeStructure.h index b64a159100..ff10f5e2c6 100644 --- a/copasi/function/CEvaluationNodeStructure.h +++ b/copasi/function/CEvaluationNodeStructure.h @@ -67,7 +67,7 @@ class CEvaluationNodeStructure : public CEvaluationNode * Create a new ASTNode corresponding to this structure node. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; }; #endif // COPASI_CEvaluationNodeStructure diff --git a/copasi/function/CEvaluationNodeUnit.cpp b/copasi/function/CEvaluationNodeUnit.cpp index 02ae0cc611..5f35a0671f 100644 --- a/copasi/function/CEvaluationNodeUnit.cpp +++ b/copasi/function/CEvaluationNodeUnit.cpp @@ -70,7 +70,7 @@ std::string CEvaluationNodeUnit::getXPPString(const std::vector< std::string > & } // virtual -ASTNode* CEvaluationNodeUnit::toAST(const CDataModel* pDataModel, int, int) const +ASTNode* CEvaluationNodeUnit::toAST(const CDataModel* pDataModel) const { // TODO CRITICAL Implement me! fatalError(); diff --git a/copasi/function/CEvaluationNodeUnit.h b/copasi/function/CEvaluationNodeUnit.h index dc7b9806fe..ee3a9e9c25 100644 --- a/copasi/function/CEvaluationNodeUnit.h +++ b/copasi/function/CEvaluationNodeUnit.h @@ -89,7 +89,7 @@ class CEvaluationNodeUnit : public CEvaluationNode * Create a new invalid ASTNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeVariable.cpp b/copasi/function/CEvaluationNodeVariable.cpp index 1ddc9ba49b..6b10020a56 100644 --- a/copasi/function/CEvaluationNodeVariable.cpp +++ b/copasi/function/CEvaluationNodeVariable.cpp @@ -107,7 +107,7 @@ CValidatedUnit CEvaluationNodeVariable::getUnit(const CMathContainer & /* contai return CValidatedUnit(); } -ASTNode* CEvaluationNodeVariable::toAST(const CDataModel* /*pDataModel*/, int, int) const +ASTNode* CEvaluationNodeVariable::toAST(const CDataModel* /*pDataModel*/) const { ASTNode* node = new ASTNode(); node->setType(AST_NAME); diff --git a/copasi/function/CEvaluationNodeVariable.h b/copasi/function/CEvaluationNodeVariable.h index 5c1239ca5a..e26963b3fa 100644 --- a/copasi/function/CEvaluationNodeVariable.h +++ b/copasi/function/CEvaluationNodeVariable.h @@ -105,7 +105,7 @@ class CEvaluationNodeVariable : public CEvaluationNode * Converts this node to an AST Node of type AST_NAME * @return ASTNode* the resulting ASTNode. */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; + virtual ASTNode* toAST(const CDataModel* pDataModel) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeVector.cpp b/copasi/function/CEvaluationNodeVector.cpp index 814f280025..f18e432c52 100644 --- a/copasi/function/CEvaluationNodeVector.cpp +++ b/copasi/function/CEvaluationNodeVector.cpp @@ -159,7 +159,7 @@ CEvaluationNode * CEvaluationNodeVector::fromAST(const ASTNode * /* pASTNode */, return NULL; } -ASTNode* CEvaluationNodeVector::toAST(const CDataModel* /*pDataModel*/, int, int) const +ASTNode* CEvaluationNodeVector::toAST(const CDataModel* /*pDataModel*/) const { // :TODO: ASTNode* node = new ASTNode(AST_FUNCTION_PIECEWISE); diff --git a/copasi/function/CEvaluationNodeVector.h b/copasi/function/CEvaluationNodeVector.h index ba1095b9f5..e2e2239085 100644 --- a/copasi/function/CEvaluationNodeVector.h +++ b/copasi/function/CEvaluationNodeVector.h @@ -121,7 +121,7 @@ class CEvaluationNodeVector : public CEvaluationNode * Create a new ASTNode corresponding to this choice node. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; /** * Add a child to a node. diff --git a/copasi/function/CEvaluationNodeWhiteSpace.cpp b/copasi/function/CEvaluationNodeWhiteSpace.cpp index 41cd0d47f1..536a57b497 100644 --- a/copasi/function/CEvaluationNodeWhiteSpace.cpp +++ b/copasi/function/CEvaluationNodeWhiteSpace.cpp @@ -42,7 +42,7 @@ CEvaluationNodeWhiteSpace::CEvaluationNodeWhiteSpace(const CEvaluationNodeWhiteS CEvaluationNodeWhiteSpace::~CEvaluationNodeWhiteSpace() {} -ASTNode* CEvaluationNodeWhiteSpace::toAST(const CDataModel* /*pDataModel*/, int, int) const +ASTNode* CEvaluationNodeWhiteSpace::toAST(const CDataModel* /*pDataModel*/) const { fatalError(); return NULL; diff --git a/copasi/function/CEvaluationNodeWhiteSpace.h b/copasi/function/CEvaluationNodeWhiteSpace.h index 4e5ddec0e7..1e9faafbed 100644 --- a/copasi/function/CEvaluationNodeWhiteSpace.h +++ b/copasi/function/CEvaluationNodeWhiteSpace.h @@ -67,7 +67,7 @@ class CEvaluationNodeWhiteSpace : public CEvaluationNode * Create a new ASTNode corresponding to this OperatorNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; }; #endif // COPASI_CEvaluationNodeWhiteSpace diff --git a/copasi/function/CEvaluationParser.ypp b/copasi/function/CEvaluationParser.ypp index a1a6ba69dd..ec61e4a86d 100644 --- a/copasi/function/CEvaluationParser.ypp +++ b/copasi/function/CEvaluationParser.ypp @@ -32,7 +32,6 @@ %token TOKEN_CALL %token TOKEN_FUNCTION -%token TOKEN_FUNCTION_1 %token TOKEN_FUNCTION_2 %token TOKEN_SIGN @@ -80,7 +79,6 @@ %right TOKEN_OPERATOR_POWER %right TOKEN_CALL // Will never occur %right TOKEN_FUNCTION // Will never occur -%right TOKEN_FUNCTION_1 // Will never occur %right TOKEN_FUNCTION_2 // Will never occur %right TOKEN_LOGICAL_CHOICE // Will never occur @@ -102,7 +100,7 @@ result: exp mpRootNode = $$; } -d_or_b: call +d_or_b: call { $$ = $1; mpRootNode = $$; @@ -188,11 +186,7 @@ exp: TOKEN_NUMBER $$ = $2; mpRootNode = $$; } - | function - { - $$ = $1; - } - | TOKEN_FUNCTION_1 TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE + | TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($3); @@ -482,32 +476,6 @@ bool: TOKEN_LOGICAL_VALUE mpRootNode = $$; } -function: TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN TOKEN_STRUCTURE_CLOSE - { - $$ = $1; - } - | TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE - { - $$ = $1; - $$->addChild($3); - } - | fcont exp TOKEN_STRUCTURE_CLOSE - { - $$ = $1; - $$->addChild($2); - } - -fcont: TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_COMMA - { - $$ = $1; - $$->addChild($3); - } - | fcont exp TOKEN_STRUCTURE_COMMA - { - $$ = $1; - $$->addChild($2); - } - vector: TOKEN_STRUCTURE_VECTOR_OPEN TOKEN_STRUCTURE_VECTOR_CLOSE { $$ = new CEvaluationNodeVector(); @@ -544,47 +512,47 @@ call: TOKEN_CALL TOKEN_STRUCTURE_CLOSE { $$ = $1; } - | ccont d_or_b TOKEN_STRUCTURE_CLOSE + | cstart d_or_b TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } - | ccont exp TOKEN_STRUCTURE_CLOSE + | cstart exp TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } - | ccont bool TOKEN_STRUCTURE_CLOSE + | cstart bool TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } - | ccont vector TOKEN_STRUCTURE_CLOSE + | cstart vector TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } -ccont: TOKEN_CALL +cstart: TOKEN_CALL { $$ = $1; } - | ccont d_or_b TOKEN_STRUCTURE_COMMA + | cstart d_or_b TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); } - | ccont exp TOKEN_STRUCTURE_COMMA + | cstart exp TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); } - | ccont bool TOKEN_STRUCTURE_COMMA + | cstart bool TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); } - | ccont vector TOKEN_STRUCTURE_COMMA + | cstart vector TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); diff --git a/copasi/function/CEvaluationParser_yacc.cpp b/copasi/function/CEvaluationParser_yacc.cpp index b0fdb69791..9d0d2f0a86 100644 --- a/copasi/function/CEvaluationParser_yacc.cpp +++ b/copasi/function/CEvaluationParser_yacc.cpp @@ -1,8 +1,32 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ +// Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and University of +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and The University +// of Manchester. +// All rights reserved. + +// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., EML Research, gGmbH, University of Heidelberg, +// and The University of Manchester. +// All rights reserved. + +// Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc. and EML Research, gGmbH. +// All rights reserved. + +/* A Bison parser, made by GNU Bison 3.5. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +40,7 @@ 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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,10 +58,6 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -45,11 +65,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output, and Bison version. */ -#define YYBISON 30802 +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ -/* Bison version string. */ -#define YYBISON_VERSION "3.8.2" +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -63,7 +86,6 @@ /* Pull parsers. */ #define YYPULL 1 - /* Substitute the variable and function names. */ #define yyparse yyparse #define yyerror CEvaluationParsererror @@ -96,8 +118,7 @@ #undef yyparse #define yyparse CEvaluationParserBase::yyparse - -#line 102 "CEvaluationParser_yacc.cpp" +#line 101 "CEvaluationParser_yacc.cpp" # ifndef YY_CAST # ifdef __cplusplus @@ -120,60 +141,73 @@ # endif # endif -#include "CEvaluationParser_yacc.hpp" -/* Symbol kind. */ -enum yysymbol_kind_t +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED +# define YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int CEvaluationParserdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE +enum yytokentype { - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_TOKEN_NUMBER = 3, /* TOKEN_NUMBER */ - YYSYMBOL_TOKEN_VARIABLE = 4, /* TOKEN_VARIABLE */ - YYSYMBOL_TOKEN_UNIT = 5, /* TOKEN_UNIT */ - YYSYMBOL_TOKEN_CALL = 6, /* TOKEN_CALL */ - YYSYMBOL_TOKEN_FUNCTION = 7, /* TOKEN_FUNCTION */ - YYSYMBOL_TOKEN_FUNCTION_1 = 8, /* TOKEN_FUNCTION_1 */ - YYSYMBOL_TOKEN_FUNCTION_2 = 9, /* TOKEN_FUNCTION_2 */ - YYSYMBOL_TOKEN_SIGN = 10, /* TOKEN_SIGN */ - YYSYMBOL_TOKEN_OPERATOR_POWER = 11, /* TOKEN_OPERATOR_POWER */ - YYSYMBOL_TOKEN_OPERATOR_MULTIPLY = 12, /* TOKEN_OPERATOR_MULTIPLY */ - YYSYMBOL_TOKEN_OPERATOR_MODULUS = 13, /* TOKEN_OPERATOR_MODULUS */ - YYSYMBOL_TOKEN_OPERATOR_REMAINDER = 14, /* TOKEN_OPERATOR_REMAINDER */ - YYSYMBOL_TOKEN_OPERATOR_PLUS = 15, /* TOKEN_OPERATOR_PLUS */ - YYSYMBOL_TOKEN_LOGICAL_CHOICE = 16, /* TOKEN_LOGICAL_CHOICE */ - YYSYMBOL_TOKEN_LOGICAL_VALUE = 17, /* TOKEN_LOGICAL_VALUE */ - YYSYMBOL_TOKEN_LOGICAL_NOT = 18, /* TOKEN_LOGICAL_NOT */ - YYSYMBOL_TOKEN_LOGICAL_OR = 19, /* TOKEN_LOGICAL_OR */ - YYSYMBOL_TOKEN_LOGICAL_XOR = 20, /* TOKEN_LOGICAL_XOR */ - YYSYMBOL_TOKEN_LOGICAL_AND = 21, /* TOKEN_LOGICAL_AND */ - YYSYMBOL_TOKEN_LOGICAL_EQ = 22, /* TOKEN_LOGICAL_EQ */ - YYSYMBOL_TOKEN_LOGICAL_NE = 23, /* TOKEN_LOGICAL_NE */ - YYSYMBOL_TOKEN_LOGICAL_GT = 24, /* TOKEN_LOGICAL_GT */ - YYSYMBOL_TOKEN_LOGICAL_GE = 25, /* TOKEN_LOGICAL_GE */ - YYSYMBOL_TOKEN_LOGICAL_LT = 26, /* TOKEN_LOGICAL_LT */ - YYSYMBOL_TOKEN_LOGICAL_LE = 27, /* TOKEN_LOGICAL_LE */ - YYSYMBOL_TOKEN_STRUCTURE_OPEN = 28, /* TOKEN_STRUCTURE_OPEN */ - YYSYMBOL_TOKEN_STRUCTURE_VECTOR_OPEN = 29, /* TOKEN_STRUCTURE_VECTOR_OPEN */ - YYSYMBOL_TOKEN_STRUCTURE_COMMA = 30, /* TOKEN_STRUCTURE_COMMA */ - YYSYMBOL_TOKEN_STRUCTURE_CLOSE = 31, /* TOKEN_STRUCTURE_CLOSE */ - YYSYMBOL_TOKEN_STRUCTURE_VECTOR_CLOSE = 32, /* TOKEN_STRUCTURE_VECTOR_CLOSE */ - YYSYMBOL_YYACCEPT = 33, /* $accept */ - YYSYMBOL_result = 34, /* result */ - YYSYMBOL_d_or_b = 35, /* d_or_b */ - YYSYMBOL_exp = 36, /* exp */ - YYSYMBOL_bool = 37, /* bool */ - YYSYMBOL_function = 38, /* function */ - YYSYMBOL_fcont = 39, /* fcont */ - YYSYMBOL_vector = 40, /* vector */ - YYSYMBOL_vstart = 41, /* vstart */ - YYSYMBOL_call = 42, /* call */ - YYSYMBOL_ccont = 43 /* ccont */ + TOKEN_NUMBER = 258, + TOKEN_VARIABLE = 259, + TOKEN_UNIT = 260, + TOKEN_CALL = 261, + TOKEN_FUNCTION = 262, + TOKEN_FUNCTION_2 = 263, + TOKEN_SIGN = 264, + TOKEN_OPERATOR_POWER = 265, + TOKEN_OPERATOR_MULTIPLY = 266, + TOKEN_OPERATOR_MODULUS = 267, + TOKEN_OPERATOR_REMAINDER = 268, + TOKEN_OPERATOR_PLUS = 269, + TOKEN_LOGICAL_CHOICE = 270, + TOKEN_LOGICAL_VALUE = 271, + TOKEN_LOGICAL_NOT = 272, + TOKEN_LOGICAL_OR = 273, + TOKEN_LOGICAL_XOR = 274, + TOKEN_LOGICAL_AND = 275, + TOKEN_LOGICAL_EQ = 276, + TOKEN_LOGICAL_NE = 277, + TOKEN_LOGICAL_GT = 278, + TOKEN_LOGICAL_GE = 279, + TOKEN_LOGICAL_LT = 280, + TOKEN_LOGICAL_LE = 281, + TOKEN_STRUCTURE_OPEN = 282, + TOKEN_STRUCTURE_VECTOR_OPEN = 283, + TOKEN_STRUCTURE_COMMA = 284, + TOKEN_STRUCTURE_CLOSE = 285, + TOKEN_STRUCTURE_VECTOR_CLOSE = 286 }; -typedef enum yysymbol_kind_t yysymbol_kind_t; +#endif +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif +extern YYSTYPE CEvaluationParserlval; +#endif /* !YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED */ #ifdef short # undef short @@ -212,18 +246,6 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif -/* Work around bug in HP-UX 11.23, which defines these macros - incorrectly for preprocessor constants. This workaround can likely - be removed in 2023, as HPE has promised support for HP-UX 11.23 - (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of - . */ -#ifdef __hpux -# undef UINT_LEAST8_MAX -# undef UINT_LEAST16_MAX -# define UINT_LEAST8_MAX 255 -# define UINT_LEAST16_MAX 65535 -#endif - #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -283,7 +305,6 @@ typedef int yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - /* Stored state numbers (used for stacks). */ typedef yytype_uint8 yy_state_t; @@ -302,7 +323,6 @@ typedef int yy_state_fast_t; # endif #endif - #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -321,25 +341,19 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YY_USE(E) ((void) (E)) +# define YYUSE(E) ((void) (E)) #else -# define YY_USE(E) /* empty */ +# define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") + _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif @@ -353,20 +367,19 @@ typedef int yy_state_fast_t; #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") + _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif - #define YY_ASSERT(E) ((void) (0 && (E))) -#if !defined yyoverflow +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -385,7 +398,7 @@ typedef int yy_state_fast_t; # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +/* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -395,13 +408,13 @@ typedef int yy_state_fast_t; # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +/* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do {/* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ +/* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else @@ -421,17 +434,17 @@ typedef int yy_state_fast_t; # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ +void free(void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* !defined yyoverflow */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -450,8 +463,8 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -461,15 +474,15 @@ union yyalloc stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF (*yyptr); \ - } \ - while (0) + do \ + {\ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) #endif @@ -479,111 +492,99 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) + do \ + {\ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 35 +#define YYFINAL 31 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 576 +#define YYLAST 527 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 33 +#define YYNTOKENS 32 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 11 +#define YYNNTS 9 /* YYNRULES -- Number of rules. */ -#define YYNRULES 75 +#define YYNRULES 69 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 173 - -/* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 287 +#define YYNSTATES 162 +#define YYUNDEFTOK 2 +#define YYMAXUTOK 286 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK \ - ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ - : YYSYMBOL_YYUNDEF) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32 + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 89, 89, 94, 99, 105, 110, 115, 123, 133, - 138, 144, 151, 158, 165, 172, 179, 186, 191, 195, - 201, 208, 214, 223, 233, 243, 253, 264, 276, 281, - 289, 299, 309, 319, 330, 341, 348, 356, 363, 371, - 379, 386, 394, 401, 409, 417, 424, 431, 438, 445, - 452, 459, 466, 471, 477, 485, 489, 494, 500, 505, - 511, 516, 522, 528, 534, 538, 543, 547, 552, 557, - 562, 568, 572, 577, 582, 587 + 0, 87, 87, 92, 97, 103, 108, 113, 121, 131, + 136, 142, 149, 156, 163, 170, 177, 184, 189, 195, + 202, 208, 217, 227, 237, 247, 258, 270, 275, 283, + 293, 303, 313, 324, 335, 342, 350, 357, 365, 373, + 380, 388, 395, 403, 411, 418, 425, 432, 439, 446, + 453, 460, 465, 471, 479, 484, 490, 496, 502, 506, + 511, 515, 520, 525, 530, 536, 540, 545, 550, 555 }; #endif -/** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) - -#if YYDEBUG || 0 -/* The user-facing name of the symbol whose (internal) number is - YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; - +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "\"end of file\"", "error", "\"invalid token\"", "TOKEN_NUMBER", - "TOKEN_VARIABLE", "TOKEN_UNIT", "TOKEN_CALL", "TOKEN_FUNCTION", - "TOKEN_FUNCTION_1", "TOKEN_FUNCTION_2", "TOKEN_SIGN", - "TOKEN_OPERATOR_POWER", "TOKEN_OPERATOR_MULTIPLY", + "$end", "error", "$undefined", "TOKEN_NUMBER", "TOKEN_VARIABLE", + "TOKEN_UNIT", "TOKEN_CALL", "TOKEN_FUNCTION", "TOKEN_FUNCTION_2", + "TOKEN_SIGN", "TOKEN_OPERATOR_POWER", "TOKEN_OPERATOR_MULTIPLY", "TOKEN_OPERATOR_MODULUS", "TOKEN_OPERATOR_REMAINDER", "TOKEN_OPERATOR_PLUS", "TOKEN_LOGICAL_CHOICE", "TOKEN_LOGICAL_VALUE", "TOKEN_LOGICAL_NOT", "TOKEN_LOGICAL_OR", "TOKEN_LOGICAL_XOR", @@ -592,23 +593,28 @@ static const char *const yytname[] = "TOKEN_LOGICAL_LE", "TOKEN_STRUCTURE_OPEN", "TOKEN_STRUCTURE_VECTOR_OPEN", "TOKEN_STRUCTURE_COMMA", "TOKEN_STRUCTURE_CLOSE", "TOKEN_STRUCTURE_VECTOR_CLOSE", "$accept", - "result", "d_or_b", "exp", "bool", "function", "fcont", "vector", - "vstart", "call", "ccont", YY_NULLPTR + "result", "d_or_b", "exp", "bool", "vector", "vstart", "call", "cstart", YY_NULLPTR }; +#endif -static const char * -yysymbol_name (yysymbol_kind_t yysymbol) +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_int16 yytoknum[] = { - return yytname[yysymbol]; -} -#endif + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286 +}; +# endif -#define YYPACT_NINF (-52) +#define YYPACT_NINF (-50) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-55) +#define YYTABLE_NINF (-54) #define yytable_value_is_error(Yyn) \ 0 @@ -617,24 +623,23 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 257, -52, -52, -28, -10, -8, -4, 284, -2, -52, - 257, 257, 57, 5, 461, 176, -52, 284, -52, 227, - -52, 211, 284, 284, 24, 284, -52, 50, 257, 122, - 461, 7, 150, 312, 104, -52, 257, 257, 284, 273, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 257, - 257, 257, 257, 257, 1, 200, -21, 291, 481, 181, - -24, -52, 52, 318, 61, 257, 339, 28, 517, -52, - -52, 466, 58, 483, -52, 50, -52, 50, 117, 229, - 212, 559, 559, 559, 559, 559, 559, 288, 12, 7, - 171, 58, 130, -52, -52, -52, -52, 559, -52, -52, - -52, -52, -52, -52, -52, -52, -52, 243, -52, -52, - -52, -52, 284, 124, 529, 257, 257, 559, -52, 360, - 284, 284, 133, 407, 534, 144, 427, 546, -52, 54, - 432, 60, 452, 257, 284, 257, 257, 284, 257, 284, - 284, 47, 333, 276, 56, 375, 66, 494, 82, 354, - 499, 72, 381, 87, 512, 75, 386, 80, 396, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52 + 208, -50, -50, -27, 3, 24, 236, 62, -50, 208, + 208, 53, 2, 402, 7, -50, 179, -50, 236, 236, + 89, 236, -50, 63, 208, 46, 402, 41, 58, 275, + 345, -50, 208, 208, 236, 223, 236, 236, 236, 236, + 236, 236, 236, 236, 236, 208, 208, 208, 208, 208, + 130, 122, 254, 422, 70, -9, 1, 73, 208, 101, + 98, 471, -50, -50, 407, 99, 424, -50, 63, -50, + 63, -6, 136, 47, 513, 513, 513, 513, 513, 513, + 335, 75, 41, 52, 99, 88, -50, -50, 513, -50, + -50, -50, -50, -50, -50, -50, -50, -50, 194, -50, + -50, 236, 170, 476, 208, 208, 513, -50, 260, 236, + 236, 212, 348, 488, 226, 368, 493, -50, 95, 373, + 103, 393, 208, 236, 208, 208, 236, 208, 236, 236, + -13, 296, 435, 100, 281, 26, 440, 154, 317, 453, + 105, 302, 183, 458, 110, 323, 123, 338, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -642,235 +647,216 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int8 yydefact[] = { - 0, 9, 6, 71, 0, 0, 0, 0, 0, 28, - 0, 0, 0, 10, 2, 3, 18, 0, 5, 0, - 66, 0, 0, 0, 0, 0, 10, 21, 0, 10, - 0, 53, 10, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, - 0, 55, 0, 0, 0, 0, 0, 10, 0, 17, - 52, 36, 39, 41, 44, 16, 14, 15, 12, 13, - 11, 35, 40, 46, 45, 48, 47, 49, 50, 51, - 10, 37, 10, 42, 59, 57, 60, 62, 63, 72, - 67, 73, 68, 74, 69, 75, 70, 0, 61, 58, - 56, 19, 0, 10, 0, 0, 0, 64, 65, 0, - 0, 0, 10, 0, 0, 10, 0, 0, 20, 10, - 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 10, 0, 0, 10, 0, 10, 0, 10, 0, - 0, 10, 0, 10, 0, 10, 0, 10, 0, 8, - 26, 33, 27, 25, 34, 32, 7, 23, 30, 24, - 22, 31, 29 + 0, 9, 6, 65, 0, 0, 0, 0, 27, 0, + 0, 0, 10, 2, 3, 5, 0, 60, 0, 0, + 0, 0, 10, 20, 0, 10, 0, 52, 10, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 17, 51, 35, 38, 40, 43, 16, 14, + 15, 12, 13, 11, 34, 39, 45, 44, 47, 46, + 48, 49, 50, 10, 36, 10, 41, 54, 56, 57, + 66, 61, 67, 62, 68, 63, 69, 64, 0, 55, + 18, 0, 10, 0, 0, 0, 58, 59, 0, 0, + 0, 10, 0, 0, 10, 0, 0, 19, 10, 0, + 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 0, 0, 10, 0, 10, 0, 10, 0, 0, + 10, 0, 10, 0, 10, 0, 10, 0, 8, 25, + 32, 26, 24, 33, 31, 7, 22, 29, 23, 21, + 30, 28 }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = +static const yytype_int16 yypgoto[] = { - -52, -52, 49, 0, 43, -52, -52, -51, -52, -52, - -52 -}; + -50, -50, 45, 0, 132, -49, -50, -50, -50 + }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - 0, 12, 26, 30, 15, 16, 17, 59, 60, 18, - 19 -}; + -1, 11, 22, 26, 14, 54, 55, 15, 16 + }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 14, 36, 37, 20, 98, -4, 107, 27, 108, 99, - 100, 33, 38, 39, 40, 41, 42, 54, 21, 57, - 22, 62, 63, 64, 23, 66, 28, 36, 37, 52, - 53, 94, 95, 51, 52, 53, 71, 73, 75, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 13, - 36, 37, 65, 31, 34, 97, 118, 35, 115, 29, - 32, 38, 58, 38, 39, 40, 41, 42, 56, 36, - 37, 68, 38, 39, 40, 41, 42, 67, 159, 72, - 74, 53, 109, 110, 139, 32, 32, 162, 36, 37, - 140, 112, 87, 88, 89, 91, 93, 164, 32, 32, - 32, 90, 92, 169, 36, 37, 159, 117, 114, 36, - 37, 166, 119, 166, 113, 123, 126, 0, 171, 0, - 130, 132, -54, 49, 50, 51, 52, 53, 38, 39, - -43, 41, 0, 142, 145, 70, 149, 152, 0, 156, - 158, -54, -54, -54, 36, 37, 36, 37, 0, -43, - -43, -43, -54, -54, 120, 36, 37, 0, 124, 127, - -43, -43, 0, 133, 122, 125, 36, 37, 0, 129, - 131, -38, 36, 37, 136, 0, 143, 0, 147, 150, - 0, 154, 141, 144, 146, 148, 151, 153, 155, 157, - -38, -38, -38, 0, 37, 49, 50, 51, 52, 53, - 0, -38, -38, 1, 2, 0, 3, 4, 5, 6, - 7, 105, 106, 0, 1, 2, 24, 3, 4, 5, - 6, 7, 0, 38, 39, 40, 41, 24, 25, 55, - 1, 2, 96, 3, 4, 5, 6, 7, 0, 25, - 38, 39, 61, 8, 9, 10, 1, 2, 0, 3, - 4, 5, 6, 7, 0, 11, 55, 0, 0, 24, - 1, 2, 0, 3, 4, 5, 6, 7, 0, 0, - 0, 25, 55, 8, 9, 10, 1, 2, 76, 3, - 4, 5, 6, 7, 0, 11, 0, 1, 2, 24, - 3, 4, 5, 6, 7, 49, 50, 51, 52, 53, - 24, 25, 38, 39, 40, 41, 42, 161, 50, 51, - 52, 53, 25, 43, 44, 45, 46, 47, 48, 0, - 0, 101, 102, 38, 39, 40, 41, 42, 0, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 0, 0, 0, 69, 38, 39, 40, 41, 42, 111, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 160, 38, 39, 40, 41, 42, - 69, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 0, 0, 0, 167, 38, 39, 40, 41, - 42, 128, 38, 39, 40, 41, 42, 38, 39, 40, - 41, 42, 0, 0, 0, 0, 163, 38, 39, 40, - 41, 42, 170, 0, 0, 0, 0, 160, 38, 39, - 40, 41, 42, 0, 0, 0, 0, 167, 0, 43, - 44, 45, 46, 47, 48, 0, 0, 134, 38, 39, - 40, 41, 42, 38, 39, 40, 41, 42, 0, 43, - 44, 45, 46, 47, 48, 0, 0, 137, 0, 0, - 0, 0, 134, 38, 39, 40, 41, 42, 0, 0, - 0, 0, 38, 39, 40, 41, 42, 38, 39, 40, - 41, 42, 137, 43, 44, 45, 46, 47, 48, 44, - 45, 46, 47, 48, 38, 39, 40, 41, 42, 0, - 49, 50, 51, 52, 53, 0, 0, 45, 46, 47, - 48, 103, 104, 49, 50, 51, 52, 53, 49, 50, - 51, 52, 53, 0, 0, 165, 0, 0, 0, 0, - 168, 49, 50, 51, 52, 53, 49, 50, 51, 52, - 53, 0, 0, 172, 0, 0, 0, 116, 49, 50, - 51, 52, 53, 49, 50, 51, 52, 53, 0, 121, - 0, 0, 0, 0, 135, 49, 50, 51, 52, 53, - 38, 39, 40, 41, 42, 0, 138 + 13, 89, -4, 17, 34, 35, 23, 37, 32, 33, + 29, 34, 35, 36, 37, 38, 52, 148, 56, 57, + 98, 59, 99, 32, 33, 45, 46, 47, 48, 49, + 18, 100, 64, 66, 68, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 12, -53, 32, 33, 107, + 88, 19, -37, 31, 25, 28, 153, 34, 35, 36, + 37, 51, 48, 49, -53, -53, -53, 32, 33, 60, + -37, -37, -37, 34, 33, -53, -53, 28, 28, 32, + 33, -37, -37, 34, 35, 36, 37, 38, -42, 24, + 28, 28, 28, 83, 85, 47, 48, 49, 106, 96, + 97, 108, 101, 102, 112, 115, -42, -42, -42, 119, + 121, 34, 35, 36, 37, 38, 58, -42, -42, 32, + 33, 49, 131, 134, 128, 138, 141, 104, 145, 147, + 151, 62, 129, 1, 2, 158, 3, 4, 5, 6, + 148, 27, 30, 32, 33, 20, 34, 35, 53, 111, + 114, 90, 91, 155, 118, 120, 61, 21, 50, 0, + 0, 87, 0, 0, 65, 67, 0, 130, 133, 135, + 137, 140, 142, 144, 146, 32, 33, 80, 81, 82, + 84, 86, 1, 2, 155, 3, 4, 5, 6, 0, + 103, 32, 33, 0, 7, 8, 9, 1, 2, 109, + 3, 4, 5, 6, 32, 33, 10, 50, 0, 20, + 0, 1, 2, 160, 3, 4, 5, 6, 0, 0, + 0, 21, 50, 7, 8, 9, 1, 2, 69, 3, + 4, 5, 6, 32, 33, 10, 113, 116, 20, 1, + 2, 122, 3, 4, 5, 6, 0, 32, 33, 0, + 21, 20, 0, 0, 132, 125, 136, 139, 0, 143, + 0, 0, 0, 21, 34, 35, 36, 37, 38, 0, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 0, 0, 92, 93, 34, 35, 36, 37, 38, + 117, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 0, 0, 0, 62, 34, 35, 36, 37, + 38, 152, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 0, 0, 149, 34, 35, 36, + 37, 38, 159, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 0, 0, 0, 156, 34, 35, + 36, 37, 38, 149, 46, 47, 48, 49, 34, 35, + 36, 37, 38, 45, 46, 47, 48, 49, 156, 39, + 40, 41, 42, 43, 44, 63, 0, 123, 34, 35, + 36, 37, 38, 34, 35, 36, 37, 38, 0, 39, + 40, 41, 42, 43, 44, 0, 0, 126, 0, 0, + 0, 0, 123, 34, 35, 36, 37, 38, 0, 0, + 0, 0, 34, 35, 36, 37, 38, 34, 35, 36, + 37, 38, 126, 39, 40, 41, 42, 43, 44, 40, + 41, 42, 43, 44, 34, 35, 36, 37, 38, 0, + 45, 46, 47, 48, 49, 0, 0, 41, 42, 43, + 44, 94, 95, 45, 46, 47, 48, 49, 45, 46, + 47, 48, 49, 0, 0, 150, 0, 0, 0, 0, + 154, 45, 46, 47, 48, 49, 45, 46, 47, 48, + 49, 0, 0, 157, 0, 0, 0, 0, 161, 45, + 46, 47, 48, 49, 45, 46, 47, 48, 49, 0, + 105, 0, 0, 0, 0, 110, 45, 46, 47, 48, + 49, 45, 46, 47, 48, 49, 0, 124, 0, 0, + 0, 0, 127, 34, 35, 36, 37, 38 }; static const yytype_int16 yycheck[] = { - 0, 22, 23, 31, 55, 0, 30, 7, 32, 30, - 31, 11, 11, 12, 13, 14, 15, 17, 28, 19, - 28, 21, 22, 23, 28, 25, 28, 22, 23, 22, - 23, 30, 31, 21, 22, 23, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, - 22, 23, 28, 10, 11, 55, 107, 0, 30, 10, - 11, 11, 19, 11, 12, 13, 14, 15, 19, 22, - 23, 28, 11, 12, 13, 14, 15, 28, 31, 36, - 37, 23, 30, 31, 30, 36, 37, 31, 22, 23, - 30, 30, 49, 50, 51, 52, 53, 31, 49, 50, - 51, 52, 53, 31, 22, 23, 31, 107, 65, 22, - 23, 31, 112, 31, 65, 115, 116, -1, 31, -1, - 120, 121, 0, 19, 20, 21, 22, 23, 11, 12, - 0, 14, -1, 133, 134, 31, 136, 137, -1, 139, - 140, 19, 20, 21, 22, 23, 22, 23, -1, 19, - 20, 21, 30, 31, 30, 22, 23, -1, 115, 116, - 30, 31, -1, 30, 115, 116, 22, 23, -1, 120, - 121, 0, 22, 23, 30, -1, 133, -1, 135, 136, - -1, 138, 133, 134, 135, 136, 137, 138, 139, 140, - 19, 20, 21, -1, 23, 19, 20, 21, 22, 23, - -1, 30, 31, 3, 4, -1, 6, 7, 8, 9, - 10, 30, 31, -1, 3, 4, 16, 6, 7, 8, - 9, 10, -1, 11, 12, 13, 14, 16, 28, 29, - 3, 4, 32, 6, 7, 8, 9, 10, -1, 28, - 11, 12, 31, 16, 17, 18, 3, 4, -1, 6, - 7, 8, 9, 10, -1, 28, 29, -1, -1, 16, - 3, 4, -1, 6, 7, 8, 9, 10, -1, -1, - -1, 28, 29, 16, 17, 18, 3, 4, 5, 6, - 7, 8, 9, 10, -1, 28, -1, 3, 4, 16, - 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, - 16, 28, 11, 12, 13, 14, 15, 31, 20, 21, - 22, 23, 28, 22, 23, 24, 25, 26, 27, -1, - -1, 30, 31, 11, 12, 13, 14, 15, -1, 11, - 12, 13, 14, 15, 22, 23, 24, 25, 26, 27, - -1, -1, -1, 31, 11, 12, 13, 14, 15, 31, - 11, 12, 13, 14, 15, 22, 23, 24, 25, 26, - 27, -1, -1, -1, 31, 11, 12, 13, 14, 15, - 31, 11, 12, 13, 14, 15, 22, 23, 24, 25, - 26, 27, -1, -1, -1, 31, 11, 12, 13, 14, - 15, 31, 11, 12, 13, 14, 15, 11, 12, 13, - 14, 15, -1, -1, -1, -1, 31, 11, 12, 13, - 14, 15, 31, -1, -1, -1, -1, 31, 11, 12, - 13, 14, 15, -1, -1, -1, -1, 31, -1, 22, - 23, 24, 25, 26, 27, -1, -1, 30, 11, 12, - 13, 14, 15, 11, 12, 13, 14, 15, -1, 22, - 23, 24, 25, 26, 27, -1, -1, 30, -1, -1, - -1, -1, 30, 11, 12, 13, 14, 15, -1, -1, - -1, -1, 11, 12, 13, 14, 15, 11, 12, 13, - 14, 15, 30, 22, 23, 24, 25, 26, 27, 23, - 24, 25, 26, 27, 11, 12, 13, 14, 15, -1, - 19, 20, 21, 22, 23, -1, -1, 24, 25, 26, - 27, 30, 31, 19, 20, 21, 22, 23, 19, 20, - 21, 22, 23, -1, -1, 31, -1, -1, -1, -1, - 31, 19, 20, 21, 22, 23, 19, 20, 21, 22, - 23, -1, -1, 31, -1, -1, -1, 30, 19, 20, - 21, 22, 23, 19, 20, 21, 22, 23, -1, 30, - -1, -1, -1, -1, 30, 19, 20, 21, 22, 23, - 11, 12, 13, 14, 15, -1, 30 + 0, 50, 0, 30, 10, 11, 6, 13, 21, 22, + 10, 10, 11, 12, 13, 14, 16, 30, 18, 19, + 29, 21, 31, 21, 22, 18, 19, 20, 21, 22, + 27, 30, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 0, 0, 21, 22, 98, + 50, 27, 0, 0, 9, 10, 30, 10, 11, 12, + 13, 16, 21, 22, 18, 19, 20, 21, 22, 24, + 18, 19, 20, 10, 22, 29, 30, 32, 33, 21, + 22, 29, 30, 10, 11, 12, 13, 14, 0, 27, + 45, 46, 47, 48, 49, 20, 21, 22, 98, 29, + 30, 101, 29, 58, 104, 105, 18, 19, 20, 109, + 110, 10, 11, 12, 13, 14, 27, 29, 30, 21, + 22, 22, 122, 123, 29, 125, 126, 29, 128, 129, + 30, 30, 29, 3, 4, 30, 6, 7, 8, 9, + 30, 9, 10, 21, 22, 15, 10, 11, 16, 104, + 105, 29, 30, 30, 109, 110, 24, 27, 28, -1, + -1, 31, -1, -1, 32, 33, -1, 122, 123, 124, + 125, 126, 127, 128, 129, 21, 22, 45, 46, 47, + 48, 49, 3, 4, 30, 6, 7, 8, 9, -1, + 58, 21, 22, -1, 15, 16, 17, 3, 4, 29, + 6, 7, 8, 9, 21, 22, 27, 28, -1, 15, + -1, 3, 4, 30, 6, 7, 8, 9, -1, -1, + -1, 27, 28, 15, 16, 17, 3, 4, 5, 6, + 7, 8, 9, 21, 22, 27, 104, 105, 15, 3, + 4, 29, 6, 7, 8, 9, -1, 21, 22, -1, + 27, 15, -1, -1, 122, 29, 124, 125, -1, 127, + -1, -1, -1, 27, 10, 11, 12, 13, 14, -1, + 10, 11, 12, 13, 14, 21, 22, 23, 24, 25, + 26, -1, -1, 29, 30, 10, 11, 12, 13, 14, + 30, 10, 11, 12, 13, 14, 21, 22, 23, 24, + 25, 26, -1, -1, -1, 30, 10, 11, 12, 13, + 14, 30, 10, 11, 12, 13, 14, 21, 22, 23, + 24, 25, 26, -1, -1, -1, 30, 10, 11, 12, + 13, 14, 30, 10, 11, 12, 13, 14, 21, 22, + 23, 24, 25, 26, -1, -1, -1, 30, 10, 11, + 12, 13, 14, 30, 19, 20, 21, 22, 10, 11, + 12, 13, 14, 18, 19, 20, 21, 22, 30, 21, + 22, 23, 24, 25, 26, 30, -1, 29, 10, 11, + 12, 13, 14, 10, 11, 12, 13, 14, -1, 21, + 22, 23, 24, 25, 26, -1, -1, 29, -1, -1, + -1, -1, 29, 10, 11, 12, 13, 14, -1, -1, + -1, -1, 10, 11, 12, 13, 14, 10, 11, 12, + 13, 14, 29, 21, 22, 23, 24, 25, 26, 22, + 23, 24, 25, 26, 10, 11, 12, 13, 14, -1, + 18, 19, 20, 21, 22, -1, -1, 23, 24, 25, + 26, 29, 30, 18, 19, 20, 21, 22, 18, 19, + 20, 21, 22, -1, -1, 30, -1, -1, -1, -1, + 30, 18, 19, 20, 21, 22, 18, 19, 20, 21, + 22, -1, -1, 30, -1, -1, -1, -1, 30, 18, + 19, 20, 21, 22, 18, 19, 20, 21, 22, -1, + 29, -1, -1, -1, -1, 29, 18, 19, 20, 21, + 22, 18, 19, 20, 21, 22, -1, 29, -1, -1, + -1, -1, 29, 10, 11, 12, 13, 14 }; -/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of - state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_int8 yystos[] = { - 0, 3, 4, 6, 7, 8, 9, 10, 16, 17, - 18, 28, 34, 35, 36, 37, 38, 39, 42, 43, - 31, 28, 28, 28, 16, 28, 35, 36, 28, 35, - 36, 37, 35, 36, 37, 0, 22, 23, 11, 12, - 13, 14, 15, 22, 23, 24, 25, 26, 27, 19, - 20, 21, 22, 23, 36, 29, 35, 36, 37, 40, - 41, 31, 36, 36, 36, 28, 36, 35, 37, 31, - 31, 36, 37, 36, 37, 36, 5, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, - 35, 37, 35, 37, 30, 31, 32, 36, 40, 30, - 31, 30, 31, 30, 31, 30, 31, 30, 32, 30, - 31, 31, 30, 35, 37, 30, 30, 36, 40, 36, - 30, 30, 35, 36, 37, 35, 36, 37, 31, 35, - 36, 35, 36, 30, 30, 30, 30, 30, 30, 30, - 30, 35, 36, 37, 35, 36, 35, 37, 35, 36, - 37, 35, 36, 35, 37, 35, 36, 35, 36, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31 + 0, 3, 4, 6, 7, 8, 9, 15, 16, 17, + 27, 33, 34, 35, 36, 39, 40, 30, 27, 27, + 15, 27, 34, 35, 27, 34, 35, 36, 34, 35, + 36, 0, 21, 22, 10, 11, 12, 13, 14, 21, + 22, 23, 24, 25, 26, 18, 19, 20, 21, 22, + 28, 34, 35, 36, 37, 38, 35, 35, 27, 35, + 34, 36, 30, 30, 35, 36, 35, 36, 35, 5, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 36, 36, 36, 34, 36, 34, 36, 31, 35, 37, + 29, 30, 29, 30, 29, 30, 29, 30, 29, 31, + 30, 29, 34, 36, 29, 29, 35, 37, 35, 29, + 29, 34, 35, 36, 34, 35, 36, 30, 34, 35, + 34, 35, 29, 29, 29, 29, 29, 29, 29, 29, + 34, 35, 36, 34, 35, 34, 36, 34, 35, 36, + 34, 35, 34, 36, 34, 35, 34, 35, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30 }; -/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int8 yyr1[] = { - 0, 33, 34, 34, 34, 35, 35, 35, 35, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 38, 38, 38, 39, 39, - 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, - 42, 43, 43, 43, 43, 43 + 0, 32, 33, 33, 33, 34, 34, 34, 34, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 37, 37, 38, 38, 38, 38, + 39, 39, 39, 39, 39, 40, 40, 40, 40, 40 }; -/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 yyr2[] = { - 0, 2, 1, 1, 1, 1, 1, 8, 8, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 1, 4, - 6, 2, 8, 8, 8, 8, 8, 8, 1, 8, - 8, 8, 8, 8, 8, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 2, 3, 4, 3, 4, 3, - 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, - 3, 1, 3, 3, 3, 3 + 0, 2, 1, 1, 1, 1, 1, 8, 8, 1, + 1, 3, 3, 3, 3, 3, 3, 3, 4, 6, + 2, 8, 8, 8, 8, 8, 8, 1, 8, 8, + 8, 8, 8, 8, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, + 2, 3, 3, 3, 3, 1, 3, 3, 3, 3 }; - -enum { YYENOMEM = -2 }; - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab - #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ - { \ + {\ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ @@ -878,16 +864,15 @@ enum { YYENOMEM = -2 }; goto yybackup; \ } \ else \ - { \ + {\ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) -/* Backward compatibility with an undocumented macro. - Use YYerror or YYUNDEF. */ -#define YYERRCODE YYUNDEF - +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG @@ -898,57 +883,63 @@ enum { YYENOMEM = -2 }; # endif # define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - - - - -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Kind, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + do {\ + if (yydebug) \ + YYFPRINTF Args; \ + } while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + do {\ + if (yydebug) \ + {\ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ + } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +yy_symbol_value_print(FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YY_USE (yyoutput); + YYUSE(yyoutput); + if (!yyvaluep) return; + +# ifdef YYPRINT + + if (yytype < YYNTOKENS) + YYPRINT(yyo, yytoknum[yytype], *yyvaluep); + +# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); + YYUSE(yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } - /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void -yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +yy_symbol_print(FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + YYFPRINTF(yyo, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyo, yykind, yyvaluep); - YYFPRINTF (yyo, ")"); + yy_symbol_value_print(yyo, yytype, yyvaluep); + YYFPRINTF(yyo, ")"); } /*------------------------------------------------------------------. @@ -957,65 +948,66 @@ yy_symbol_print (FILE *yyo, `------------------------------------------------------------------*/ static void -yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop) { - YYFPRINTF (stderr, "Stack now"); + YYFPRINTF(stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); + YYFPRINTF(stderr, " %d", yybot); } - YYFPRINTF (stderr, "\n"); + + YYFPRINTF(stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - + do {\ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ + } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, - int yyrule) +yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", - yyrule - 1, yylno); + YYFPRINTF(stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)]); - YYFPRINTF (stderr, "\n"); + YYFPRINTF(stderr, " $%d = ", yyi + 1); + yy_symbol_print(stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &yyvsp[(yyi + 1) - (yynrhs)] + ); + YYFPRINTF(stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) + do {\ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ + } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug = YYDEBUG; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) ((void) 0) -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ - /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 @@ -1032,31 +1024,272 @@ int yydebug = YYDEBUG; # define YYMAXDEPTH 10000 #endif +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else +/* Return the length of YYSTR. */ +static YYPTRDIFF_T +yystrlen(const char *yystr) +{ + YYPTRDIFF_T yylen; + + for (yylen = 0; yystr[yylen]; yylen++) + continue; + + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy(char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYPTRDIFF_T +yytnamerr(char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + +append: + + default: + if (yyres) + yyres[yyn] = *yyp; + + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + + return yyn; + } + +do_not_strip_quotes:; + } + + if (yyres) + return yystpcpy(yyres, yystr) - yyres; + else + return yystrlen(yystr); +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, + yy_state_t *yyssp, int yytoken) +{ + enum {YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Actual size of YYARG. */ + int yycount = 0; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + YYPTRDIFF_T yysize0 = yytnamerr(YY_NULLPTR, yytname[yytoken]); + yysize = yysize0; + yyarg[yycount++] = yytname[yytoken]; + + if (!yypact_value_is_default(yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error(yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + + yyarg[yycount++] = yytname[yyx]; + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr(YY_NULLPTR, yytname[yyx]); + + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ +case N: \ + yyformat = S; \ + break + + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + /* Don't count the "%s"s in the final size, but reserve room for + the terminator. */ + YYPTRDIFF_T yysize1 = yysize + (yystrlen(yyformat) - 2 * yycount) + 1; + + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (!(yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr(yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + ++yyp; + ++yyformat; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep) +yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep) { - YY_USE (yyvaluep); + YYUSE(yyvaluep); + if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); + YYUSE(yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } - -/* Lookahead token kind. */ +/* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1064,46 +1297,50 @@ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; - - - /*----------. | yyparse. | `----------*/ int -yyparse (void) +yyparse(void) { - yy_state_fast_t yystate = 0; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; + yy_state_fast_t yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; + /* The state stack. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss; + yy_state_t *yyssp; - /* The state stack: array, bottom, top. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; - /* The semantic value stack: array, bottom, top. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; + YYPTRDIFF_T yystacksize; int yyn; - /* The return value of yyparse. */ int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; - +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; +#endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1111,36 +1348,40 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - YYDPRINTF ((stderr, "Starting parse\n")); + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; - yychar = YYEMPTY; /* Cause a token to be read. */ + YYDPRINTF((stderr, "Starting parse\n")); + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ + /*------------------------------------------------------------. + | yynewstate -- push a new state, which is found in yystate. | + `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - -/*--------------------------------------------------------------------. -| yysetstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ + /*--------------------------------------------------------------------. + | yysetstate -- set current state (the top of the stack) to yystate. | + `--------------------------------------------------------------------*/ yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YYDPRINTF((stderr, "Entering state %d\n", yystate)); + YY_ASSERT(0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST (yy_state_t, yystate); + *yyssp = YY_CAST(yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; + goto yyexhaustedlab; + #else { /* Get the current used size of the three stacks, in elements. */ @@ -1158,33 +1399,39 @@ yyparse (void) data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * YYSIZEOF (*yyssp), - &yyvs1, yysize * YYSIZEOF (*yyvsp), - &yystacksize); + yyoverflow(YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF(*yyssp), + &yyvs1, yysize * YYSIZEOF(*yyvsp), + &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - YYNOMEM; + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = - YY_CAST (union yyalloc *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + YY_CAST(union yyalloc *, + YYSTACK_ALLOC(YY_CAST(YYSIZE_T, YYSTACK_BYTES(yystacksize)))); + if (! yyptr) - YYNOMEM; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE + goto yyexhaustedlab; + + YYSTACK_RELOCATE(yyss_alloc, yyss); + YYSTACK_RELOCATE(yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + YYSTACK_FREE(yyss1); } # endif @@ -1192,8 +1439,8 @@ yyparse (void) yyvsp = yyvs + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF ((stderr, "Stack size increased to %ld\n", - YY_CAST (long, yystacksize))); + YYDPRINTF((stderr, "Stack size increased to %ld\n", + YY_CAST(long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) @@ -1201,66 +1448,58 @@ yyparse (void) } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - if (yystate == YYFINAL) YYACCEPT; goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ + /*-----------. + | yybackup. | + `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + + if (yypact_value_is_default(yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token\n")); - yychar = yylex (); + YYDPRINTF((stderr, "Reading a token: ")); + yychar = yylex(); } if (yychar <= YYEOF) { - yychar = YYEOF; - yytoken = YYSYMBOL_YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else if (yychar == YYerror) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = YYUNDEF; - yytoken = YYSYMBOL_YYerror; - goto yyerrlab1; + yychar = yytoken = YYEOF; + YYDPRINTF((stderr, "Now at end of input.\n")); } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + yytoken = YYTRANSLATE(yychar); + YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) { - if (yytable_value_is_error (yyn)) + if (yytable_value_is_error(yyn)) goto yyerrlab; + yyn = -yyn; goto yyreduce; } @@ -1271,7 +1510,7 @@ yyparse (void) yyerrstatus--; /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; @@ -1281,20 +1520,20 @@ yyparse (void) yychar = YYEMPTY; goto yynewstate; - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; + if (yyn == 0) goto yyerrlab; - goto yyreduce; + goto yyreduce; -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; @@ -1307,806 +1546,822 @@ yyparse (void) users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + yyval = yyvsp[1 - yylen]; + YY_REDUCE_PRINT(yyn); - YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: /* result: exp */ -#line 90 "CEvaluationParser.ypp" - { - mValueType = CEvaluationNode::ValueType::Number; - mpRootNode = yyval; - } -#line 1324 "CEvaluationParser_yacc.cpp" - break; + case 2: +#line 88 "CEvaluationParser.ypp" + { + mValueType = CEvaluationNode::ValueType::Number; + mpRootNode = yyval; + } - case 3: /* result: bool */ -#line 95 "CEvaluationParser.ypp" - { - mValueType = CEvaluationNode::ValueType::Boolean; - mpRootNode = yyval; - } -#line 1333 "CEvaluationParser_yacc.cpp" - break; +#line 1531 "CEvaluationParser_yacc.cpp" + break; - case 4: /* result: d_or_b */ -#line 100 "CEvaluationParser.ypp" - { - mValueType = CEvaluationNode::ValueType::Unknown; - mpRootNode = yyval; - } -#line 1342 "CEvaluationParser_yacc.cpp" - break; + case 3: +#line 93 "CEvaluationParser.ypp" + { + mValueType = CEvaluationNode::ValueType::Boolean; + mpRootNode = yyval; + } - case 5: /* d_or_b: call */ -#line 106 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - mpRootNode = yyval; - } -#line 1351 "CEvaluationParser_yacc.cpp" - break; +#line 1540 "CEvaluationParser_yacc.cpp" + break; - case 6: /* d_or_b: TOKEN_VARIABLE */ -#line 111 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - mpRootNode = yyval; - } -#line 1360 "CEvaluationParser_yacc.cpp" - break; + case 4: +#line 98 "CEvaluationParser.ypp" + { + mValueType = CEvaluationNode::ValueType::Unknown; + mpRootNode = yyval; + } - case 7: /* d_or_b: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 116 "CEvaluationParser.ypp" - { - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1372 "CEvaluationParser_yacc.cpp" - break; +#line 1549 "CEvaluationParser_yacc.cpp" + break; - case 8: /* d_or_b: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 124 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1385 "CEvaluationParser_yacc.cpp" - break; + case 5: +#line 104 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + mpRootNode = yyval; + } - case 9: /* exp: TOKEN_NUMBER */ -#line 134 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - mpRootNode = yyval; - } -#line 1394 "CEvaluationParser_yacc.cpp" - break; +#line 1558 "CEvaluationParser_yacc.cpp" + break; - case 10: /* exp: d_or_b */ -#line 139 "CEvaluationParser.ypp" - { - yyvsp[0]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[0]; - mpRootNode = yyval; - } -#line 1404 "CEvaluationParser_yacc.cpp" - break; + case 6: +#line 109 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + mpRootNode = yyval; + } - case 11: /* exp: exp TOKEN_OPERATOR_PLUS exp */ -#line 145 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1415 "CEvaluationParser_yacc.cpp" - break; +#line 1567 "CEvaluationParser_yacc.cpp" + break; - case 12: /* exp: exp TOKEN_OPERATOR_MODULUS exp */ -#line 152 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1426 "CEvaluationParser_yacc.cpp" - break; + case 7: +#line 114 "CEvaluationParser.ypp" + { + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 13: /* exp: exp TOKEN_OPERATOR_REMAINDER exp */ -#line 159 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1437 "CEvaluationParser_yacc.cpp" - break; +#line 1579 "CEvaluationParser_yacc.cpp" + break; - case 14: /* exp: exp TOKEN_OPERATOR_MULTIPLY TOKEN_UNIT */ -#line 166 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1448 "CEvaluationParser_yacc.cpp" - break; + case 8: +#line 122 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 15: /* exp: exp TOKEN_OPERATOR_MULTIPLY exp */ -#line 173 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1459 "CEvaluationParser_yacc.cpp" - break; +#line 1592 "CEvaluationParser_yacc.cpp" + break; - case 16: /* exp: exp TOKEN_OPERATOR_POWER exp */ -#line 180 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1470 "CEvaluationParser_yacc.cpp" - break; + case 9: +#line 132 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + mpRootNode = yyval; + } - case 17: /* exp: TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE */ -#line 187 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - mpRootNode = yyval; - } -#line 1479 "CEvaluationParser_yacc.cpp" - break; +#line 1601 "CEvaluationParser_yacc.cpp" + break; - case 18: /* exp: function */ -#line 192 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - } -#line 1487 "CEvaluationParser_yacc.cpp" - break; + case 10: +#line 137 "CEvaluationParser.ypp" + { + yyvsp[0]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[0]; + mpRootNode = yyval; + } - case 19: /* exp: TOKEN_FUNCTION_1 TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE */ -#line 196 "CEvaluationParser.ypp" - { - yyval = yyvsp[-3]; - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1497 "CEvaluationParser_yacc.cpp" - break; +#line 1611 "CEvaluationParser_yacc.cpp" + break; - case 20: /* exp: TOKEN_FUNCTION_2 TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_CLOSE */ -#line 202 "CEvaluationParser.ypp" - { - yyval = yyvsp[-5]; - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1508 "CEvaluationParser_yacc.cpp" - break; + case 11: +#line 143 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 21: /* exp: TOKEN_SIGN exp */ -#line 209 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1518 "CEvaluationParser_yacc.cpp" - break; +#line 1622 "CEvaluationParser_yacc.cpp" + break; - case 22: /* exp: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_CLOSE */ -#line 215 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1531 "CEvaluationParser_yacc.cpp" - break; + case 12: +#line 150 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 23: /* exp: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_CLOSE */ -#line 224 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Number); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1545 "CEvaluationParser_yacc.cpp" - break; +#line 1633 "CEvaluationParser_yacc.cpp" + break; - case 24: /* exp: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 234 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Number); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1559 "CEvaluationParser_yacc.cpp" - break; + case 13: +#line 157 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 25: /* exp: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_CLOSE */ -#line 244 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[-7]; - yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1573 "CEvaluationParser_yacc.cpp" - break; +#line 1644 "CEvaluationParser_yacc.cpp" + break; - case 26: /* exp: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_CLOSE */ -#line 254 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[-7]; - yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-5]); - yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Number); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1588 "CEvaluationParser_yacc.cpp" - break; + case 14: +#line 164 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 27: /* exp: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA exp TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 265 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); - yyval = yyvsp[-7]; - yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Number); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1603 "CEvaluationParser_yacc.cpp" - break; +#line 1655 "CEvaluationParser_yacc.cpp" + break; - case 28: /* bool: TOKEN_LOGICAL_VALUE */ -#line 277 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - mpRootNode = yyval; - } -#line 1612 "CEvaluationParser_yacc.cpp" - break; + case 15: +#line 171 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 29: /* bool: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_CLOSE */ -#line 282 "CEvaluationParser.ypp" - { - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1624 "CEvaluationParser_yacc.cpp" - break; +#line 1666 "CEvaluationParser_yacc.cpp" + break; - case 30: /* bool: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_CLOSE */ -#line 290 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1638 "CEvaluationParser_yacc.cpp" - break; + case 16: +#line 178 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 31: /* bool: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 300 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1652 "CEvaluationParser_yacc.cpp" - break; +#line 1677 "CEvaluationParser_yacc.cpp" + break; - case 32: /* bool: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_CLOSE */ -#line 310 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval = yyvsp[-7]; - yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1666 "CEvaluationParser_yacc.cpp" - break; + case 17: +#line 185 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + mpRootNode = yyval; + } - case 33: /* bool: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_CLOSE */ -#line 320 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval = yyvsp[-7]; - yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-5]); - yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } -#line 1681 "CEvaluationParser_yacc.cpp" - break; +#line 1686 "CEvaluationParser_yacc.cpp" + break; + + case 18: +#line 190 "CEvaluationParser.ypp" + { + yyval = yyvsp[-3]; + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 34: /* bool: TOKEN_LOGICAL_CHOICE TOKEN_STRUCTURE_OPEN d_or_b TOKEN_STRUCTURE_COMMA bool TOKEN_STRUCTURE_COMMA d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 331 "CEvaluationParser.ypp" - { - yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval = yyvsp[-7]; - yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } #line 1696 "CEvaluationParser_yacc.cpp" - break; + break; + + case 19: +#line 196 "CEvaluationParser.ypp" + { + yyval = yyvsp[-5]; + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 35: /* bool: exp TOKEN_LOGICAL_EQ exp */ -#line 342 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } #line 1707 "CEvaluationParser_yacc.cpp" - break; + break; - case 36: /* bool: d_or_b TOKEN_LOGICAL_EQ exp */ -#line 349 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Number); - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1719 "CEvaluationParser_yacc.cpp" - break; + case 20: +#line 203 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 1717 "CEvaluationParser_yacc.cpp" + break; + + case 21: +#line 209 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 37: /* bool: bool TOKEN_LOGICAL_EQ bool */ -#line 357 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } #line 1730 "CEvaluationParser_yacc.cpp" - break; + break; - case 38: /* bool: bool TOKEN_LOGICAL_EQ d_or_b */ -#line 364 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyvsp[0]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1742 "CEvaluationParser_yacc.cpp" - break; + case 22: +#line 218 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Number); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 39: /* bool: d_or_b TOKEN_LOGICAL_EQ bool */ -#line 372 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1754 "CEvaluationParser_yacc.cpp" - break; +#line 1744 "CEvaluationParser_yacc.cpp" + break; - case 40: /* bool: exp TOKEN_LOGICAL_NE exp */ -#line 380 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1765 "CEvaluationParser_yacc.cpp" - break; + case 23: +#line 228 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Number); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 41: /* bool: d_or_b TOKEN_LOGICAL_NE exp */ -#line 387 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Number); - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1777 "CEvaluationParser_yacc.cpp" - break; +#line 1758 "CEvaluationParser_yacc.cpp" + break; - case 42: /* bool: bool TOKEN_LOGICAL_NE bool */ -#line 395 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1788 "CEvaluationParser_yacc.cpp" - break; + case 24: +#line 238 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[-7]; + yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 43: /* bool: bool TOKEN_LOGICAL_NE d_or_b */ -#line 402 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyvsp[0]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1800 "CEvaluationParser_yacc.cpp" - break; +#line 1772 "CEvaluationParser_yacc.cpp" + break; - case 44: /* bool: d_or_b TOKEN_LOGICAL_NE bool */ -#line 410 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1812 "CEvaluationParser_yacc.cpp" - break; + case 25: +#line 248 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[-7]; + yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-5]); + yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Number); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } + +#line 1787 "CEvaluationParser_yacc.cpp" + break; + + case 26: +#line 259 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Number); + yyval = yyvsp[-7]; + yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Number); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } + +#line 1802 "CEvaluationParser_yacc.cpp" + break; + + case 27: +#line 271 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + mpRootNode = yyval; + } + +#line 1811 "CEvaluationParser_yacc.cpp" + break; + + case 28: +#line 276 "CEvaluationParser.ypp" + { + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 45: /* bool: exp TOKEN_LOGICAL_GE exp */ -#line 418 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } #line 1823 "CEvaluationParser_yacc.cpp" - break; + break; - case 46: /* bool: exp TOKEN_LOGICAL_GT exp */ -#line 425 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1834 "CEvaluationParser_yacc.cpp" - break; + case 29: +#line 284 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 47: /* bool: exp TOKEN_LOGICAL_LE exp */ -#line 432 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1845 "CEvaluationParser_yacc.cpp" - break; +#line 1837 "CEvaluationParser_yacc.cpp" + break; - case 48: /* bool: exp TOKEN_LOGICAL_LT exp */ -#line 439 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1856 "CEvaluationParser_yacc.cpp" - break; + case 30: +#line 294 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval = yyvsp[-7]; + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 49: /* bool: bool TOKEN_LOGICAL_OR bool */ -#line 446 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1867 "CEvaluationParser_yacc.cpp" - break; +#line 1851 "CEvaluationParser_yacc.cpp" + break; - case 50: /* bool: bool TOKEN_LOGICAL_XOR bool */ -#line 453 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1878 "CEvaluationParser_yacc.cpp" - break; + case 31: +#line 304 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval = yyvsp[-7]; + yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 51: /* bool: bool TOKEN_LOGICAL_AND bool */ -#line 460 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1889 "CEvaluationParser_yacc.cpp" - break; +#line 1865 "CEvaluationParser_yacc.cpp" + break; - case 52: /* bool: TOKEN_STRUCTURE_OPEN bool TOKEN_STRUCTURE_CLOSE */ -#line 467 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - mpRootNode = yyval; - } -#line 1898 "CEvaluationParser_yacc.cpp" - break; + case 32: +#line 314 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval = yyvsp[-7]; + yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-5]); + yyvsp[-3]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-3]); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 53: /* bool: TOKEN_LOGICAL_NOT bool */ -#line 472 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1908 "CEvaluationParser_yacc.cpp" - break; +#line 1880 "CEvaluationParser_yacc.cpp" + break; - case 54: /* bool: TOKEN_LOGICAL_NOT d_or_b */ -#line 478 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyvsp[0]->setValueType(CEvaluationNode::ValueType::Boolean); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } -#line 1919 "CEvaluationParser_yacc.cpp" - break; + case 33: +#line 325 "CEvaluationParser.ypp" + { + yyvsp[-7]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval = yyvsp[-7]; + yyvsp[-5]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-5]); + yyval->addChild(yyvsp[-3]); + yyvsp[-1]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-1]); + mpRootNode = yyval; + } - case 55: /* function: TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN TOKEN_STRUCTURE_CLOSE */ -#line 486 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - } -#line 1927 "CEvaluationParser_yacc.cpp" - break; +#line 1895 "CEvaluationParser_yacc.cpp" + break; - case 56: /* function: TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE */ -#line 490 "CEvaluationParser.ypp" - { - yyval = yyvsp[-3]; - yyval->addChild(yyvsp[-1]); - } -#line 1936 "CEvaluationParser_yacc.cpp" - break; + case 34: +#line 336 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 57: /* function: fcont exp TOKEN_STRUCTURE_CLOSE */ -#line 495 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 1945 "CEvaluationParser_yacc.cpp" - break; +#line 1906 "CEvaluationParser_yacc.cpp" + break; - case 58: /* fcont: TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_COMMA */ -#line 501 "CEvaluationParser.ypp" - { - yyval = yyvsp[-3]; - yyval->addChild(yyvsp[-1]); - } -#line 1954 "CEvaluationParser_yacc.cpp" - break; + case 35: +#line 343 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Number); + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 59: /* fcont: fcont exp TOKEN_STRUCTURE_COMMA */ -#line 506 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 1963 "CEvaluationParser_yacc.cpp" - break; +#line 1918 "CEvaluationParser_yacc.cpp" + break; - case 60: /* vector: TOKEN_STRUCTURE_VECTOR_OPEN TOKEN_STRUCTURE_VECTOR_CLOSE */ -#line 512 "CEvaluationParser.ypp" - { - yyval = new CEvaluationNodeVector(); - mpNodeList->push_back(yyval); - } -#line 1972 "CEvaluationParser_yacc.cpp" - break; + case 36: +#line 351 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 61: /* vector: vstart TOKEN_STRUCTURE_VECTOR_CLOSE */ -#line 517 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - } -#line 1980 "CEvaluationParser_yacc.cpp" - break; +#line 1929 "CEvaluationParser_yacc.cpp" + break; - case 62: /* vstart: TOKEN_STRUCTURE_VECTOR_OPEN exp */ -#line 523 "CEvaluationParser.ypp" - { - yyval = new CEvaluationNodeVector(); - mpNodeList->push_back(yyval); - yyval->addChild(yyvsp[0]); - } -#line 1990 "CEvaluationParser_yacc.cpp" - break; + case 37: +#line 358 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyvsp[0]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 63: /* vstart: TOKEN_STRUCTURE_VECTOR_OPEN vector */ -#line 529 "CEvaluationParser.ypp" - { - yyval = new CEvaluationNodeVector(); - mpNodeList->push_back(yyval); - yyval->addChild(yyvsp[0]); - } -#line 2000 "CEvaluationParser_yacc.cpp" - break; +#line 1941 "CEvaluationParser_yacc.cpp" + break; - case 64: /* vstart: vstart TOKEN_STRUCTURE_COMMA exp */ -#line 535 "CEvaluationParser.ypp" - { - yyval->addChild(yyvsp[0]); - } -#line 2008 "CEvaluationParser_yacc.cpp" - break; + case 38: +#line 366 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 65: /* vstart: vstart TOKEN_STRUCTURE_COMMA vector */ -#line 539 "CEvaluationParser.ypp" - { - yyval->addChild(yyvsp[0]); - } -#line 2016 "CEvaluationParser_yacc.cpp" - break; +#line 1953 "CEvaluationParser_yacc.cpp" + break; - case 66: /* call: TOKEN_CALL TOKEN_STRUCTURE_CLOSE */ -#line 544 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - } -#line 2024 "CEvaluationParser_yacc.cpp" - break; + case 39: +#line 374 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 1964 "CEvaluationParser_yacc.cpp" + break; + + case 40: +#line 381 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Number); + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 1976 "CEvaluationParser_yacc.cpp" + break; + + case 41: +#line 389 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 1987 "CEvaluationParser_yacc.cpp" + break; + + case 42: +#line 396 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyvsp[0]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 1999 "CEvaluationParser_yacc.cpp" + break; + + case 43: +#line 404 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyvsp[-2]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 2011 "CEvaluationParser_yacc.cpp" + break; + + case 44: +#line 412 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 2022 "CEvaluationParser_yacc.cpp" + break; + + case 45: +#line 419 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 67: /* call: ccont d_or_b TOKEN_STRUCTURE_CLOSE */ -#line 548 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } #line 2033 "CEvaluationParser_yacc.cpp" - break; + break; - case 68: /* call: ccont exp TOKEN_STRUCTURE_CLOSE */ -#line 553 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 2042 "CEvaluationParser_yacc.cpp" - break; + case 46: +#line 426 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 69: /* call: ccont bool TOKEN_STRUCTURE_CLOSE */ -#line 558 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 2051 "CEvaluationParser_yacc.cpp" - break; +#line 2044 "CEvaluationParser_yacc.cpp" + break; - case 70: /* call: ccont vector TOKEN_STRUCTURE_CLOSE */ -#line 563 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 2060 "CEvaluationParser_yacc.cpp" - break; + case 47: +#line 433 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 71: /* ccont: TOKEN_CALL */ -#line 569 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - } -#line 2068 "CEvaluationParser_yacc.cpp" - break; +#line 2055 "CEvaluationParser_yacc.cpp" + break; + + case 48: +#line 440 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 2066 "CEvaluationParser_yacc.cpp" + break; + + case 49: +#line 447 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 72: /* ccont: ccont d_or_b TOKEN_STRUCTURE_COMMA */ -#line 573 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } #line 2077 "CEvaluationParser_yacc.cpp" - break; + break; - case 73: /* ccont: ccont exp TOKEN_STRUCTURE_COMMA */ -#line 578 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 2086 "CEvaluationParser_yacc.cpp" - break; + case 50: +#line 454 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[-2]); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } - case 74: /* ccont: ccont bool TOKEN_STRUCTURE_COMMA */ -#line 583 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 2095 "CEvaluationParser_yacc.cpp" - break; +#line 2088 "CEvaluationParser_yacc.cpp" + break; - case 75: /* ccont: ccont vector TOKEN_STRUCTURE_COMMA */ -#line 588 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } -#line 2104 "CEvaluationParser_yacc.cpp" - break; + case 51: +#line 461 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + mpRootNode = yyval; + } + +#line 2097 "CEvaluationParser_yacc.cpp" + break; + + case 52: +#line 466 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 2107 "CEvaluationParser_yacc.cpp" + break; + case 53: +#line 472 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + yyvsp[0]->setValueType(CEvaluationNode::ValueType::Boolean); + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } + +#line 2118 "CEvaluationParser_yacc.cpp" + break; + + case 54: +#line 480 "CEvaluationParser.ypp" + { + yyval = new CEvaluationNodeVector(); + mpNodeList->push_back(yyval); + } + +#line 2127 "CEvaluationParser_yacc.cpp" + break; + + case 55: +#line 485 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + } + +#line 2135 "CEvaluationParser_yacc.cpp" + break; + + case 56: +#line 491 "CEvaluationParser.ypp" + { + yyval = new CEvaluationNodeVector(); + mpNodeList->push_back(yyval); + yyval->addChild(yyvsp[0]); + } + +#line 2145 "CEvaluationParser_yacc.cpp" + break; + + case 57: +#line 497 "CEvaluationParser.ypp" + { + yyval = new CEvaluationNodeVector(); + mpNodeList->push_back(yyval); + yyval->addChild(yyvsp[0]); + } + +#line 2155 "CEvaluationParser_yacc.cpp" + break; + + case 58: +#line 503 "CEvaluationParser.ypp" + { + yyval->addChild(yyvsp[0]); + } + +#line 2163 "CEvaluationParser_yacc.cpp" + break; + + case 59: +#line 507 "CEvaluationParser.ypp" + { + yyval->addChild(yyvsp[0]); + } + +#line 2171 "CEvaluationParser_yacc.cpp" + break; + + case 60: +#line 512 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + } + +#line 2179 "CEvaluationParser_yacc.cpp" + break; + + case 61: +#line 516 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } -#line 2108 "CEvaluationParser_yacc.cpp" +#line 2188 "CEvaluationParser_yacc.cpp" + break; + + case 62: +#line 521 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2197 "CEvaluationParser_yacc.cpp" + break; + + case 63: +#line 526 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2206 "CEvaluationParser_yacc.cpp" + break; + + case 64: +#line 531 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2215 "CEvaluationParser_yacc.cpp" + break; + + case 65: +#line 537 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + } + +#line 2223 "CEvaluationParser_yacc.cpp" + break; + + case 66: +#line 541 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2232 "CEvaluationParser_yacc.cpp" + break; + + case 67: +#line 546 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2241 "CEvaluationParser_yacc.cpp" + break; + + case 68: +#line 551 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2250 "CEvaluationParser_yacc.cpp" + break; + + case 69: +#line 556 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + yyval->addChild(yyvsp[-1]); + } + +#line 2259 "CEvaluationParser_yacc.cpp" + break; + +#line 2263 "CEvaluationParser_yacc.cpp" default: break; } + /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. @@ -2118,10 +2373,11 @@ yyparse (void) case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc); - YYPOPSTACK (yylen); + YYPOPSTACK(yylen); yylen = 0; + YY_STACK_PRINT(yyss, yyssp); *++yyvsp = yyval; @@ -2138,19 +2394,57 @@ yyparse (void) goto yynewstate; - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; - yyerror (YY_("syntax error")); +#if ! YYERROR_VERBOSE + yyerror(YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE(yymsg); + + yymsg = YY_CAST(char *, YYSTACK_ALLOC(YY_CAST(YYSIZE_T, yymsg_alloc))); + + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + + yyerror(yymsgp); + + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif } if (yyerrstatus == 3) @@ -2166,8 +2460,8 @@ yyparse (void) } else { - yydestruct ("Error: discarding", - yytoken, &yylval); + yydestruct("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; } } @@ -2176,42 +2470,42 @@ yyparse (void) token. */ goto yyerrlab1; - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; - ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ - YYPOPSTACK (yylen); + YYPOPSTACK(yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); + YY_STACK_PRINT(yyss, yyssp); yystate = *yyssp; goto yyerrlab1; - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ - /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + + if (!yypact_value_is_default(yyn)) { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + yyn += YYTERROR; + + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; + if (0 < yyn) break; } @@ -2221,81 +2515,85 @@ yyparse (void) if (yyssp == yyss) YYABORT; - - yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp); - YYPOPSTACK (1); + yydestruct("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK(1); yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + YY_STACK_PRINT(yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturnlab; - + goto yyreturn; -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturnlab; + goto yyreturn; - -/*-----------------------------------------------------------. -| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | -`-----------------------------------------------------------*/ +#if !defined yyoverflow || YYERROR_VERBOSE + /*-------------------------------------------------. + | yyexhaustedlab -- memory exhaustion comes here. | + `-------------------------------------------------*/ yyexhaustedlab: - yyerror (YY_("memory exhausted")); + yyerror(YY_("memory exhausted")); yyresult = 2; - goto yyreturnlab; + /* Fall through. */ +#endif + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ +yyreturn: -/*----------------------------------------------------------. -| yyreturnlab -- parsing is finished, clean up and return. | -`----------------------------------------------------------*/ -yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken = YYTRANSLATE(yychar); + yydestruct("Cleanup: discarding lookahead", + yytoken, &yylval); } + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); + YYPOPSTACK(yylen); + YY_STACK_PRINT(yyss, yyssp); + while (yyssp != yyss) { - yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); - YYPOPSTACK (1); + yydestruct("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK(1); } + #ifndef yyoverflow + if (yyss != yyssa) - YYSTACK_FREE (yyss); + YYSTACK_FREE(yyss); + #endif +#if YYERROR_VERBOSE + + if (yymsg != yymsgbuf) + YYSTACK_FREE(yymsg); +#endif return yyresult; } - -#line 594 "CEvaluationParser.ypp" - - +#line 562 "CEvaluationParser.ypp" diff --git a/copasi/function/CEvaluationParser_yacc.hpp b/copasi/function/CEvaluationParser_yacc.hpp index 902f029585..5728d263eb 100644 --- a/copasi/function/CEvaluationParser_yacc.hpp +++ b/copasi/function/CEvaluationParser_yacc.hpp @@ -1,8 +1,23 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ +// Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and University of +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2014 - 2016 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and The University +// of Manchester. +// All rights reserved. + +/* A Bison parser, made by GNU Bison 3.5. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +31,7 @@ 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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,9 +46,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ #ifndef YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED # define YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED @@ -45,47 +59,41 @@ extern int CEvaluationParserdebug; #endif -/* Token kinds. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - TOKEN_NUMBER = 258, /* TOKEN_NUMBER */ - TOKEN_VARIABLE = 259, /* TOKEN_VARIABLE */ - TOKEN_UNIT = 260, /* TOKEN_UNIT */ - TOKEN_CALL = 261, /* TOKEN_CALL */ - TOKEN_FUNCTION = 262, /* TOKEN_FUNCTION */ - TOKEN_FUNCTION_1 = 263, /* TOKEN_FUNCTION_1 */ - TOKEN_FUNCTION_2 = 264, /* TOKEN_FUNCTION_2 */ - TOKEN_SIGN = 265, /* TOKEN_SIGN */ - TOKEN_OPERATOR_POWER = 266, /* TOKEN_OPERATOR_POWER */ - TOKEN_OPERATOR_MULTIPLY = 267, /* TOKEN_OPERATOR_MULTIPLY */ - TOKEN_OPERATOR_MODULUS = 268, /* TOKEN_OPERATOR_MODULUS */ - TOKEN_OPERATOR_REMAINDER = 269, /* TOKEN_OPERATOR_REMAINDER */ - TOKEN_OPERATOR_PLUS = 270, /* TOKEN_OPERATOR_PLUS */ - TOKEN_LOGICAL_CHOICE = 271, /* TOKEN_LOGICAL_CHOICE */ - TOKEN_LOGICAL_VALUE = 272, /* TOKEN_LOGICAL_VALUE */ - TOKEN_LOGICAL_NOT = 273, /* TOKEN_LOGICAL_NOT */ - TOKEN_LOGICAL_OR = 274, /* TOKEN_LOGICAL_OR */ - TOKEN_LOGICAL_XOR = 275, /* TOKEN_LOGICAL_XOR */ - TOKEN_LOGICAL_AND = 276, /* TOKEN_LOGICAL_AND */ - TOKEN_LOGICAL_EQ = 277, /* TOKEN_LOGICAL_EQ */ - TOKEN_LOGICAL_NE = 278, /* TOKEN_LOGICAL_NE */ - TOKEN_LOGICAL_GT = 279, /* TOKEN_LOGICAL_GT */ - TOKEN_LOGICAL_GE = 280, /* TOKEN_LOGICAL_GE */ - TOKEN_LOGICAL_LT = 281, /* TOKEN_LOGICAL_LT */ - TOKEN_LOGICAL_LE = 282, /* TOKEN_LOGICAL_LE */ - TOKEN_STRUCTURE_OPEN = 283, /* TOKEN_STRUCTURE_OPEN */ - TOKEN_STRUCTURE_VECTOR_OPEN = 284, /* TOKEN_STRUCTURE_VECTOR_OPEN */ - TOKEN_STRUCTURE_COMMA = 285, /* TOKEN_STRUCTURE_COMMA */ - TOKEN_STRUCTURE_CLOSE = 286, /* TOKEN_STRUCTURE_CLOSE */ - TOKEN_STRUCTURE_VECTOR_CLOSE = 287 /* TOKEN_STRUCTURE_VECTOR_CLOSE */ - }; - typedef enum yytokentype yytoken_kind_t; +enum yytokentype +{ + TOKEN_NUMBER = 258, + TOKEN_VARIABLE = 259, + TOKEN_UNIT = 260, + TOKEN_CALL = 261, + TOKEN_FUNCTION = 262, + TOKEN_FUNCTION_2 = 263, + TOKEN_SIGN = 264, + TOKEN_OPERATOR_POWER = 265, + TOKEN_OPERATOR_MULTIPLY = 266, + TOKEN_OPERATOR_MODULUS = 267, + TOKEN_OPERATOR_REMAINDER = 268, + TOKEN_OPERATOR_PLUS = 269, + TOKEN_LOGICAL_CHOICE = 270, + TOKEN_LOGICAL_VALUE = 271, + TOKEN_LOGICAL_NOT = 272, + TOKEN_LOGICAL_OR = 273, + TOKEN_LOGICAL_XOR = 274, + TOKEN_LOGICAL_AND = 275, + TOKEN_LOGICAL_EQ = 276, + TOKEN_LOGICAL_NE = 277, + TOKEN_LOGICAL_GT = 278, + TOKEN_LOGICAL_GE = 279, + TOKEN_LOGICAL_LT = 280, + TOKEN_LOGICAL_LE = 281, + TOKEN_STRUCTURE_OPEN = 282, + TOKEN_STRUCTURE_VECTOR_OPEN = 283, + TOKEN_STRUCTURE_COMMA = 284, + TOKEN_STRUCTURE_CLOSE = 285, + TOKEN_STRUCTURE_VECTOR_CLOSE = 286 +}; #endif /* Value type. */ @@ -95,11 +103,8 @@ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif - extern YYSTYPE CEvaluationParserlval; - -int CEvaluationParserparse (void); - +int CEvaluationParserparse(void); #endif /* !YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED */ diff --git a/copasi/function/CEvaluationTree.cpp b/copasi/function/CEvaluationTree.cpp index 57350198f0..81b1f17c73 100644 --- a/copasi/function/CEvaluationTree.cpp +++ b/copasi/function/CEvaluationTree.cpp @@ -694,7 +694,6 @@ CEvaluationNode * CEvaluationTree::fromAST(const ASTNode * pASTNode, bool isFunc case AST_POWER: case AST_FUNCTION_POWER: case AST_FUNCTION_REM: - case AST_FUNCTION_QUOTIENT: // create a CEvaluationNodeOperator pResultNode = CEvaluationNodeOperator::fromAST(*itNode, itNode.context()); break; @@ -798,7 +797,6 @@ CEvaluationNode * CEvaluationTree::fromAST(const ASTNode * pASTNode, bool isFunc case AST_RELATIONAL_LEQ: case AST_RELATIONAL_LT: case AST_RELATIONAL_NEQ: - case AST_LOGICAL_IMPLIES: pResultNode = CEvaluationNodeLogical::fromAST(*itNode, itNode.context()); break; @@ -838,9 +836,9 @@ void CEvaluationTree::initObjects() addObjectReference("Value", mValue); } -ASTNode * CEvaluationTree::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const +ASTNode* CEvaluationTree::toAST(const CDataModel* pDataModel) const { - return mpRootNode->toAST(pDataModel, sbmlLevel, sbmlVersion); + return mpRootNode->toAST(pDataModel); } bool CEvaluationTree::hasCircularDependency() const @@ -892,7 +890,6 @@ bool CEvaluationTree::hasDiscontinuity() const case (CEvaluationNode::MainType::FUNCTION | CEvaluationNode::SubType::CEIL): case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::MODULUS): case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::REMAINDER): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::QUOTIENT): // We found a discontinuity. return true; break; diff --git a/copasi/function/CEvaluationTree.h b/copasi/function/CEvaluationTree.h index 4f559f91ca..7f540fce35 100644 --- a/copasi/function/CEvaluationTree.h +++ b/copasi/function/CEvaluationTree.h @@ -180,7 +180,7 @@ class CEvaluationTree: * Converts a CEvaluationTree to an ASTNode based tree. * @return ASTNode* root node of the tree. */ - virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; + virtual ASTNode* toAST(const CDataModel* pDataModel) const; /** * Set the infix description of the tree and compile it. diff --git a/copasi/lapack/blaswrap.h b/copasi/lapack/blaswrap.h index 7253f90bb2..c52f1a11d5 100644 --- a/copasi/lapack/blaswrap.h +++ b/copasi/lapack/blaswrap.h @@ -34,11 +34,7 @@ extern "C" # define daxpy_ daxpy # define dcopy_ dcopy # define ddot_ ddot -# if (defined WIN32) -# define dgemm_ DGEMM -#else # define dgemm_ dgemm -#endif # define dnrm2_ dnrm2 # define dscal_ dscal # define idamax_ idamax @@ -79,7 +75,7 @@ extern "C" # include # elif defined(HAVE_CBLAS_H) # include -# elif !defined(USE_MKL) +# else # include "copasi/lapack/blas.h" # endif diff --git a/copasi/lapack/lapackwrap.h b/copasi/lapack/lapackwrap.h index d59da41da8..c616ca4a6f 100644 --- a/copasi/lapack/lapackwrap.h +++ b/copasi/lapack/lapackwrap.h @@ -1,14 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the -// University of Virginia, University of Heidelberg, and University -// of Connecticut School of Medicine. -// All rights reserved. - -// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual -// Properties, Inc., University of Heidelberg, and University of -// of Connecticut School of Medicine. -// All rights reserved. - -// Copyright (C) 2013 - 2016 by Pedro Mendes, Virginia Tech Intellectual +// Copyright (C) 2013 - 2015 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and The University // of Manchester. // All rights reserved. @@ -1058,7 +1048,7 @@ extern "C" # define zhetri_ ZHETRI # define zhetrs_ ZHETRS # define zhgeqz_ ZHGEQZ -# define zhpcon_ ZHPCON +# define zhpcon_ ZHPCONLAPACK_INCLUDE_DIR # define zhpev_ ZHPEV # define zhpevd_ ZHPEVD # define zhpevx_ ZHPEVX @@ -1266,7 +1256,7 @@ extern "C" # if defined (HAVE_CLAPACK_H) && !defined(HAVE_APPLE) && !defined(COPASI_OVERWRITE_USE_LAPACK) # include # else -# if !defined(HAVE_APPLE) && !defined(USE_MKL) +# if !defined(HAVE_APPLE) # include "copasi/lapack/lapack.h" # endif # endif diff --git a/copasi/math/CJitCompilerImplementation.cpp b/copasi/math/CJitCompilerImplementation.cpp index a71b78ff6e..c66716bdf8 100644 --- a/copasi/math/CJitCompilerImplementation.cpp +++ b/copasi/math/CJitCompilerImplementation.cpp @@ -9,16 +9,12 @@ #include "copasi/math/CMathExpression.h" #include "copasi/utilities/CNodeIterator.h" #include "copasi/utilities/CCopasiMessage.h" -#include "copasi/utilities/CBalanceTree.h" #include "copasi/commandline/CConfigurationFile.h" #include "copasi/core/CRootContainer.h" // static size_t CJitCompilerImplementation::InitalBufferSize = 8192; -// static -C_FLOAT64 CJitCompilerImplementation::Invalid = std::numeric_limits< C_FLOAT64 >::quiet_NaN(); - // static void CJitCompilerImplementation::SetJitBufferSize(const size_t size) { @@ -485,13 +481,6 @@ CJitCompilerImplementation::Node * CJitCompilerImplementation::compile(const CEv } break; - case CEvaluationNode::SubType::QUOTIENT: - { - auto & Function = mpExpression->Immediate< F2 >(__jit_quotient); - pNodeJIT = &mpExpression->Call(Function, *static_cast< NativeJIT::Node< C_FLOAT64 > * >(context[0]), *static_cast< NativeJIT::Node< C_FLOAT64 > * >(context[1])); - } - break; - default: break; } @@ -791,27 +780,15 @@ CJitCompilerImplementation::Node * CJitCompilerImplementation::compile(const CEv case CEvaluationNode::SubType::MAX: { - if (context.empty()) - pNodeJIT = &mpExpression->Immediate(&Invalid); - else - pNodeJIT = BalanceTree< Node * >::create(context, [this](Node * const & pFirst, Node * const & pSecond) - { - auto & Function = mpExpression->Immediate< F2 >(__jit_max); - return &mpExpression->Call(Function, *static_cast< NativeJIT::Node< C_FLOAT64 > * >(pFirst), *static_cast< NativeJIT::Node< C_FLOAT64 > * >(pSecond)); - }); + auto & Function = mpExpression->Immediate< F2 >(CEvaluationNodeFunction::max); + pNodeJIT = &mpExpression->Call(Function, *static_cast< NativeJIT::Node< C_FLOAT64 > * >(context[0]), *static_cast< NativeJIT::Node< C_FLOAT64 > * >(context[1])); } break; case CEvaluationNode::SubType::MIN: { - if (context.empty()) - pNodeJIT = &mpExpression->Immediate(&Invalid); - else - pNodeJIT = BalanceTree< Node * >::create(context, [this](Node * const & pFirst, Node * const & pSecond) - { - auto & Function = mpExpression->Immediate< F2 >(__jit_min); - return &mpExpression->Call(Function, *static_cast< NativeJIT::Node< C_FLOAT64 > * >(pFirst), *static_cast< NativeJIT::Node< C_FLOAT64 > * >(pSecond)); - }); + auto & Function = mpExpression->Immediate< F2 >(CEvaluationNodeFunction::min); + pNodeJIT = &mpExpression->Call(Function, *static_cast< NativeJIT::Node< C_FLOAT64 > * >(context[0]), *static_cast< NativeJIT::Node< C_FLOAT64 > * >(context[1])); } break; @@ -877,13 +854,6 @@ CJitCompilerImplementation::Node * CJitCompilerImplementation::compile(const CEv } break; - case CEvaluationNode::SubType::IMPLIES: - { - auto & Function = mpExpression->Immediate< B2B >(__jit_implies); - pNodeJIT = &mpExpression->Call(Function, *static_cast< NativeJIT::Node< bool > * >(context[0]), *static_cast< NativeJIT::Node< bool > * >(context[1])); - } - break; - case CEvaluationNode::SubType::AND: { pNodeJIT = &mpExpression->And(*static_cast< NativeJIT::Node< bool > * >(context[0]), *static_cast< NativeJIT::Node< bool > * >(context[1])); diff --git a/copasi/math/CJitCompilerImplementation.h b/copasi/math/CJitCompilerImplementation.h index 3e3ad6883c..b05acfd7e4 100644 --- a/copasi/math/CJitCompilerImplementation.h +++ b/copasi/math/CJitCompilerImplementation.h @@ -6,8 +6,6 @@ #ifndef COPASI_CJitCompilerImplementation #define COPASI_CJitCompilerImplementation -#include - #include "copasi/math/CJitCompiler.h" #if (defined USE_JIT) && defined (JIT_IMPLEMENTATION) @@ -43,7 +41,6 @@ class CJitCompilerImplementation: public CJitCompiler private: static size_t InitalBufferSize; - static C_FLOAT64 Invalid; #ifdef USE_JIT protected: @@ -88,14 +85,7 @@ class CJitCompilerImplementation: public CJitCompiler return (C_FLOAT64)(((C_INT32) x) % ((C_INT32) y)); } - static inline C_FLOAT64 __jit_quotient(C_FLOAT64 x, C_FLOAT64 y) - { - return (x - fmod(x, y)) / y; - } - static inline C_FLOAT64 __jit_max(C_FLOAT64 x, C_FLOAT64 y){return x > y ? x : y;} - static inline C_FLOAT64 __jit_min(C_FLOAT64 x, C_FLOAT64 y){return x < y ? x : y;} static inline bool __jit_xor(bool x, bool y) {return (x || y) && (x != y);} - static inline bool __jit_implies(bool x, bool y) {return !x || y;} static inline bool __jit_eq(bool x, bool y) {return x == y;} static inline bool __jit_eq(C_FLOAT64 x, C_FLOAT64 y) {return x == y;} static inline bool __jit_neq(bool x, bool y) {return x != y;} diff --git a/copasi/math/CMathContainer.cpp b/copasi/math/CMathContainer.cpp index 063559004d..1ae8c2096a 100644 --- a/copasi/math/CMathContainer.cpp +++ b/copasi/math/CMathContainer.cpp @@ -614,7 +614,7 @@ CMathContainer::~CMathContainer() setObjectParent(NULL); } -bool CMathContainer::operator == (const CMathContainer & rhs) const +bool CMathContainer::operator == (const CMathContainer & rhs) { return mpModel == rhs.mpModel && mCompileTime == rhs.mCompileTime; } @@ -1845,8 +1845,6 @@ CEvaluationNode * CMathContainer::copyBranch(const CEvaluationNode * pNode, case (CEvaluationNode::MainType::FUNCTION | CEvaluationNode::SubType::CEIL): case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::MODULUS): case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::REMAINDER): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::QUOTIENT): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::IMPLIES): if (replaceDiscontinuousNodes) { @@ -4728,8 +4726,6 @@ void CMathContainer::createDiscontinuityEvents(const CEvaluationTree * pTree, case (CEvaluationNode::MainType::FUNCTION | CEvaluationNode::SubType::CEIL): case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::MODULUS): case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::REMAINDER): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::QUOTIENT): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::IMPLIES): createDiscontinuityDataEvent(*itNode); break; @@ -4783,9 +4779,7 @@ std::string CMathContainer::createDiscontinuityTriggerInfix(const CEvaluationNod break; case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::REMAINDER): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::QUOTIENT): - case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::IMPLIES): - TriggerInfix = "sin(PI*(" + static_cast< const CEvaluationNode * >(pNode->getChild())->buildInfix() + ")/("; + TriggerInfix = "sin(PI*(" + static_cast< const CEvaluationNode * >(pNode->getChild())->buildInfix() + "/"; TriggerInfix += static_cast< const CEvaluationNode * >(pNode->getChild()->getSibling())->buildInfix() + ")) > 0"; break; diff --git a/copasi/math/CMathContainer.h b/copasi/math/CMathContainer.h index 9e6902da64..777b9eabb1 100644 --- a/copasi/math/CMathContainer.h +++ b/copasi/math/CMathContainer.h @@ -162,9 +162,9 @@ class CMathContainer: public CDataContainer virtual ~CMathContainer(); /** - * Check whether 2 container would generate equivalent results + * Check whether 2 container would genereate equivalent results */ - bool operator == (const CMathContainer & rhs) const; + bool operator == (const CMathContainer & rhs); /** * diff --git a/copasi/math/CMathEvent.cpp b/copasi/math/CMathEvent.cpp index 5f39c5c12f..ab679c92b6 100644 --- a/copasi/math/CMathEvent.cpp +++ b/copasi/math/CMathEvent.cpp @@ -809,7 +809,6 @@ CEvaluationNode * CMathEvent::CTrigger::compile(const CEvaluationNode * pTrigger case (CEvaluationNode::MainType::LOGICAL | CEvaluationNode::SubType::AND): case (CEvaluationNode::MainType::LOGICAL | CEvaluationNode::SubType::OR): case (CEvaluationNode::MainType::LOGICAL | CEvaluationNode::SubType::XOR): - case (CEvaluationNode::MainType::LOGICAL | CEvaluationNode::SubType::IMPLIES): pNode = compileAND(*itNode, itNode.context(), variables, pRoot, container); break; @@ -887,10 +886,6 @@ CEvaluationNode * CMathEvent::CTrigger::compileAND(const CEvaluationNode * pTrig pNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::XOR, "XOR"); break; - case CEvaluationNode::SubType::IMPLIES: - pNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::IMPLIES, "IMPLIES"); - break; - default: break; } diff --git a/copasi/model/CCompartment.cpp b/copasi/model/CCompartment.cpp index a59d19576e..aa74a5db08 100644 --- a/copasi/model/CCompartment.cpp +++ b/copasi/model/CCompartment.cpp @@ -74,7 +74,7 @@ bool CCompartment::applyData(const CData & data, CUndoData::CChangeSet & changes { const CData & Data = data.getProperty(CData::INITIAL_VALUE).toData(); mIValue = Data.getProperty(CData::VALUE).toDouble(); - mpModel->updateInitialValues(CCore::FrameworkNames.toEnum(Data.getProperty(CData::FRAMEWORK).toString(), CCore::Framework::ParticleNumbers), false); + mpModel->updateInitialValues(CCore::FrameworkNames.toEnum(Data.getProperty(CData::FRAMEWORK).toString(), CCore::Framework::ParticleNumbers)); changes.add({CUndoData::Type::CHANGE, "State", mpModel->getStringCN(), mpModel->getStringCN()}); } diff --git a/copasi/model/CModel.cpp b/copasi/model/CModel.cpp index c2ac87e350..975d5edf4d 100644 --- a/copasi/model/CModel.cpp +++ b/copasi/model/CModel.cpp @@ -1307,9 +1307,32 @@ CModelParameterSet & CModel::getActiveModelParameterSet() return mParameterSet; } -void CModel::refreshActiveParameterSet() +void CModel::applyActiveParameterSet() { + CModelParameterSet * pParameterSet = + dynamic_cast< CModelParameterSet * >(CRootContainer::getKeyFactory()->get(mActiveParameterSetKey)); + + if (pParameterSet != NULL) + { + pParameterSet->updateModel(); + } + else + { + /* + CModelParameterSet * pParameterSet = new CModelParameterSet(UTCTimeStamp()); + mParameterSets.add(pParameterSet, true); + mActiveParameterSetKey = pParameterSet->getKey(); + pParameterSet->createFromModel(); + */ + } + mParameterSet.createFromModel(); + mActiveParameterSetKey = mParameterSet.getKey(); +} + +void CModel::refreshActiveParameterSet() +{ + mParameterSet.refreshFromModel(false); } CDataVectorN < CEvent > & CModel::getEvents() @@ -1757,7 +1780,7 @@ bool CModel::setQuantityUnit(const std::string & name, mNumber2QuantityFactor = 1.0 / mQuantity2NumberFactor; - updateInitialValues(framework, false); + updateInitialValues(framework); return true; } diff --git a/copasi/model/CModel.h b/copasi/model/CModel.h index 28f52e2107..ae3fa62345 100644 --- a/copasi/model/CModel.h +++ b/copasi/model/CModel.h @@ -325,6 +325,11 @@ class CModel : public CModelEntity const CModelParameterSet & getActiveModelParameterSet() const; CModelParameterSet & getActiveModelParameterSet(); + /** + * Update the model initial values from the active parameter set. + */ + void applyActiveParameterSet(); + /** * refresh the active parameter set from the model initial values */ @@ -506,7 +511,7 @@ class CModel : public CModelEntity * @param refreshParameterSet (default: true) if true the active parameter set is refreshed * @return bool success */ - bool updateInitialValues(const CCore::Framework & framework, bool refreshParameterSet = true); + bool updateInitialValues(const CCore::Framework & framework, bool refreshParameterSet=true); /** * Copy the current state value to the initial state @@ -1031,7 +1036,7 @@ class CModel : public CModelEntity * * @see buildInitialRefreshSequence(std::set< const CDataObject * > & changedObjects) */ - void updateInitialValues(std::set< const CDataObject * > & changedObjects, bool refreshParameterSet = true); + void updateInitialValues(std::set< const CDataObject * > & changedObjects, bool refreshParameterSet=true); /** * Builds and executes the the update sequence used to calculate all initial @@ -1044,7 +1049,7 @@ class CModel : public CModelEntity * * @see updateInitialValues(std::set< const CDataObject * > & changedObjects) */ - void updateInitialValues(const CDataObject * changedObject, bool refreshParameterSet = true); + void updateInitialValues(const CDataObject * changedObject, bool refreshParameterSet=true); /** * Initialize a vector of individual absolute tolerances diff --git a/copasi/model/CModelParameterSet.cpp b/copasi/model/CModelParameterSet.cpp index ffe4dab4c8..725cb112a7 100644 --- a/copasi/model/CModelParameterSet.cpp +++ b/copasi/model/CModelParameterSet.cpp @@ -203,41 +203,6 @@ CModelParameterSet::CModelParameterSet(const CModelParameterSet & src, compile(); } -CModelParameterSet::CModelParameterSet(CModel * pModel, - const CDataContainer * pParent): - CDataContainer("No Name", pParent, "ModelParameterSet"), - CAnnotation(), - CModelParameterGroup(NULL, CModelParameter::Type::Set), - mKey(CRootContainer::getKeyFactory()->add("ModelParameterSet", this)), - mpModel(pModel), - mpTimes(NULL), - mpCompartments(NULL), - mpSpecies(NULL), - mpModelValues(NULL), - mpReactions(NULL) -{ - initMiriamAnnotation(mKey); - - // Create the proper structure that fits the parameter overview in the GUI - mpTimes = static_cast< CModelParameterGroup * >(CModelParameterGroup::add(Type::Group)); - mpTimes->setCN(CDataString("Initial Time").getCN()); - - mpCompartments = static_cast< CModelParameterGroup * >(CModelParameterGroup::add(Type::Group)); - mpCompartments->setCN(CDataString("Initial Compartment Sizes").getCN()); - - mpSpecies = static_cast< CModelParameterGroup * >(CModelParameterGroup::add(Type::Group)); - mpSpecies->setCN(CDataString("Initial Species Values").getCN()); - - mpModelValues = static_cast< CModelParameterGroup * >(CModelParameterGroup::add(Type::Group)); - mpModelValues->setCN(CDataString("Initial Global Quantities").getCN()); - - mpReactions = static_cast< CModelParameterGroup * >(CModelParameterGroup::add(Type::Group)); - mpReactions->setCN(CDataString("Kinetic Parameters").getCN()); - setObjectParent(pParent); - - createFromModel(); -} - // virtual CModelParameterSet::~CModelParameterSet() { @@ -334,8 +299,7 @@ bool CModelParameterSet::setObjectParent(const CDataContainer * pParent) { bool success = CDataObject::setObjectParent(pParent); - if (mpModel == nullptr) - mpModel = dynamic_cast< CModel * >(getObjectAncestor("Model")); + mpModel = dynamic_cast< CModel * >(getObjectAncestor("Model")); return success; } @@ -500,7 +464,7 @@ bool CModelParameterSet::updateModel() bool success = CModelParameterGroup::updateModel(); - mpModel->updateInitialValues(CCore::Framework::ParticleNumbers, true); + mpModel->updateInitialValues(CCore::Framework::ParticleNumbers); return success; } diff --git a/copasi/model/CModelParameterSet.h b/copasi/model/CModelParameterSet.h index af33f59ea6..31f1a7f28f 100644 --- a/copasi/model/CModelParameterSet.h +++ b/copasi/model/CModelParameterSet.h @@ -100,14 +100,6 @@ class CModelParameterSet: public CDataContainer, public CModelParameterGroup, pu const CDataContainer * pParent, const bool & createMissing = false); - /** - * Specific constructor - * @param CModel * pModel - * @param const CDataContainer * pParent - */ - CModelParameterSet(CModel * pModel, - const CDataContainer * pParent); - /** * Destructor */ diff --git a/copasi/model/CReaction.cpp b/copasi/model/CReaction.cpp index e55d782163..1fc5783a5c 100644 --- a/copasi/model/CReaction.cpp +++ b/copasi/model/CReaction.cpp @@ -916,6 +916,7 @@ void CReaction::initializeParameters() mParameters.addParameter(name, CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 1.0); + pParameter = mParameters.getParameter(name); } @@ -989,7 +990,7 @@ CIssue CReaction::compile() // Clear all mValidity flags which might be set here. mValidity.remove(CValidity::Severity::All, - CValidity::Kind(CIssue::eKind::KineticsUndefined) | CIssue::eKind::VariablesMismatch | CIssue::eKind::ObjectNotFound | CIssue::eKind::MissingInitialValue); + CValidity::Kind(CIssue::eKind::KineticsUndefined) | CIssue::eKind::VariablesMismatch | CIssue::eKind::ObjectNotFound); std::set< const CDataObject * > Dependencies; @@ -1002,6 +1003,7 @@ CIssue CReaction::compile() else { Issue &= CIssue(CIssue::eSeverity::Warning, CIssue::eKind::KineticsUndefined); + mValidity.add(Issue); mFlux = 0.0; mParticleFlux = 0.0; } @@ -1056,18 +1058,6 @@ CIssue CReaction::compile() mPrerequisits.erase(NULL); - // Check whether we have local parameters with value NaN - - CCopasiParameterGroup::const_name_iterator itParameter = mParameters.beginName(); - CCopasiParameterGroup::const_name_iterator endParameter = mParameters.endName(); - - for (; itParameter != endParameter; ++itParameter) - if (isLocalParameter(itParameter->getObjectName()) - && std::isnan(itParameter->getValue< C_FLOAT64 >())) - Issue &= CIssue(CIssue::eSeverity::Error, CIssue::eKind::MissingInitialValue); - - mValidity.add(Issue); - return Issue; } @@ -1523,10 +1513,10 @@ std::string CReaction::sanitizeSBMLId(const std::string & id) CEvaluationNodeVariable* CReaction::object2variable(const CEvaluationNodeObject* objectNode, std::map >& replacementMap, std::map& copasi2sbmlmap) { CEvaluationNodeVariable* pVariableNode = NULL; - std::string Data = objectNode->getData(); - CCommonName ObjectCN(Data.substr(1, Data.size() - 2)); + std::string objectCN = objectNode->getData(); - CDataObject * object = resolveCN(getFirstCModelOrDefault(copasi2sbmlmap), ObjectCN); + CDataObject * object = resolveCN(getFirstCModelOrDefault(copasi2sbmlmap), + CCommonName(objectCN.substr(1, objectCN.size() - 2))); std::string id; @@ -1715,29 +1705,6 @@ CEvaluationNodeVariable* CReaction::object2variable(const CEvaluationNodeObject* CCopasiMessage(CCopasiMessage::ERROR, MCReaction + 4); } } - else - { - // We have no mapped object. We will create a variable of type parameter which is not mapped. - // Check whether we already created a variable with that name: - CCommonName ParentCN; - std::string Type; - std::string Name; - - ObjectCN.split(ParentCN, Type, Name); - std::string Id(Name.empty() ? Type : Name); - - pVariableNode = new CEvaluationNodeVariable(CEvaluationNode::SubType::DEFAULT, Id); - - if (replacementMap.find(Id) == replacementMap.end()) - { - CFunctionParameter * pFunParam = new CFunctionParameter(Id, CFunctionParameter::DataType::FLOAT64, - CFunctionParameter::Role::PARAMETER); - mParameters.addParameter(Id, - CCopasiParameter::Type::DOUBLE, - std::numeric_limits< C_FLOAT64 >::quiet_NaN()); - replacementMap[Id] = std::make_pair(mParameters.getParameter(Id), pFunParam); - } - } return pVariableNode; } diff --git a/copasi/model/CReaction.h b/copasi/model/CReaction.h index 7b82db86a4..3bb980e80f 100644 --- a/copasi/model/CReaction.h +++ b/copasi/model/CReaction.h @@ -35,7 +35,6 @@ #include #include #include -#include #include "copasi/model/CAnnotation.h" #include "copasi/model/CMetab.h" diff --git a/copasi/optimization/COptMethodNL2SOL.cpp b/copasi/optimization/COptMethodNL2SOL.cpp index fd64044a5d..0a879b9bc4 100644 --- a/copasi/optimization/COptMethodNL2SOL.cpp +++ b/copasi/optimization/COptMethodNL2SOL.cpp @@ -15,6 +15,7 @@ #include "copasi/parameterFitting/CFitProblem.h" #include "COptItem.h" #include "COptTask.h" +#include "FminBrent.h" COptMethodNL2SOL::COptMethodNL2SOL(const CDataContainer * pParent, const CTaskEnum::Method & methodType, diff --git a/copasi/optimization/COptMethodPS.cpp b/copasi/optimization/COptMethodPS.cpp index ac6ed95372..b62b866ef6 100644 --- a/copasi/optimization/COptMethodPS.cpp +++ b/copasi/optimization/COptMethodPS.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -104,7 +104,7 @@ C_FLOAT64 COptMethodPS::evaluate() // evaluate the fitness if (!pOptProblem->calculate()) -#pragma omp critical (ps_evaluate_continue) +#pragma omp critical mContinue = false; C_FLOAT64 EvaluationValue; @@ -117,7 +117,7 @@ C_FLOAT64 COptMethodPS::evaluate() if (mProblemContext.isThread(&pOptProblem)) { -#pragma omp critical (ps_evaluate_increment_counters) +#pragma omp critical mProblemContext.master()->incrementCounters(pOptProblem->getCounters()); pOptProblem->resetCounters(); @@ -198,7 +198,7 @@ bool COptMethodPS::move(const size_t & index) { Improved = true; -#pragma omp critical (ps_move_best_value) +#pragma omp critical { mImprovements[index] = EvaluationValue; @@ -340,7 +340,7 @@ bool COptMethodPS::create(const size_t & index) memcpy(mBestPositions[index], mIndividuals[index]->array(), sizeof(C_FLOAT64) * mVariableSize); if (mBestValues[index] < mBestValue) -#pragma omp critical (ps_create_best_value) +#pragma omp critical { // and store that value mBestIndex = index; diff --git a/copasi/optimization/COptMethodSteepestDescent.cpp b/copasi/optimization/COptMethodSteepestDescent.cpp index 9f4e276721..372d717c2a 100644 --- a/copasi/optimization/COptMethodSteepestDescent.cpp +++ b/copasi/optimization/COptMethodSteepestDescent.cpp @@ -31,7 +31,7 @@ #include "COptItem.h" #include "COptTask.h" -#include "copasi/utilities/CBrent.h" +#include "FminBrent.h" #include "copasi/core/CDataObjectReference.h" @@ -47,6 +47,7 @@ COptMethodSteepestDescent::COptMethodSteepestDescent(const CDataContainer * pPar mVariableSize(0), mIndividual(0), mGradient(0), + mpDescent(new FDescentTemplate(this, &COptMethodSteepestDescent::descentLine)), mCurrentIteration(0) { assertParameter("Iteration Limit", CCopasiParameter::Type::UINT, (unsigned C_INT32) 100); @@ -63,11 +64,14 @@ COptMethodSteepestDescent::COptMethodSteepestDescent(const COptMethodSteepestDes mVariableSize(src.mVariableSize), mIndividual(src.mIndividual), mGradient(src.mGradient), + mpDescent(new FDescentTemplate(this, &COptMethodSteepestDescent::descentLine)), mCurrentIteration(src.mCurrentIteration) {} COptMethodSteepestDescent::~COptMethodSteepestDescent() { + pdelete(mpDescent); + cleanup(); } diff --git a/copasi/optimization/COptMethodSteepestDescent.h b/copasi/optimization/COptMethodSteepestDescent.h index 609c5c9492..adc7acb5c9 100644 --- a/copasi/optimization/COptMethodSteepestDescent.h +++ b/copasi/optimization/COptMethodSteepestDescent.h @@ -28,6 +28,8 @@ #include "copasi/core/CVector.h" #include "copasi/optimization/COptMethod.h" +class FDescent; + class COptMethodSteepestDescent: public COptMethod { // Operations @@ -162,6 +164,11 @@ private : */ CVector < C_FLOAT64 > mGradient; + /** + * Functor pointing to the descent method. + */ + FDescent * mpDescent; + /** * The current iteration */ diff --git a/copasi/optimization/COptProblem.cpp b/copasi/optimization/COptProblem.cpp index 94b1853e3c..d6b92e85ae 100644 --- a/copasi/optimization/COptProblem.cpp +++ b/copasi/optimization/COptProblem.cpp @@ -208,9 +208,6 @@ void COptProblem::initializeParameter() mpGrpItems = assertGroup("OptimizationItemList"); mpGrpConstraints = assertGroup("OptimizationConstraintList"); - // only used by the GUI to display more information on opt methods during runs - assertParameter("DisplayPoplations", CCopasiParameter::Type::BOOL, false); - elevateChildren(); } diff --git a/copasi/optimization/FminBrent.cpp b/copasi/optimization/FminBrent.cpp new file mode 100644 index 0000000000..e8265aa81c --- /dev/null +++ b/copasi/optimization/FminBrent.cpp @@ -0,0 +1,152 @@ +// Copyright (C) 2019 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and University of +// of Connecticut School of Medicine. +// All rights reserved. + +// Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and The University +// of Manchester. +// All rights reserved. + +// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., EML Research, gGmbH, University of Heidelberg, +// and The University of Manchester. +// All rights reserved. + +// Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc. and EML Research, gGmbH. +// All rights reserved. + +#include +#include + +#include "copasi/copasi.h" +#include "FminBrent.h" + +#define SQRT_EPSILON sqrt(std::numeric_limits< C_FLOAT64 >::epsilon()) + +int FminBrent(double a, /* Left border */ + double b, /* Right border */ + FDescent * pF, /* Functor for function under investigation */ + double *min, /* Location of minimum */ + double *fmin, /* Value of minimum */ + double tol, /* Acceptable tolerance */ + int maxiter) /* Maximum number of iterations */ +{ + double x, v, w; /* Abscissae, descr. see above */ + double fx; /* f(x) */ + double fv; /* f(v) */ + double fw; /* f(w) */ + const double r = (3. - sqrt(5.0)) / 2; /* Gold section ratio */ + int iter; /* Iteration counter */ + + if (tol <= 0) return 1; /* check input values */ + + if (b <= a) return 2; + + v = a + r * (b - a); fv = (*pF)(v); /* First step - always gold section*/ + x = v; w = v; + fx = fv; fw = fv; + + for (iter = 0; iter < maxiter; iter++) /* Main iteration loop */ + { + double range = b - a; /* Range over which the minimum is */ + double middle_range = (a + b) / 2; /* seeked */ + double tol_act = /* Actual tolerance */ + SQRT_EPSILON * fabs(x) + tol / 3; + double new_step; /* Step at this iteration */ + + if (fabs(x - middle_range) + range / 2 <= 2 * tol_act) + { + *min = x; *fmin = fx; /* Store the solution */ + return 0; /* Acceptable approx. is found */ + } + + /* Obtain the gold section step */ + new_step = r * (x < middle_range ? b - x : a - x); + + /* Decide if the interpolation */ + + /* can be tried */ + if (fabs(x - w) >= tol_act) /* If x and w are distinct */ + { + /* interpolatiom may be tried */ + double p; /* Interpolation step is calculated */ + double q; /* as p/q; division operation */ + double t; /* is delayed until last moment */ + + t = (x - w) * (fx - fv); + q = (x - v) * (fx - fw); + p = (x - v) * q - (x - w) * t; + q = 2 * (q - t); + + if (q > 0.0) /* q was calculated with the */ + p = -p; /* opposite sign; make q positive */ + else /* and assign possible minus to */ + q = -q; /* p */ + + if (fabs(p) < fabs(new_step * q) && /* If x+p/q falls in [a,b] */ + p > q * (a - x + 2 * tol_act) && /* not too close to a and */ + p < q * (b - x - 2 * tol_act)) /* b, and isn't too large */ + new_step = p / q; /* it is accepted */ + + /* If p/q is too large then the */ + /* gold section procedure can */ + /* reduce [a,b] range to more */ + /* extent */ + } + + if (fabs(new_step) < tol_act) /* Adjust the step to be not less */ + { + if (new_step > (double)0) /* than tolerance */ + new_step = tol_act; + else + new_step = -tol_act; + } + + /* Obtain the next approximation to */ + { + /* min & reduce the enveloping range*/ + double t = x + new_step; /* Tentative point for the min */ + double ft = (*pF)(t); + + if (ft <= fx) + { + /* t is a better approximation */ + if (t < x) /* Reduce the range so that */ + b = x; /* t would fall within it */ + else + a = x; + + v = w; w = x; x = t; /* Assign the best approx to x */ + fv = fw; fw = fx; fx = ft; + } + else /* x remains the better approx */ + { + if (t < x) /* Reduce the range enclosing x */ + a = t; + else + b = t; + + if (ft <= fw || w == x) + { + v = w; w = t; + fv = fw; fw = ft; + } + else if (ft <= fv || v == x || v == w) + { + v = t; + fv = ft; + } + } + } /* ----- end-of-block ----- */ + } /* ===== End of loop ===== */ + + *min = x; *fmin = fx; /* Store the best value */ + return 3; /* Too many iterations */ +} diff --git a/copasi/optimization/FminBrent.h b/copasi/optimization/FminBrent.h new file mode 100644 index 0000000000..3e89e54160 --- /dev/null +++ b/copasi/optimization/FminBrent.h @@ -0,0 +1,119 @@ +// Copyright (C) 2010 - 2014 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., University of Heidelberg, and The University +// of Manchester. +// All rights reserved. + +// Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc., EML Research, gGmbH, University of Heidelberg, +// and The University of Manchester. +// All rights reserved. + +// Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual +// Properties, Inc. and EML Research, gGmbH. +// All rights reserved. + +#ifndef COAPSI_FminBrent +#define COAPSI_FminBrent + +/** + * + * Adapted by Pedro Mendes to suit Gepasi's optimisation framework + * 9 Aug 1997 + * + **ORIGINAL**in**netlib********************************************** + * C math library + * function FMINBR - one-dimensional search for a function minimum + * over the given range + * + * Input + * double FminBrent(a, b, f, min, fmin, tol, maxiter) + * @param double a; Minimum will be seeked for over + * @param double b; a range [a,b], a being < b. + * @param double (*f)(double x); Name of the function whose minimum + * will be seeked for + * @param double *min, Location of minimum (output) + * @param double *fmin, Value of minimum (ouput) + * @param double tol; Acceptable tolerance for the minimum + * location. It have to be positive + * (e.g. may be specified as EPSILON) + * @param int maxiter Maximum number of iterations + * + * Output + * Fminbr returns an estimate for the minimum location with accuracy + * 3*SQRT_EPSILON*abs(x) + tol. + * The function always obtains a local minimum which coincides with + * the global one only if a function under investigation being + * unimodular. + * If a function being examined possesses no local minimum within + * the given range, Fminbr returns 'a' (if f(a) < f(b)), otherwise + * it returns the right range boundary value b. + * + * @ return int (0: success, 1: negative tolerance, 2: b < a 3: iteration limit exceeded) + * + * Algorithm + * G.Forsythe, M.Malcolm, C.Moler, Computer methods for mathematical + * computations. M., Mir, 1980, p.202 of the Russian edition + * + * The function makes use of the "gold section" procedure combined with + * the parabolic interpolation. + * At every step program operates three abscissae - x,v, and w. + * x - the last and the best approximation to the minimum location, + * i.e. f(x) <= f(a) or/and f(x) <= f(b) + * (if the function f has a local minimum in (a,b), then the both + * conditions are fulfiled after one or two steps). + * v,w are previous approximations to the minimum location. They may + * coincide with a, b, or x (although the algorithm tries to make all + * u, v, and w distinct). Points x, v, and w are used to construct + * interpolating parabola whose minimum will be treated as a new + * approximation to the minimum location if the former falls within + * [a,b] and reduces the range enveloping minimum more efficient than + * the gold section procedure. + * When f(x) has a second derivative positive at the minimum location + * (not coinciding with a or b) the procedure converges superlinearly + * at a rate order about 1.324 + * + ************************************************************************ + */ + +class FDescent +{ +public: + virtual ~FDescent() {}; + + virtual C_FLOAT64 operator()(const C_FLOAT64 & C_UNUSED(value)) + {return std::numeric_limits::quiet_NaN();} +}; + +template class FDescentTemplate : public FDescent +{ +private: + C_FLOAT64(CType::*mMethod)(const C_FLOAT64 &); // pointer to member function + CType * mpType; // pointer to object + +public: + + // constructor - takes pointer to an object and pointer to a member and stores + // them in two private variables + FDescentTemplate(CType * pType, + C_FLOAT64(CType::*method)(const C_FLOAT64 &)) + { + mpType = pType; + mMethod = method; + }; + + virtual ~FDescentTemplate() {}; + + // override operator "()" + virtual C_FLOAT64 operator()(const C_FLOAT64 & value) + {return (*mpType.*mMethod)(value);} ; // execute member function +}; + +int FminBrent(double a, /* Left border */ + double b, /* Right border */ + FDescent * pF, /* Functor for function under investigation */ + double *min, /* Location of minimum */ + double *fmin, /* Value of minimum */ + double tol, /* Acceptable tolerance */ + int maxiter); /* Maximum number of iterations */ + +#endif // COAPSI_FminBrent diff --git a/copasi/plotUI/CQCustomPlot.cpp b/copasi/plotUI/CQCustomPlot.cpp index 5f2739b841..a8bb64f93f 100644 --- a/copasi/plotUI/CQCustomPlot.cpp +++ b/copasi/plotUI/CQCustomPlot.cpp @@ -232,7 +232,6 @@ CQCustomPlot::CQCustomPlot(const CPlotSpecification * plotspec, QWidget * parent this->xAxis->setProperty("axis_label", action->data()); this->updateSteadyStateInfo(type); this->mSelectedIndependent = ""; - this->mHaveNewData = true; if (type == X_AXIS_VALUE) { @@ -2373,7 +2372,7 @@ void CQCustomPlot::setupLegend() legend->clearItems(); - for (int i = (currentPage) * maxItems; i < ((currentPage + 1) *maxItems) && i < numItems && i >=0; ++i) + for (int i = (currentPage) * maxItems; i < ((currentPage + 1) *maxItems) && i < numItems; ++i) { auto * current = mCurves[i]; diff --git a/copasi/plotUI/CQMarchingSquares.cpp b/copasi/plotUI/CQMarchingSquares.cpp index 56b78b419c..40cb84b9d9 100644 --- a/copasi/plotUI/CQMarchingSquares.cpp +++ b/copasi/plotUI/CQMarchingSquares.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2023 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -7,6 +7,7 @@ #if defined(COPASI_USE_QCUSTOMPLOT) + void CQMarchingSquares::levelPaths::openPoligon(double x, double y) { _current.push_back(QPointF(x, y)); @@ -85,8 +86,6 @@ QPointF CQMarchingSquares::IsoCell::normalizedPointCCW(side cellSide) case TOP: return QPointF(_top, 1); } - - return QPointF(); } /** diff --git a/copasi/resourcesUI/copasi.qrc b/copasi/resourcesUI/copasi.qrc index 50ab513560..90940f0d73 100644 --- a/copasi/resourcesUI/copasi.qrc +++ b/copasi/resourcesUI/copasi.qrc @@ -61,7 +61,5 @@ images/dialog_information.png images/dialog_warning.png images/dialog_question.png - - preferences.ini diff --git a/copasi/resourcesUI/preferences.ini b/copasi/resourcesUI/preferences.ini deleted file mode 100644 index 191e897979..0000000000 --- a/copasi/resourcesUI/preferences.ini +++ /dev/null @@ -1,159 +0,0 @@ -[Editing] -[Editing/Use Advanced Sliders] -name=Use Advanced Sliders -type=bool -value=false -parameter=Use Advanced Sliders -tooltip="If set, changing the sliders by keyboard will automatically execute the task" - -[Editing/Use Advanced Editing] -name=Use Advanced Editing -type=bool -value=false -parameter=Use Advanced Editing -tooltip="If set, in expressions COPASI DisplayNames can be directly entered in expression windows" - -[Editing/Normalize Weights per Experiment] -name=Normalize Weights per Experiment -type=bool -value=false -parameter=Normalize Weights per Experiment -tooltip="If set, the weights of the experiments will be normalized per experiment, rather than over all experiments." - -[Editing/Validate Units] -name=Validate Units -type=bool -value=false -parameter=Validate Units - -[Editing/Disable JIT Compilation] -name=Disable JIT Compilation -type=bool -value=false -parameter=Disable JIT Compilation -tooltip="If set, the JIT compilation will be disabled. This may be necessary if the JIT compilation causes problems." - - -[Display] -[Display/Application Font] -name=Application Font -type=string -value= -parameter=Application Font -tooltip="The font used for the application" - -[Display/Resize Tables to Content] -name=Resize Tables to Content -type=bool -parameter=Resize Tables to Content -tooltip="If set, tables will be resized to fit their content (this may take a long time)" -value=true - -[Display/Double Precision for String Conversion] -name=Double Precision for String Conversion -type=int -value=10 -parameter=Double Precision for String Conversion - -[Display/Enable additional optimization parameters] -name=Enable additional optimization parameters -type=bool -parameter=Enable additional optimization parameters -tooltip="If set, additional optimization parameters will be shown in the method settings." -value=false - - -[User Information] -[User Information/Given Name] -name=Given Name -type=string -value= -parameter=Given Name - -[User Information/Family Name] -name=Family Name -type=string -value= -parameter=Family Name - -[User Information/Organization] -name=Organization -type=string -value= -parameter=Organization - -[User Information/Email] -name=Email -type=string -value= -parameter=Email - - -[Check for Updates] -[Check for Updates/Enabled] -name=Enabled -type=bool -value= -parameter=Check for Updates.Enabled - -[Check for Updates/Skip Version] -name=Skip Version -type=string -value= -parameter=Check for Updates.Skip Version - -[Check for Updates/Last Checked] -name=Last Checked -type=string -value=2013-01-01T00:00:00 -parameter=Check for Updates.Last Checked - -[Check for Updates/Interval] -name=Interval -type=int -value=7 -parameter=Check for Updates.Interval - -[Recent Files] -[Recent Files/Max Files] -name=Max Files -type=int -value=5 -parameter=Recent Files.MaxFiles - -[Recent Files/Max SBML Files] -name=Max SBML Files -type=int -value=5 -parameter=Recent SBML Files.MaxFiles - -[Recent Files/Max SEDML Files] -name=Max SEDML Files -type=int -value=5 -parameter=Recent SEDML Files.MaxFiles - -[Proxy] -[Proxy/Proxy Server] -name=Proxy Server -type=string -value= -parameter=Proxy Server - -[Proxy/Proxy Port] -name=Proxy Port -type=int -value=0 -parameter=Proxy Port - -[Proxy/Proxy User] -name=Proxy User -type=string -value= -parameter=Proxy User - -[Proxy/Proxy Password] -name=Proxy Password -type=string -value= -parameter=Proxy Password diff --git a/copasi/sbml/CSBMLExporter.cpp b/copasi/sbml/CSBMLExporter.cpp index bb8acf2678..6ce94c44f8 100644 --- a/copasi/sbml/CSBMLExporter.cpp +++ b/copasi/sbml/CSBMLExporter.cpp @@ -168,10 +168,6 @@ std::string addRateOfIfItDoesNotExist(SBMLDocument* pSBMLDocument, std::map& idMap, const char* id) { - // don't add for l3v2 - if (!pSBMLDocument || (pSBMLDocument->getLevel() == 3 && pSBMLDocument->getVersion() > 1)) - return ""; - std::string newId = hasFunctionDefinitionForURI(pSBMLDocument, "http://sbml.org/annotations/symbols", "symbols", @@ -7328,7 +7324,7 @@ ASTNode* CSBMLExporter::convertToASTNode(const CEvaluationNode* pOrig, CDataMode // functions that have an SBML id // if they don't, we have to set one this->setFunctionSBMLIds(pOrig, dataModel); - ASTNode* pResult = pOrig->toAST(&dataModel, mSBMLLevel, mSBMLVersion); + ASTNode* pResult = pOrig->toAST(&dataModel); adjustNames(pResult, mpSBMLDocument, mIdMap); diff --git a/copasi/sbml/SBMLImporter.cpp b/copasi/sbml/SBMLImporter.cpp index 022a48d372..d570dd5515 100644 --- a/copasi/sbml/SBMLImporter.cpp +++ b/copasi/sbml/SBMLImporter.cpp @@ -1271,7 +1271,7 @@ void ensureAllArgsAreBeingUsedInFunctionDefinition(const FunctionDefinition* sbm for (unsigned int i = 0; i < sbmlFunction->getNumArguments(); ++i) str << sbmlFunction->getArgument(i)->getName() << ", "; - char* formula = SBML_formulaToL3String(sbmlFunction->getBody()); + char* formula = SBML_formulaToString(sbmlFunction->getBody()); str << formula; std::vector::iterator it; @@ -1282,7 +1282,7 @@ void ensureAllArgsAreBeingUsedInFunctionDefinition(const FunctionDefinition* sbm str << ")"; // update the function definition - const_cast(sbmlFunction)->setMath(SBML_parseL3Formula(str.str().c_str())); + const_cast(sbmlFunction)->setMath(SBML_parseFormula(str.str().c_str())); // free the formula free(formula); @@ -2322,7 +2322,7 @@ SBMLImporter::createCReactionFromReaction(Reaction* sbmlReaction, Model* pSBMLMo /* Create a new user defined CKinFunction */ if (!sbmlId2CopasiCN(node, copasi2sbmlmap, copasiReaction->getParameters(), sbmlReaction)) { - CCopasiMessage(CCopasiMessage::ERROR, MCSBML + 27, copasiReaction->getObjectName().c_str()); + CCopasiMessage(CCopasiMessage::EXCEPTION, MCSBML + 27, copasiReaction->getObjectName().c_str()); } CEvaluationNode* pExpressionTreeRoot = CEvaluationTree::fromAST(node, false); @@ -2565,13 +2565,6 @@ SBMLImporter::createCReactionFromReaction(Reaction* sbmlReaction, Model* pSBMLMo copasiReaction->isReversible() ? TriTrue : TriFalse)) { pNonconstFun->setReversible(TriUnspecified); - - if (pNonconstFun->getInfix() == "@") - { - // set infix to something more usable which even though - // invalid, may help others to fix this - pNonconstFun->setInfix(SBML_formulaToL3String(kLawMath)); - } } if (CRootContainer::getFunctionList()->loadedFunctions().size() > ExistingFunctions) @@ -3287,147 +3280,148 @@ CModelValue* SBMLImporter::createCModelValueFromParameter(const Parameter* sbmlP bool SBMLImporter::sbmlId2CopasiCN(ASTNode* pNode, std::map& copasi2sbmlmap, CCopasiParameterGroup& pParamGroup, SBase* pParentObject) { - CNodeIterator< ASTNode > itNode(pNode); - itNode.setProcessingModes(CNodeIteratorMode::Before); + // TODO CRITICAL We need to use a node iterator + bool success = true; + unsigned int i, iMax = pNode->getNumChildren(); - while (itNode.next() != itNode.end()) + if (pNode->getType() == AST_NAME) { - if (*itNode == NULL) + Reaction* pParentReaction = dynamic_cast(pParentObject); + Compartment* pSBMLCompartment = NULL; + Species* pSBMLSpecies = NULL; + Reaction* pSBMLReaction = NULL; + Parameter* pSBMLParameter = NULL; + std::string sbmlId; + std::string name = pNode->getName(); + CCopasiParameter* pParam = pParamGroup.getParameter(name); + + std::map::const_iterator speciesReference = mSBMLSpeciesReferenceIds.find(name); + + // replace species references only in case we don't have a local parameter + // that shadows it + if (speciesReference != mSBMLSpeciesReferenceIds.end() + && (pParentReaction == NULL + || pParentReaction->getKineticLaw() == NULL + || pParentReaction->getKineticLaw()->getParameter(name) == NULL)) { - continue; + // replace the name with the value + pNode->setType(AST_REAL); + pNode->setValue(speciesReference->second); } - - if (itNode->getType() == AST_NAME) + else if (pParam) { - Reaction * pParentReaction = dynamic_cast< Reaction * >(pParentObject); - Compartment * pSBMLCompartment = NULL; - Species * pSBMLSpecies = NULL; - Reaction * pSBMLReaction = NULL; - Parameter * pSBMLParameter = NULL; - std::string sbmlId; - std::string name = itNode->getName(); - CCopasiParameter * pParam = pParamGroup.getParameter(name); - - std::map< std::string, double >::const_iterator speciesReference = mSBMLSpeciesReferenceIds.find(name); + pNode->setName(pParam->getStringCN().c_str()); + } + else + { + std::map::iterator it = copasi2sbmlmap.begin(); + std::map::iterator endIt = copasi2sbmlmap.end(); + bool found = false; - // replace species references only in case we don't have a local parameter - // that shadows it - if (speciesReference != mSBMLSpeciesReferenceIds.end() - && (pParentReaction == NULL - || pParentReaction->getKineticLaw() == NULL - || pParentReaction->getKineticLaw()->getParameter(name) == NULL)) - { - // replace the name with the value - itNode->setType(AST_REAL); - itNode->setValue(speciesReference->second); - } - else if (pParam) - { - itNode->setName(pParam->getStringCN().c_str()); - } - else + while (it != endIt) { - std::map< const CDataObject *, SBase * >::iterator it = copasi2sbmlmap.begin(); - std::map< const CDataObject *, SBase * >::iterator endIt = copasi2sbmlmap.end(); - bool found = false; + int type = it->second->getTypeCode(); - while (it != endIt) + switch (type) { - int type = it->second->getTypeCode(); + case SBML_COMPARTMENT: + pSBMLCompartment = dynamic_cast(it->second); - switch (type) - { - case SBML_COMPARTMENT: - pSBMLCompartment = dynamic_cast< Compartment * >(it->second); - - if (this->mLevel == 1) - { - sbmlId = pSBMLCompartment->getName(); - } - else - { - sbmlId = pSBMLCompartment->getId(); - } - - if (sbmlId == itNode->getName()) - { - itNode->setName(dynamic_cast< const CCompartment * >(it->first)->getObject(CCommonName("Reference=InitialVolume"))->getStringCN().c_str()); - found = true; - } - - break; - - case SBML_SPECIES: - pSBMLSpecies = dynamic_cast< Species * >(it->second); - - if (this->mLevel == 1) - { - sbmlId = pSBMLSpecies->getName(); - } - else - { - sbmlId = pSBMLSpecies->getId(); - } - - if (sbmlId == itNode->getName()) - { - itNode->setName(dynamic_cast< const CMetab * >(it->first)->getObject(CCommonName("Reference=InitialConcentration"))->getStringCN().c_str()); - found = true; - } - - break; - - case SBML_REACTION: - pSBMLReaction = dynamic_cast< Reaction * >(it->second); - - if (this->mLevel == 1) - { - sbmlId = pSBMLReaction->getName(); - } - else - { - sbmlId = pSBMLReaction->getId(); - } - - if (sbmlId == itNode->getName()) - { - itNode->setName(dynamic_cast< const CReaction * >(it->first)->getObject(CCommonName("Reference=ParticleFlux"))->getStringCN().c_str()); - found = true; - } - - break; - - case SBML_PARAMETER: - pSBMLParameter = dynamic_cast< Parameter * >(it->second); - - if (this->mLevel == 1) - { - sbmlId = pSBMLParameter->getName(); - } - else - { - sbmlId = pSBMLParameter->getId(); - } - - if (sbmlId == itNode->getName()) - { - itNode->setName(dynamic_cast< const CModelValue * >(it->first)->getValueReference()->getStringCN().c_str()); - found = true; - } - - break; - - default: - break; - } + if (this->mLevel == 1) + { + sbmlId = pSBMLCompartment->getName(); + } + else + { + sbmlId = pSBMLCompartment->getId(); + } - ++it; + if (sbmlId == pNode->getName()) + { + pNode->setName(dynamic_cast(it->first)->getObject(CCommonName("Reference=InitialVolume"))->getStringCN().c_str()); + found = true; + } + + break; + + case SBML_SPECIES: + pSBMLSpecies = dynamic_cast(it->second); + + if (this->mLevel == 1) + { + sbmlId = pSBMLSpecies->getName(); + } + else + { + sbmlId = pSBMLSpecies->getId(); + } + + if (sbmlId == pNode->getName()) + { + pNode->setName(dynamic_cast(it->first)->getObject(CCommonName("Reference=InitialConcentration"))->getStringCN().c_str()); + found = true; + } + + break; + + case SBML_REACTION: + pSBMLReaction = dynamic_cast(it->second); + + if (this->mLevel == 1) + { + sbmlId = pSBMLReaction->getName(); + } + else + { + sbmlId = pSBMLReaction->getId(); + } + + if (sbmlId == pNode->getName()) + { + pNode->setName(dynamic_cast(it->first)->getObject(CCommonName("Reference=ParticleFlux"))->getStringCN().c_str()); + found = true; + } + + break; + + case SBML_PARAMETER: + pSBMLParameter = dynamic_cast(it->second); + + if (this->mLevel == 1) + { + sbmlId = pSBMLParameter->getName(); + } + else + { + sbmlId = pSBMLParameter->getId(); + } + + if (sbmlId == pNode->getName()) + { + pNode->setName(dynamic_cast(it->first)->getValueReference()->getStringCN().c_str()); + found = true; + } + + break; + + default: + break; } - if (!found) - success = false; + ++it; } + + if (!found) success = false; + } + } + + for (i = 0; i < iMax; ++i) + { + if (!this->sbmlId2CopasiCN(pNode->getChild(i), copasi2sbmlmap, pParamGroup, pParentObject)) + { + success = false; + break; } } @@ -3571,6 +3565,8 @@ SBMLImporter::preprocessNode(ConverterASTNode * pNode, Model * pSBMLModel, mReactionsWithReplacedLocalParameters.insert(pSBMLReaction->getId()); } } + + this->mDelayFound = result; } this->replaceCallNodeNames(pNode); @@ -3780,7 +3776,6 @@ bool SBMLImporter::isDelayOrRateFunctionUsed(ConverterASTNode* pASTNode) if (itNode->getType() == AST_FUNCTION_DELAY || itNode->getType() == AST_FUNCTION_RATE_OF) { - mDelayFound = mDelayFound || itNode->getType() == AST_FUNCTION_DELAY; result = true; break; } @@ -6215,7 +6210,7 @@ bool SBMLImporter::setInitialValues(CModel* pModel, const std::mapgetObject(std::string("Reference=Avogadro Constant")))); mChangedObjects.insert(CObjectInterface::DataObject(pModel->getObject(std::string("Reference=Quantity Conversion Factor")))); - pModel->updateInitialValues(mChangedObjects, true); + pModel->updateInitialValues(mChangedObjects); return true; } @@ -7582,7 +7577,7 @@ void SBMLImporter::replaceDelayAndRateOfInReaction(ConverterASTNode * pASTNode, void SBMLImporter::replaceUnsupportedNodeInKinetic(CNodeIterator< ConverterASTNode >& itNode, std::map< std::string, std::string > & map, std::string prefix, Model * pModel, std::map< const CDataObject *, SBase * > & copasi2sbmlmap, Reaction * pSBMLReaction, std::map< std::string, std::string > & localReplacementMap) { - std::string formula = SBML_formulaToL3String(*itNode); + std::string formula = SBML_formulaToString(*itNode); std::map< std::string, std::string >::const_iterator pos = map.find(formula); std::string replacementId; diff --git a/copasi/sbml/SBMLImporter.h b/copasi/sbml/SBMLImporter.h index 534403dea3..1cd1936f19 100644 --- a/copasi/sbml/SBMLImporter.h +++ b/copasi/sbml/SBMLImporter.h @@ -359,7 +359,7 @@ class SBMLImporter : public SBMLUnitSupport * This function replaces the AST_FUNCTION_POWER ASTNodes in a ASTNode tree * with the AST_POWER node. */ - //void replacePowerFunctionNodes(ASTNode* node); + void replacePowerFunctionNodes(ASTNode* node); /** * This functions replaces all species nodes for species that are in the substanceOnlySpeciesVector. @@ -371,13 +371,13 @@ class SBMLImporter : public SBMLUnitSupport * Replaces all occurrences of the log function with two arguments by * a division of two separate calls to log. */ - //void replaceLog(ConverterASTNode* sourceNode); + void replaceLog(ConverterASTNode* sourceNode); /** * Replaces all occurrences of the root function with two arguments by * a call to the power function with the inverse of the first argument. */ - //void replaceRoot(ConverterASTNode* sourceNode); + void replaceRoot(ConverterASTNode* sourceNode); /** * Replaces the ids of named nodes in an ASTNode tree with @@ -616,7 +616,7 @@ class SBMLImporter : public SBMLUnitSupport /** * Creates a function definition for the delay function. */ - //void createDelayFunctionDefinition(); + void createDelayFunctionDefinition(); /** * This method goes through the list of global parameters and tries to find diff --git a/copasi/sedml/SEDMLImporter.cpp b/copasi/sedml/SEDMLImporter.cpp index 068cef844f..522b6492ae 100644 --- a/copasi/sedml/SEDMLImporter.cpp +++ b/copasi/sedml/SEDMLImporter.cpp @@ -184,18 +184,18 @@ void SEDMLImporter::updateCopasiTaskForSimulation( if (mpCopasiModel) { mpCopasiModel->setInitialTime(initialTime); - mpCopasiModel->updateInitialValues(mpCopasiModel->getInitialValueReference(), false); + mpCopasiModel->updateInitialValues(mpCopasiModel->getInitialValueReference()); } tProblem->setDuration(outputEndTime - initialTime); - + // in COPASI the number of points calculated will be for the total duration of - // initialTime ... ouputEndTime, so if the outputStartTime is not equal to the - // initial time, the number of points will differ so we have to adjust: + // initialTime ... ouputEndTime, so if the outputStartTime is not equal to the + // initial time, the number of points will differ so we have to adjust: if (outputStartTime != initialTime) { - tProblem->setStepSize((outputEndTime - outputStartTime) / numberOfPoints); + tProblem->setStepSize((outputEndTime-outputStartTime)/numberOfPoints); } else { @@ -1608,7 +1608,6 @@ CModel * SEDMLImporter::importModel(const std::string & modelId) // apply possible changes to the model if (sedmlModel != NULL && sedmlModel->getNumChanges() > 0) { - mpCopasiModel->refreshActiveParameterSet(); CModelParameterSet & set = mpCopasiModel->getActiveModelParameterSet(); bool valueChanged = false; diff --git a/copasi/steadystate/CSteadyStateMethod.cpp b/copasi/steadystate/CSteadyStateMethod.cpp index c5cd9d66a4..e78cf583fe 100644 --- a/copasi/steadystate/CSteadyStateMethod.cpp +++ b/copasi/steadystate/CSteadyStateMethod.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -167,8 +167,6 @@ CSteadyStateMethod::returnProcess(bool steadyStateFound) if (!steadyStateFound) { mSteadyState = mStartState; - - CCopasiMessage(CCopasiMessage::COMMANDLINE, MCSteadyState + 2); return CSteadyStateMethod::notFound; } diff --git a/copasi/utilities/dgemm.cpp b/copasi/utilities/dgemm.cpp index 07a020fb47..ca2acbe5f6 100644 --- a/copasi/utilities/dgemm.cpp +++ b/copasi/utilities/dgemm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2022 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -171,11 +171,11 @@ bool dgemm::eval(const C_FLOAT64 & alpha, const dgemm::Matrix & A, const dgemm:: C_INT LDB = std::max< C_INT >(1, K); C_INT LDC = std::max< C_INT >(1, M); - ::dgemm_(&TRANS, &TRANS, &M, &N, &K, - const_cast< C_FLOAT64 * >(&alpha), - const_cast< C_FLOAT64 * >(B.array()), &LDA, - const_cast< C_FLOAT64 * >(A.array()), &LDB, - const_cast< C_FLOAT64 * >(&beta), C.array(), &LDC); + dgemm_(&TRANS, &TRANS, &M, &N, &K, + const_cast< C_FLOAT64 * >(&alpha), + const_cast< C_FLOAT64 * >(B.array()), &LDA, + const_cast< C_FLOAT64 * >(A.array()), &LDB, + const_cast< C_FLOAT64 * >(&beta), C.array(), &LDC); return true; } @@ -200,11 +200,11 @@ bool dgemm::eval(const C_FLOAT64 & alpha, const dgemm::Matrix & A, const dgemm:: C_INT LDB = std::max< C_INT >(1, K); C_INT LDC = std::max< C_INT >(1, M); - ::dgemm_(&TRANS, &TRANS, &M, &N, &K, - const_cast< C_FLOAT64 * >(&alpha), - const_cast< C_FLOAT64 * >(B.array()), &LDA, - const_cast< C_FLOAT64 * >(A.array()), &LDB, - const_cast< C_FLOAT64 * >(&beta), C.array(), &LDC); + dgemm_(&TRANS, &TRANS, &M, &N, &K, + const_cast< C_FLOAT64 * >(&alpha), + const_cast< C_FLOAT64 * >(B.array()), &LDA, + const_cast< C_FLOAT64 * >(A.array()), &LDB, + const_cast< C_FLOAT64 * >(&beta), C.array(), &LDC); return true; } @@ -229,11 +229,11 @@ bool dgemm::eval(const C_FLOAT64 & alpha, const dgemm::Vector & A, const dgemm:: C_INT LDB = std::max< C_INT >(1, K); C_INT LDC = std::max< C_INT >(1, M); - ::dgemm_(&TRANS, &TRANS, &M, &N, &K, - const_cast< C_FLOAT64 * >(&alpha), - const_cast< C_FLOAT64 * >(B.array()), &LDA, - const_cast< C_FLOAT64 * >(A.array()), &LDB, - const_cast< C_FLOAT64 * >(&beta), C.array(), &LDC); + dgemm_(&TRANS, &TRANS, &M, &N, &K, + const_cast< C_FLOAT64 * >(&alpha), + const_cast< C_FLOAT64 * >(B.array()), &LDA, + const_cast< C_FLOAT64 * >(A.array()), &LDB, + const_cast< C_FLOAT64 * >(&beta), C.array(), &LDC); return true; } @@ -252,11 +252,11 @@ bool dgemm::eval(const C_FLOAT64 & alpha, const dgemm::Vector & A, const dgemm:: C_INT LDB = std::max< C_INT >(1, K); C_INT LDC = std::max< C_INT >(1, M); - ::dgemm_(&TRANS, &TRANS, &M, &N, &K, - const_cast< C_FLOAT64 * >(&alpha), - const_cast< C_FLOAT64 * >(B.array()), &LDA, - const_cast< C_FLOAT64 * >(A.array()), &LDB, - const_cast< C_FLOAT64 * >(&beta), &C, &LDC); + dgemm_(&TRANS, &TRANS, &M, &N, &K, + const_cast< C_FLOAT64 * >(&alpha), + const_cast< C_FLOAT64 * >(B.array()), &LDA, + const_cast< C_FLOAT64 * >(A.array()), &LDB, + const_cast< C_FLOAT64 * >(&beta), &C, &LDC); return true; } diff --git a/copasi/utilities/messages.h b/copasi/utilities/messages.h index 34c62d96c4..2bc1a6ef7d 100644 --- a/copasi/utilities/messages.h +++ b/copasi/utilities/messages.h @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -377,7 +377,6 @@ const MESSAGES Messages[] = MCSteadyState + 1, "CSteadyState (1): The model is explicitly time dependent. " "Therefore, the calculation of a steady state using the Newton method is not very meaningful." }, - {MCSteadyState + 2, "CSteadyState (2): No steady state was found."}, { MCFitting + 1, "CFitting (1): Failed to determine work area size for matrix inversion. " diff --git a/copasi/xml/CCopasiXML.cpp b/copasi/xml/CCopasiXML.cpp index 6524be2417..aa869c8dbe 100644 --- a/copasi/xml/CCopasiXML.cpp +++ b/copasi/xml/CCopasiXML.cpp @@ -1123,10 +1123,7 @@ void CCopasiXML::saveModelParameterSets() CXMLAttributeList Attributes; size_t imax = 0, i = 0; Attributes.erase(); - - mpModel->refreshActiveParameterSet(); const CModelParameterSet * pSet = &mpModel->getActiveModelParameterSet(); - Attributes.add("activeSet", pSet->getKey()); startSaveElement("ListOfModelParameterSets", Attributes); @@ -1135,6 +1132,8 @@ void CCopasiXML::saveModelParameterSets() Attributes.add("key", ""); Attributes.add("name", ""); + pSet = &mpModel->getActiveModelParameterSet(); + Attributes.setValue(0, pSet->getKey()); Attributes.setValue(1, pSet->getObjectName()); diff --git a/copasi/xml/parser/ModelHandler.cpp b/copasi/xml/parser/ModelHandler.cpp index a16d742c29..42ea68f28e 100644 --- a/copasi/xml/parser/ModelHandler.cpp +++ b/copasi/xml/parser/ModelHandler.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2024 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -207,7 +207,6 @@ bool ModelHandler::processEnd(const XML_Char * pszName) { size_t Size = CCopasiMessage::size(); - mpData->pModel->refreshActiveParameterSet(); mpData->pModel->getActiveModelParameterSet().assignSetContent(*pModelParameterSet, false); delete pModelParameterSet; mActiveSet = ""; diff --git a/tests/ModelLoading.cpp b/tests/ModelLoading.cpp index 7f99056fca..c3420cd1a9 100644 --- a/tests/ModelLoading.cpp +++ b/tests/ModelLoading.cpp @@ -1,7 +1,7 @@ -// Copyright (C) 2021 - 2024 by Pedro Mendes, Rector and Visitors of the -// University of Virginia, University of Heidelberg, and University -// of Connecticut School of Medicine. -// All rights reserved. +// Copyright (C) 2021 - 2024 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. // BEGIN: Copyright // END: Copyright @@ -115,7 +115,7 @@ TEST_CASE("Update Model", "[COPASI]") // reset the values again x.setInitialValue(1); y.setInitialValue(1); - model->updateInitialValues(CCore::Framework::Concentration, false); + model->updateInitialValues(CCore::Framework::Concentration); model->applyInitialValues(); REQUIRE(x.getInitialValue() == 1); @@ -135,6 +135,7 @@ TEST_CASE("Update Model", "[COPASI]") CRootContainer::removeDatamodel(dm); } + TEST_CASE("Species ODE expressions", "[COPASI][multiple_models]") { CDataModel * dm = CRootContainer::addDatamodel(); @@ -155,7 +156,7 @@ TEST_CASE("Species ODE expressions", "[COPASI][multiple_models]") std::string expression = species.getExpression(); REQUIRE(expression.find("Model=New Model") != std::string::npos); - + CRootContainer::removeDatamodel(dm); CRootContainer::removeDatamodel(dm2); } diff --git a/tests/test_CDataHandler.cpp b/tests/test_CDataHandler.cpp index 7b6c48507b..a78e96ca19 100644 --- a/tests/test_CDataHandler.cpp +++ b/tests/test_CDataHandler.cpp @@ -23,7 +23,7 @@ TEST_CASE("1: load model, simulate, collect data", "[copasi][datahandler]") // change the initial time dm->getModel()->setInitialTime(20); - dm->getModel()->updateInitialValues(dm->getModel()->getInitialValueReference(), false); + dm->getModel()->updateInitialValues(dm->getModel()->getInitialValueReference()); dm->getModel()->forceCompile(NULL); dm->getModel()->applyInitialValues(); @@ -127,6 +127,7 @@ TEST_CASE("ensure that data handler with function evaluations can be compiled", CRootContainer::removeDatamodel(dm); } + TEST_CASE("Test resolving of reactions with )", "[copasi][datahandler]") { auto * dm = CRootContainer::addDatamodel(); @@ -139,7 +140,7 @@ TEST_CASE("Test resolving of reactions with )", "[copasi][datahandler]") reaction->setReactionScheme("A -> D"); model->compileIfNecessary(NULL); - // try and retrieve the reaction by display name: + // try and retrieve the reaction by display name: auto fluxName = reaction->getFluxReference()->getObjectDisplayName(); auto* obj = dm->findObjectByDisplayName(fluxName); REQUIRE(obj != nullptr); diff --git a/tests/test_model_creation.cpp b/tests/test_model_creation.cpp index b6e571b040..16e68cc8d8 100644 --- a/tests/test_model_creation.cpp +++ b/tests/test_model_creation.cpp @@ -1,7 +1,7 @@ -// Copyright (C) 2021 - 2024 by Pedro Mendes, Rector and Visitors of the -// University of Virginia, University of Heidelberg, and University -// of Connecticut School of Medicine. -// All rights reserved. +// Copyright (C) 2021 - 2024 by Pedro Mendes, Rector and Visitors of the +// University of Virginia, University of Heidelberg, and University +// of Connecticut School of Medicine. +// All rights reserved. #include "catch.hpp" @@ -70,7 +70,7 @@ TEST_CASE("create a model with inhibited reaciton", "[copasi][creation]") auto & vars = pFunc->getVariables(); - for (auto & var : vars) +for (auto & var : vars) { if (var.getObjectName() == "A" || var.getObjectName() == "B") var.setUsage(CFunctionParameter::Role::SUBSTRATE); @@ -160,18 +160,18 @@ TEST_CASE("changing initial concentrations", "[copasi][manipulation]") auto * pMetab = model->createMetabolite("speciesB", "compartment"); // change initial concentration - for (auto & metab : model->getMetabolites()) +for (auto & metab : model->getMetabolites()) { if (metab.getObjectDisplayName() != "speciesB") continue; - model->updateInitialValues(metab.getInitialConcentrationReference(), false); + model->updateInitialValues(metab.getInitialConcentrationReference()); metab.setInitialConcentration(0.4); - model->updateInitialValues(metab.getInitialConcentrationReference(), false); + model->updateInitialValues(metab.getInitialConcentrationReference()); } // retrieve metab again - for (auto & metab : model->getMetabolites()) +for (auto & metab : model->getMetabolites()) { if (metab.getObjectDisplayName() != "speciesB") continue; @@ -255,6 +255,7 @@ TEST_CASE("use binary min and max", "[copasi][sbml]") CRootContainer::removeDatamodel(dm); } + TEST_CASE("set up opt problem subtype", "[copasi][optimization]") { auto * dm = CRootContainer::addDatamodel(); @@ -279,7 +280,7 @@ TEST_CASE("set up opt problem subtype", "[copasi][optimization]") REQUIRE(problem != NULL); REQUIRE((problem->getSubtaskType() == CTaskEnum::Task::timeCourse)); } - + CRootContainer::removeDatamodel(dm); } @@ -303,9 +304,11 @@ TEST_CASE("import sbml model and test miriam info", "[copasi][sbml][miriam]") auto miriam = info->getRDFGraph()->toXmlString(); REQUIRE(!miriam.empty()); + CRootContainer::removeDatamodel(dm); } + TEST_CASE("manually create miriam using libsbml", "[copasi][miriam]") { auto * dm = CRootContainer::addDatamodel(); @@ -341,6 +344,7 @@ TEST_CASE("manually create miriam using libsbml", "[copasi][miriam]") #ifdef COPASI_USE_RAPTOR + #include #include #include @@ -372,11 +376,12 @@ TEST_CASE("miriam parsing using libsbml", "[copasi][miriam]") auto incoming = graph1->getIncomingTriplets(start); auto parents = graph1->getParentSubjects(start); - // now ensure that serializing to string works + + // now ensure that serializing to string works CRDFWriter writer; auto * raptorSerialization = writer.write(graph2); auto serialization = graph2->toXmlString(); - + free(raptorSerialization); pdelete(graph1); pdelete(graph2); @@ -396,10 +401,12 @@ TEST_CASE("miriam parsing using libsbml", "[copasi][miriam]") raptorSerialization = writer.write(graph2); serialization = graph2->toXmlString(); + free(raptorSerialization); pdelete(graph1); pdelete(graph2); + CRootContainer::removeDatamodel(dm); } diff --git a/tests/test_sedml.cpp b/tests/test_sedml.cpp index 2a2d78122a..eb0c86628e 100644 --- a/tests/test_sedml.cpp +++ b/tests/test_sedml.cpp @@ -25,7 +25,7 @@ TEST_CASE("exporting sedml file with non-zero initial time", "[copasi][sedml]") r->setReactionScheme("A -> B"); model->setInitialTime(10.0); - model->updateInitialValues(model->getInitialValueReference(), false); + model->updateInitialValues(model->getInitialValueReference()); auto & task = dynamic_cast((*dm->getTaskList())["Time-Course"]); task.setScheduled(true); @@ -41,7 +41,7 @@ TEST_CASE("exporting sedml file with non-zero initial time", "[copasi][sedml]") // now lets try and read it back in ensuring that the initial time is being set. model->setInitialTime(0.0); - model->updateInitialValues(model->getInitialValueReference(), false); + model->updateInitialValues(model->getInitialValueReference()); // also reset the task values, to see that hey are updated correctly problem->setDuration(1); problem->setStepNumber(10); @@ -67,6 +67,7 @@ TEST_CASE("exporting sedml file with non-zero initial time", "[copasi][sedml]") CRootContainer::removeDatamodel(dm); } + TEST_CASE("exporting sedml file with non-zero start time", "[copasi][sedml]") { auto * dm = CRootContainer::addDatamodel(); @@ -315,6 +316,7 @@ TEST_CASE("importing document with remote model should fail", "[copasi][sedml]") auto sedml = writeSedMLToStdString(doc); delete doc; + auto * dm = CRootContainer::addDatamodel(); REQUIRE(dm != nullptr);