From 8eec8987f01360a4b8e89fb7ac7973ad30c0d012 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 17 Oct 2024 09:01:09 +0200 Subject: [PATCH 01/54] - issue 3259: when clicking the delete button, we dont need the focus on the widget --- copasi/UI/CQPlotsWidget.cpp | 6 +++--- copasi/UI/CQPlotsWidget.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/copasi/UI/CQPlotsWidget.cpp b/copasi/UI/CQPlotsWidget.cpp index 42d4cc8274..e2f3db4041 100644 --- a/copasi/UI/CQPlotsWidget.cpp +++ b/copasi/UI/CQPlotsWidget.cpp @@ -128,9 +128,9 @@ void CQPlotsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQPlotsWidget::slotBtnDeleteClicked() +void CQPlotsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblPlots->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); else if (ev->key() == Qt::Key_C && (ev->modifiers() & Qt::ControlModifier)) { diff --git a/copasi/UI/CQPlotsWidget.h b/copasi/UI/CQPlotsWidget.h index ff73722261..bc6304165c 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); virtual void slotBtnClearClicked(); virtual void slotBtnActivateAllClicked(); virtual void slotBtnDeactivateAllClicked(); From 26c9a8727346cf3c8e3c646f13119502899bd945 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Fri, 18 Oct 2024 05:11:43 -0400 Subject: [PATCH 02/54] Switched to CBrent::findMinimum. --- copasi/optimization/COptMethodNL2SOL.cpp | 1 - .../COptMethodSteepestDescent.cpp | 9 +- .../optimization/COptMethodSteepestDescent.h | 7 - copasi/optimization/FminBrent.cpp | 152 ------------------ copasi/optimization/FminBrent.h | 119 -------------- 5 files changed, 3 insertions(+), 285 deletions(-) delete mode 100644 copasi/optimization/FminBrent.cpp delete mode 100644 copasi/optimization/FminBrent.h diff --git a/copasi/optimization/COptMethodNL2SOL.cpp b/copasi/optimization/COptMethodNL2SOL.cpp index 0a879b9bc4..fd64044a5d 100644 --- a/copasi/optimization/COptMethodNL2SOL.cpp +++ b/copasi/optimization/COptMethodNL2SOL.cpp @@ -15,7 +15,6 @@ #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/COptMethodSteepestDescent.cpp b/copasi/optimization/COptMethodSteepestDescent.cpp index 2b49f9fb7d..06f8ae71e9 100644 --- a/copasi/optimization/COptMethodSteepestDescent.cpp +++ b/copasi/optimization/COptMethodSteepestDescent.cpp @@ -31,7 +31,7 @@ #include "COptItem.h" #include "COptTask.h" -#include "FminBrent.h" +#include "copasi/utilities/CBrent.h" #include "copasi/core/CDataObjectReference.h" @@ -47,7 +47,6 @@ 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); @@ -64,14 +63,11 @@ 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(); } @@ -205,7 +201,8 @@ bool COptMethodSteepestDescent::optimise() //md = mn + (mx-mn)/2; //Brent(mn, md, mx, descent_line, &alpha, &tmp, 1e-6, 50); - FminBrent(mn, mx, mpDescent, &alpha, &tmp, mTolerance, 5); + CBrent::EvalTemplate< COptMethodSteepestDescent > eval(this, & COptMethodSteepestDescent::descentLine); + CBrent::findMinimum(mn, mx, &eval, &alpha, &tmp, mTolerance, 100); // take one step in that direction fmx = descentLine(alpha); diff --git a/copasi/optimization/COptMethodSteepestDescent.h b/copasi/optimization/COptMethodSteepestDescent.h index adc7acb5c9..609c5c9492 100644 --- a/copasi/optimization/COptMethodSteepestDescent.h +++ b/copasi/optimization/COptMethodSteepestDescent.h @@ -28,8 +28,6 @@ #include "copasi/core/CVector.h" #include "copasi/optimization/COptMethod.h" -class FDescent; - class COptMethodSteepestDescent: public COptMethod { // Operations @@ -164,11 +162,6 @@ private : */ CVector < C_FLOAT64 > mGradient; - /** - * Functor pointing to the descent method. - */ - FDescent * mpDescent; - /** * The current iteration */ diff --git a/copasi/optimization/FminBrent.cpp b/copasi/optimization/FminBrent.cpp deleted file mode 100644 index e8265aa81c..0000000000 --- a/copasi/optimization/FminBrent.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// 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 deleted file mode 100644 index 3e89e54160..0000000000 --- a/copasi/optimization/FminBrent.h +++ /dev/null @@ -1,119 +0,0 @@ -// 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 From 3f09a1090528535a214a715ac4590f8a447230f6 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Mon, 21 Oct 2024 11:59:03 -0400 Subject: [PATCH 03/54] min and max are n-ary functions. --- copasi/function/CEvaluationLexer.lpp | 72 +- copasi/function/CEvaluationLexer_lex.cpp | 4680 +++++++++---------- copasi/function/CEvaluationNodeFunction.cpp | 211 +- copasi/function/CEvaluationNodeFunction.h | 22 +- copasi/function/CEvaluationParser.ypp | 54 +- copasi/function/CEvaluationParser_yacc.cpp | 2954 ++++++------ copasi/function/CEvaluationParser_yacc.hpp | 103 +- copasi/math/CJitCompilerImplementation.cpp | 24 +- copasi/math/CJitCompilerImplementation.h | 3 + 9 files changed, 3916 insertions(+), 4207 deletions(-) diff --git a/copasi/function/CEvaluationLexer.lpp b/copasi/function/CEvaluationLexer.lpp index 9208586ffa..df671df382 100644 --- a/copasi/function/CEvaluationLexer.lpp +++ b/copasi/function/CEvaluationLexer.lpp @@ -198,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; + return TOKEN_FUNCTION_1; %} (log10|LOG10)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG10, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (exp|EXP)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::EXP, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (sin|SIN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (cos|COS)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COS, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (tan|TAN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TAN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (sec|SEC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SEC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (csc|CSC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (cot|COT)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COT, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (sinh|SINH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SINH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (cosh|COSH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COSH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (tanh|TANH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TANH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (sech|SECH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SECH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (csch|CSCH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSCH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (coth|COTH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COTH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (asin|ASIN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSIN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (acos|ACOS)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOS, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (atan|ATAN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTAN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arcsec|ARCSEC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSEC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arccsc|ARCCSC)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSC, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arccot|ARCCOT)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOT, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arcsinh|ARCSINH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSINH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arccosh|ARCCOSH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOSH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arctanh|ARCTANH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTANH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arcsech|ARCSECH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSECH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arccsch|ARCCSCH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSCH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (arccoth|ARCCOTH)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOTH, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (sign|SIGN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIGN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (sqrt|SQRT)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SQRT, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (abs|ABS)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ABS, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (floor|FLOOR)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FLOOR, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (ceil|CEIL)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CEIL, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (factorial|FACTORIAL)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FACTORIAL, yytext); COMMON_ACTION; - return TOKEN_FUNCTION; + return TOKEN_FUNCTION_1; %} (uniform|UNIFORM)/\( %{ @@ -443,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; + return TOKEN_FUNCTION_1; %} (normal|NORMAL)/\( %{ @@ -457,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_2; + return TOKEN_FUNCTION; %} (min|MIN)/\( %{ mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MIN, yytext); COMMON_ACTION; - return TOKEN_FUNCTION_2; + return TOKEN_FUNCTION; %} (delay|DELAY)/\( %{ diff --git a/copasi/function/CEvaluationLexer_lex.cpp b/copasi/function/CEvaluationLexer_lex.cpp index aa1e072f1a..da87253dd4 100644 --- a/copasi/function/CEvaluationLexer_lex.cpp +++ b/copasi/function/CEvaluationLexer_lex.cpp @@ -1,26 +1,3 @@ -// 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. #line 2 "" @@ -36,13 +13,13 @@ #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 @@ -78,7 +55,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 @@ -95,7 +72,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; @@ -175,7 +152,7 @@ typedef unsigned int flex_uint32_t; /* 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. */ @@ -210,88 +187,89 @@ extern int yyleng; #define EOB_ACT_CONTINUE_SCAN 0 #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. */ \ - 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)) + 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; + std::streambuf* yy_input_file; - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + 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; + /* 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; + /* 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 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 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; + /* 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. */ + 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; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + 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 @@ -300,37 +278,37 @@ 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 *yyalloc(yy_size_t); -void *yyrealloc(void *, yy_size_t); -void yyfree(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 */ @@ -344,418 +322,413 @@ typedef flex_uint8_t 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; + (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; -}; + { + 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 -}; + { 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 -}; + { 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 -}; + { 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 -}; + { 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 -}; + { 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 -}; + { 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 -}; + { 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. @@ -764,10 +737,10 @@ static const flex_int16_t yy_chk[903] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 1 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" /* scanner for kinetic functions */ -#line 10 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 10 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" #include #include "copasi/copasi.h" @@ -780,13 +753,13 @@ static const flex_int16_t yy_chk[903] = #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 764 "" #line 765 "" @@ -808,11 +781,11 @@ static const flex_int16_t yy_chk[903] = #endif #ifndef yytext_ptr -static void yy_flex_strncpy(char *, const char *, int); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT @@ -831,7 +804,7 @@ static int yy_flex_strlen(const 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, @@ -839,9 +812,9 @@ static int yy_flex_strlen(const 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 @@ -860,7 +833,7 @@ static int yy_flex_strlen(const 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 */ @@ -886,2003 +859,1884 @@ static int yy_flex_strlen(const 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 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + { +#line 36 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" #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 >= 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); + 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 "/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 + 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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_1; + + 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 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG10, + 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 211 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::EXP, + 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 218 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIN, + 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 225 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COS, + 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 232 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TAN, + 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 239 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SEC, + 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 246 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSC, + 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 253 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COT, + 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 260 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SINH, + 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 267 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COSH, + 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 274 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TANH, + 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 281 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SECH, + 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 288 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSCH, + 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 295 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COTH, + 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 302 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSIN, + 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 309 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOS, + 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 316 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTAN, + 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 323 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSEC, + 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 330 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSC, + 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 337 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOT, + 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 344 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSINH, + 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 351 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOSH, + 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 358 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTANH, + 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 365 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSECH, + 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 372 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSCH, + 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 379 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOTH, + 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 386 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIGN, + 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 393 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SQRT, + 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 400 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ABS, + 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 407 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FLOOR, + 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 414 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CEIL, + 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 421 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FACTORIAL, + 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 428 "/home/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 "/home/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 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RPOISSON, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION_1; + + 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 "/home/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 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MAX, + yytext); + COMMON_ACTION; + return TOKEN_FUNCTION; + + 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 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MIN, + 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 470 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/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 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +return 0; + YY_BREAK +case 80: +YY_RULE_SETUP +#line 638 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + CCopasiMessage(CCopasiMessage::ERROR, MCFunction + 2, mPosition); + return YYERRCODE; + + YY_BREAK +case 81: +YY_RULE_SETUP +#line 643 "/home/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 */ + 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_buffer_stack = NULL; + yy_buffer_stack_top = 0; + yy_buffer_stack_max = 0; + + yy_state_buf = 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; - yyfree(yy_start_stack); - yy_delete_buffer(YY_CURRENT_BUFFER); - yyfree(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); - - if (yyin.bad()) - return -1; - else - return yyin.gcount(); + (void) yyin.read( buf, max_size ); + 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); - 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. */ - - /* 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; + 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. */ + + /* 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 >= 391) - yy_c = yy_meta[yy_c]; - } - - yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 >= 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; + 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 = (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; - + 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 ) { - if (! input_file) - { - input_file = &yyin; - } - - 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) yyalloc(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 ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* 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_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) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - if (! b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + b->yy_is_our_buffer = 1; - b->yy_is_our_buffer = 1; + yy_init_buffer( b, file ); - yy_init_buffer(b, file); - - return b; + 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) - return; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf ); - if (b->yy_is_our_buffer) - yyfree((void *) b->yy_ch_buf); - - yyfree((void *) b); + 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; + + yy_flush_buffer( b ); - b->yy_input_file = file.rdbuf(); - b->yy_fill_buffer = 1; + 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; + /* 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. @@ -2890,115 +2744,111 @@ void yyFlexLexer::yypop_buffer_state(void) */ void yyFlexLexer::yyensure_buffer_stack(void) { - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) - { + yy_size_t num_to_alloc; + + 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. - */ + /* 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**)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; - } + (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 *) yyalloc(new_size); + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) yyalloc( new_size ); - else - (yy_start_stack) = (int *) yyrealloc( - (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(const 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. */ \ - 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) + 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. */ @@ -3007,51 +2857,51 @@ void yyFlexLexer::LexerError(const char* msg) */ #ifndef yytext_ptr -static void yy_flex_strncpy(char* s1, const 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(const 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 *yyalloc(yy_size_t size) +void *yyalloc (yy_size_t size ) { - return malloc(size); + return malloc(size); } -void *yyrealloc(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 yyfree(void * ptr) +void yyfree (void * ptr ) { - free((char *) ptr); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 643 "/raid/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 643 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + + diff --git a/copasi/function/CEvaluationNodeFunction.cpp b/copasi/function/CEvaluationNodeFunction.cpp index 9b3c7030f0..0835705aba 100644 --- a/copasi/function/CEvaluationNodeFunction.cpp +++ b/copasi/function/CEvaluationNodeFunction.cpp @@ -29,6 +29,7 @@ #include "CEvaluationNode.h" #include "CEvaluationTree.h" #include "copasi/utilities/CValidatedUnit.h" +#include "copasi/utilities/CBalanceTree.h" #include "copasi/randomGenerator/CRandom.h" @@ -60,22 +61,55 @@ C_FLOAT64 CEvaluationNodeFunction::rpoisson(C_FLOAT64 mu) } // static -C_FLOAT64 CEvaluationNodeFunction::max(C_FLOAT64 x1, C_FLOAT64 x2) +C_FLOAT64 CEvaluationNodeFunction::max(CEvaluationNodeFunction * pNode) { - return std::max(x1, 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; } // static -C_FLOAT64 CEvaluationNodeFunction::min(C_FLOAT64 x1, C_FLOAT64 x2) +C_FLOAT64 CEvaluationNodeFunction::min(CEvaluationNodeFunction * pNode) +{ + return pNode->min(); +} + +C_FLOAT64 CEvaluationNodeFunction::min() { - return std::min(x1, 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; } CEvaluationNodeFunction::CEvaluationNodeFunction(): CEvaluationNode(MainType::FUNCTION, SubType::INVALID, ""), - mpFunction(NULL), + mpFunction1(NULL), mpFunction2(NULL), mpFunction4(NULL), + mpFunction(NULL), mpArgNode1(NULL), mpArgNode2(NULL), mpArgNode3(NULL), @@ -91,9 +125,10 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(): CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, const Data & data): CEvaluationNode(MainType::FUNCTION, subType, data), - mpFunction(NULL), + mpFunction1(NULL), mpFunction2(NULL), mpFunction4(NULL), + mpFunction(NULL), mpArgNode1(NULL), mpArgNode2(NULL), mpArgNode3(NULL), @@ -108,147 +143,147 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, switch (subType) { case SubType::LOG: - mpFunction = log; + mpFunction1 = log; break; case SubType::LOG10: - mpFunction = log10; + mpFunction1 = log10; break; case SubType::EXP: - mpFunction = exp; + mpFunction1 = exp; break; case SubType::SIN: - mpFunction = sin; + mpFunction1 = sin; break; case SubType::COS: - mpFunction = cos; + mpFunction1 = cos; break; case SubType::TAN: - mpFunction = tan; + mpFunction1 = tan; break; case SubType::SEC: - mpFunction = sec; + mpFunction1 = sec; break; case SubType::CSC: - mpFunction = csc; + mpFunction1 = csc; break; case SubType::COT: - mpFunction = cot; + mpFunction1 = cot; break; case SubType::SINH: - mpFunction = sinh; + mpFunction1 = sinh; break; case SubType::COSH: - mpFunction = cosh; + mpFunction1 = cosh; break; case SubType::TANH: - mpFunction = tanh; + mpFunction1 = tanh; break; case SubType::SECH: - mpFunction = sech; + mpFunction1 = sech; break; case SubType::CSCH: - mpFunction = csch; + mpFunction1 = csch; break; case SubType::COTH: - mpFunction = coth; + mpFunction1 = coth; break; case SubType::ARCSIN: - mpFunction = asin; + mpFunction1 = asin; break; case SubType::ARCCOS: - mpFunction = acos; + mpFunction1 = acos; break; case SubType::ARCTAN: - mpFunction = atan; + mpFunction1 = atan; break; case SubType::ARCSEC: - mpFunction = arcsec; + mpFunction1 = arcsec; break; case SubType::ARCCSC: - mpFunction = arccsc; + mpFunction1 = arccsc; break; case SubType::ARCCOT: - mpFunction = arccot; + mpFunction1 = arccot; break; case SubType::ARCSINH: - mpFunction = asinh; + mpFunction1 = asinh; break; case SubType::ARCCOSH: - mpFunction = acosh; + mpFunction1 = acosh; break; case SubType::ARCTANH: - mpFunction = atanh; + mpFunction1 = atanh; break; case SubType::ARCSECH: - mpFunction = asech; + mpFunction1 = asech; break; case SubType::ARCCSCH: - mpFunction = acsch; + mpFunction1 = acsch; break; case SubType::ARCCOTH: - mpFunction = acoth; + mpFunction1 = acoth; break; case SubType::SIGN: - mpFunction = sign; + mpFunction1 = sign; break; case SubType::SQRT: - mpFunction = sqrt; + mpFunction1 = sqrt; break; case SubType::ABS: - mpFunction = fabs; + mpFunction1 = fabs; break; case SubType::FLOOR: - mpFunction = floor; + mpFunction1 = floor; break; case SubType::CEIL: - mpFunction = ceil; + mpFunction1 = ceil; break; case SubType::FACTORIAL: - mpFunction = factorial; + mpFunction1 = factorial; break; case SubType::MINUS: - mpFunction = minus; + mpFunction1 = minus; break; case SubType::PLUS: - mpFunction = plus; + mpFunction1 = plus; break; case SubType::NOT: - mpFunction = copasiNot; + mpFunction1 = copasiNot; break; case SubType::RUNIFORM: @@ -268,7 +303,7 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, break; case SubType::RPOISSON: - mpFunction = rpoisson; + mpFunction1 = rpoisson; if (!mpRandom) mpRandom = CRandom::createGenerator(); @@ -284,15 +319,15 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, break; case SubType::MAX: - mpFunction2 = max; + mpFunction = max; break; case SubType::MIN: - mpFunction2 = min; + mpFunction = min; break; default: - mpFunction = NULL; + mpFunction1 = NULL; fatalError(); break; } @@ -302,7 +337,7 @@ CEvaluationNodeFunction::CEvaluationNodeFunction(const SubType & subType, CEvaluationNodeFunction::CEvaluationNodeFunction(const CEvaluationNodeFunction & src): CEvaluationNode(src), - mpFunction(src.mpFunction), + mpFunction1(src.mpFunction1), mpFunction2(src.mpFunction2), mpFunction4(src.mpFunction4), mpArgNode1(src.mpArgNode1), @@ -329,6 +364,9 @@ CIssue CEvaluationNodeFunction::compile() success &= mpArgNode1->setValueType(mValueType); if (mpFunction) + return CIssue::Success; + + if (mpFunction1) { if (mpArgNode1->getSibling() == NULL) return CIssue::Success; @@ -385,9 +423,18 @@ 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: - return mData + "(" + children[0] + "," + children[1] + ")"; + { + std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) + { + return first + "," + second; + }); + + return mData + "(" + Arguments + ")"; + } case SubType::RPOISSON: return mData + "(" + children[0] + ")"; @@ -415,9 +462,18 @@ 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: - return mData + "(" + children[0] + "," + children[1] + ")"; + { + std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) + { + return first + "," + second; + }); + + return mData + "(" + Arguments + ")"; + } case SubType::RPOISSON: return mData + "(" + children[0] + ")"; @@ -623,9 +679,18 @@ 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: - return data + "(" + children[0] + "," + children[1] + ")"; + { + std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) + { + return first + "," + second; + }); + + return mData + "(" + Arguments + ")"; + } default: return data + "(" + children[0] + ")"; @@ -715,9 +780,18 @@ 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: - return data + "(" + children[0] + "," + children[1] + ")"; + { + std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) + { + return first + "," + second; + }); + + return mData + "(" + Arguments + ")"; + } default: return data + "(" + children[0] + ")"; @@ -809,9 +883,18 @@ 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: - return data + "(" + children[0] + "," + children[1] + ")"; + { + std::string Arguments = BalanceTree< std::string >::create(children, [](const std::string & first, const std::string & second) + { + return first + "," + second; + }); + + return mData + "(" + Arguments + ")"; + } default: return data + "(" + children[0] + ")"; @@ -1795,8 +1878,6 @@ 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; @@ -1817,6 +1898,28 @@ 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 411a94ea32..4d3cf088e2 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 (mpFunction) + if (mpFunction1) { - mValue = (*mpFunction)(*mpArgValue1); + mValue = (*mpFunction1)(*mpArgValue1); } else if (mpFunction2) { @@ -101,6 +101,10 @@ class CEvaluationNodeFunction : public CEvaluationNode { mValue = (*mpFunction4)(*mpArgValue1, *mpArgValue2, *mpArgValue3, *mpArgValue4); } + else if (mpFunction) + { + mValue = (*mpFunction)(this); + } } /** @@ -282,15 +286,17 @@ class CEvaluationNodeFunction : public CEvaluationNode static C_FLOAT64 rpoisson(C_FLOAT64 mu); - static C_FLOAT64 max(C_FLOAT64 x1, - C_FLOAT64 x2); + static C_FLOAT64 max(CEvaluationNodeFunction * pNode); - static C_FLOAT64 min(C_FLOAT64 x1, - C_FLOAT64 x2); + static C_FLOAT64 min(CEvaluationNodeFunction * pNode); // Attributes private: - C_FLOAT64(*mpFunction)(C_FLOAT64 arg1); + C_FLOAT64 max(); + + C_FLOAT64 min(); + + C_FLOAT64(*mpFunction1)(C_FLOAT64 arg1); C_FLOAT64(*mpFunction2)(C_FLOAT64 arg1, C_FLOAT64 arg2); @@ -300,6 +306,8 @@ 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/CEvaluationParser.ypp b/copasi/function/CEvaluationParser.ypp index ec61e4a86d..a1a6ba69dd 100644 --- a/copasi/function/CEvaluationParser.ypp +++ b/copasi/function/CEvaluationParser.ypp @@ -32,6 +32,7 @@ %token TOKEN_CALL %token TOKEN_FUNCTION +%token TOKEN_FUNCTION_1 %token TOKEN_FUNCTION_2 %token TOKEN_SIGN @@ -79,6 +80,7 @@ %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 @@ -100,7 +102,7 @@ result: exp mpRootNode = $$; } -d_or_b: call +d_or_b: call { $$ = $1; mpRootNode = $$; @@ -186,7 +188,11 @@ exp: TOKEN_NUMBER $$ = $2; mpRootNode = $$; } - | TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE + | function + { + $$ = $1; + } + | TOKEN_FUNCTION_1 TOKEN_STRUCTURE_OPEN exp TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($3); @@ -476,6 +482,32 @@ 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(); @@ -512,47 +544,47 @@ call: TOKEN_CALL TOKEN_STRUCTURE_CLOSE { $$ = $1; } - | cstart d_or_b TOKEN_STRUCTURE_CLOSE + | ccont d_or_b TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } - | cstart exp TOKEN_STRUCTURE_CLOSE + | ccont exp TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } - | cstart bool TOKEN_STRUCTURE_CLOSE + | ccont bool TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } - | cstart vector TOKEN_STRUCTURE_CLOSE + | ccont vector TOKEN_STRUCTURE_CLOSE { $$ = $1; $$->addChild($2); } -cstart: TOKEN_CALL +ccont: TOKEN_CALL { $$ = $1; } - | cstart d_or_b TOKEN_STRUCTURE_COMMA + | ccont d_or_b TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); } - | cstart exp TOKEN_STRUCTURE_COMMA + | ccont exp TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); } - | cstart bool TOKEN_STRUCTURE_COMMA + | ccont bool TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); } - | cstart vector TOKEN_STRUCTURE_COMMA + | ccont vector TOKEN_STRUCTURE_COMMA { $$ = $1; $$->addChild($2); diff --git a/copasi/function/CEvaluationParser_yacc.cpp b/copasi/function/CEvaluationParser_yacc.cpp index 9d0d2f0a86..b0fdb69791 100644 --- a/copasi/function/CEvaluationParser_yacc.cpp +++ b/copasi/function/CEvaluationParser_yacc.cpp @@ -1,32 +1,8 @@ -// 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. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -40,7 +16,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 @@ -58,6 +34,10 @@ /* 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. @@ -65,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.5" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -86,6 +63,7 @@ /* Pull parsers. */ #define YYPULL 1 + /* Substitute the variable and function names. */ #define yyparse yyparse #define yyerror CEvaluationParsererror @@ -118,7 +96,8 @@ #undef yyparse #define yyparse CEvaluationParserBase::yyparse -#line 101 "CEvaluationParser_yacc.cpp" + +#line 102 "CEvaluationParser_yacc.cpp" # ifndef YY_CAST # ifdef __cplusplus @@ -141,73 +120,60 @@ # endif # endif -/* 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 +#include "CEvaluationParser_yacc.hpp" +/* Symbol kind. */ +enum yysymbol_kind_t { - 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 + 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 */ }; -#endif +typedef enum yysymbol_kind_t yysymbol_kind_t; -/* 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 @@ -246,6 +212,18 @@ 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 \ @@ -305,6 +283,7 @@ 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; @@ -323,6 +302,7 @@ 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__)) @@ -341,19 +321,25 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-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_END \ - _Pragma ("GCC diagnostic pop") + _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif @@ -367,19 +353,20 @@ 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 || YYERROR_VERBOSE +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -398,7 +385,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 @@ -408,13 +395,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 @@ -434,17 +421,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 || YYERROR_VERBOSE */ +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -463,8 +450,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 @@ -474,15 +461,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 @@ -492,99 +479,111 @@ 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 31 +#define YYFINAL 35 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 527 +#define YYLAST 576 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 32 +#define YYNTOKENS 33 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 9 +#define YYNNTS 11 /* YYNRULES -- Number of rules. */ -#define YYNRULES 69 +#define YYNRULES 75 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 162 +#define YYNSTATES 173 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 287 -#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 ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* 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 + 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 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 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 + 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 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +/** 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; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "TOKEN_NUMBER", "TOKEN_VARIABLE", - "TOKEN_UNIT", "TOKEN_CALL", "TOKEN_FUNCTION", "TOKEN_FUNCTION_2", - "TOKEN_SIGN", "TOKEN_OPERATOR_POWER", "TOKEN_OPERATOR_MULTIPLY", + "\"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", "TOKEN_OPERATOR_MODULUS", "TOKEN_OPERATOR_REMAINDER", "TOKEN_OPERATOR_PLUS", "TOKEN_LOGICAL_CHOICE", "TOKEN_LOGICAL_VALUE", "TOKEN_LOGICAL_NOT", "TOKEN_LOGICAL_OR", "TOKEN_LOGICAL_XOR", @@ -593,28 +592,23 @@ 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", "vector", "vstart", "call", "cstart", YY_NULLPTR + "result", "d_or_b", "exp", "bool", "function", "fcont", "vector", + "vstart", "call", "ccont", YY_NULLPTR }; -#endif -# 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[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 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 + return yytname[yysymbol]; +} +#endif -#define YYPACT_NINF (-50) +#define YYPACT_NINF (-52) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-54) +#define YYTABLE_NINF (-55) #define yytable_value_is_error(Yyn) \ 0 @@ -623,23 +617,24 @@ static const yytype_int16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 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 + 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 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -647,216 +642,235 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int8 yydefact[] = { - 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 + 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 }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +static const yytype_int8 yypgoto[] = { - -50, -50, 45, 0, 132, -49, -50, -50, -50 - }; + -52, -52, 49, 0, 43, -52, -52, -51, -52, -52, + -52 +}; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 11, 22, 26, 14, 54, 55, 15, 16 - }; + 0, 12, 26, 30, 15, 16, 17, 59, 60, 18, + 19 +}; /* 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[] = { - 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 + 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 }; static const yytype_int16 yycheck[] = { - 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 + 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 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { - 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 + 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 }; -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { - 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 + 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 }; -/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { - 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 + 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 }; + +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); \ @@ -864,15 +878,16 @@ static const yytype_int8 yyr2[] = goto yybackup; \ } \ else \ - {\ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + /* Enable debugging if requested. */ #if YYDEBUG @@ -883,63 +898,57 @@ static const yytype_int8 yyr2[] = # endif # define YYDPRINTF(Args) \ - 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 +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) -# 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, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE(yyoutput); - + YY_USE (yyoutput); if (!yyvaluep) return; - -# ifdef YYPRINT - - if (yytype < YYNTOKENS) - YYPRINT(yyo, yytoknum[yytype], *yyvaluep); - -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE(yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } + /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void -yy_symbol_print(FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { - YYFPRINTF(yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print(yyo, yytype, yyvaluep); - YYFPRINTF(yyo, ")"); + yy_symbol_value_print (yyo, yykind, yyvaluep); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -948,66 +957,65 @@ yy_symbol_print(FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `------------------------------------------------------------------*/ 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, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); - YYFPRINTF(stderr, "\n"); + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+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) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, 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 @@ -1024,272 +1032,31 @@ 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, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE(yyvaluep); - + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; - - YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE(yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* The lookahead symbol. */ + +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1297,50 +1064,46 @@ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; + + + /*----------. | yyparse. | `----------*/ int -yyparse(void) +yyparse (void) { - 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. + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; - 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. */ - /* The state stack. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - YYPTRDIFF_T yystacksize; + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* 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)) @@ -1348,40 +1111,36 @@ yyparse(void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); - 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 - goto yyexhaustedlab; - + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1399,39 +1158,33 @@ 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) - goto yyexhaustedlab; - + YYNOMEM; 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) - goto yyexhaustedlab; - - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); + YYSTACK_FREE (yyss1); } # endif @@ -1439,8 +1192,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) @@ -1448,58 +1201,66 @@ 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 YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF((stderr, "Reading a token: ")); - yychar = yylex(); + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); + 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; } 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; } @@ -1510,7 +1271,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; @@ -1520,20 +1281,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; - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; @@ -1546,822 +1307,806 @@ 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: -#line 88 "CEvaluationParser.ypp" - { - mValueType = CEvaluationNode::ValueType::Number; - mpRootNode = yyval; - } - -#line 1531 "CEvaluationParser_yacc.cpp" - break; + case 2: /* result: exp */ +#line 90 "CEvaluationParser.ypp" + { + mValueType = CEvaluationNode::ValueType::Number; + mpRootNode = yyval; + } +#line 1324 "CEvaluationParser_yacc.cpp" + break; - case 3: -#line 93 "CEvaluationParser.ypp" - { - mValueType = CEvaluationNode::ValueType::Boolean; - mpRootNode = yyval; - } + case 3: /* result: bool */ +#line 95 "CEvaluationParser.ypp" + { + mValueType = CEvaluationNode::ValueType::Boolean; + mpRootNode = yyval; + } +#line 1333 "CEvaluationParser_yacc.cpp" + break; -#line 1540 "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 4: -#line 98 "CEvaluationParser.ypp" - { - mValueType = CEvaluationNode::ValueType::Unknown; - mpRootNode = yyval; - } + case 5: /* d_or_b: call */ +#line 106 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + mpRootNode = yyval; + } +#line 1351 "CEvaluationParser_yacc.cpp" + break; -#line 1549 "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 5: -#line 104 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - 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 1558 "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 6: -#line 109 "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 1567 "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 7: -#line 114 "CEvaluationParser.ypp" - { - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - 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 1579 "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 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 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 1592 "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 9: -#line 132 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - 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 1601 "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 10: -#line 137 "CEvaluationParser.ypp" - { - yyvsp[0]->setValueType(CEvaluationNode::ValueType::Number); - 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 1611 "CEvaluationParser_yacc.cpp" - break; + case 18: /* exp: function */ +#line 192 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + } +#line 1487 "CEvaluationParser_yacc.cpp" + break; - case 11: -#line 143 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(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 1622 "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 12: -#line 150 "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 1633 "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 13: -#line 157 "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 1644 "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 14: -#line 164 "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 1655 "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 15: -#line 171 "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 1666 "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 16: -#line 178 "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 1677 "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 17: -#line 185 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - 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 1686 "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 18: -#line 190 "CEvaluationParser.ypp" - { - yyval = yyvsp[-3]; - yyval->addChild(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; + 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; - - case 19: -#line 196 "CEvaluationParser.ypp" - { - yyval = yyvsp[-5]; - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } + break; + 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; - - case 20: -#line 203 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } - -#line 1717 "CEvaluationParser_yacc.cpp" - break; + 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 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 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; - - 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; - } - -#line 1744 "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; - } - -#line 1758 "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; - } + break; -#line 1772 "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; - } + 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; -#line 1787 "CEvaluationParser_yacc.cpp" - break; + 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; - 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; - } + 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; -#line 1802 "CEvaluationParser_yacc.cpp" - break; + 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; - case 27: -#line 271 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - mpRootNode = yyval; - } + 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; -#line 1811 "CEvaluationParser_yacc.cpp" - break; + 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; - case 28: -#line 276 "CEvaluationParser.ypp" - { - yyval = yyvsp[-7]; - yyval->addChild(yyvsp[-5]); - yyval->addChild(yyvsp[-3]); - yyval->addChild(yyvsp[-1]); - mpRootNode = yyval; - } + 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 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; - - 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; - } - -#line 1837 "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; - } - -#line 1851 "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; - } - -#line 1865 "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; - } - -#line 1880 "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; - } - -#line 1895 "CEvaluationParser_yacc.cpp" - break; + break; - case 34: -#line 336 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } - -#line 1906 "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; - } - -#line 1918 "CEvaluationParser_yacc.cpp" - break; - - case 36: -#line 351 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } - -#line 1929 "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; - } - -#line 1941 "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; - } - -#line 1953 "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; - } - -#line 2033 "CEvaluationParser_yacc.cpp" - break; - - case 46: -#line 426 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } - -#line 2044 "CEvaluationParser_yacc.cpp" - break; - - case 47: -#line 433 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - mpRootNode = yyval; - } - -#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; - } - -#line 2077 "CEvaluationParser_yacc.cpp" - 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 50: -#line 454 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[-2]); - yyval->addChild(yyvsp[0]); - 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 2088 "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 51: -#line 461 "CEvaluationParser.ypp" - { - yyval = 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 2097 "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 52: -#line 466 "CEvaluationParser.ypp" - { - yyval = yyvsp[-1]; - yyval->addChild(yyvsp[0]); - 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 2107 "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 53: + case 53: /* bool: TOKEN_LOGICAL_NOT bool */ #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; + { + yyval = yyvsp[-1]; + yyval->addChild(yyvsp[0]); + mpRootNode = yyval; + } +#line 1908 "CEvaluationParser_yacc.cpp" + break; - case 57: -#line 497 "CEvaluationParser.ypp" - { - yyval = new CEvaluationNodeVector(); - mpNodeList->push_back(yyval); - yyval->addChild(yyvsp[0]); - } + 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; -#line 2155 "CEvaluationParser_yacc.cpp" - break; + case 55: /* function: TOKEN_FUNCTION TOKEN_STRUCTURE_OPEN TOKEN_STRUCTURE_CLOSE */ +#line 486 "CEvaluationParser.ypp" + { + yyval = yyvsp[-2]; + } +#line 1927 "CEvaluationParser_yacc.cpp" + break; - case 58: -#line 503 "CEvaluationParser.ypp" - { - yyval->addChild(yyvsp[0]); - } + 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; -#line 2163 "CEvaluationParser_yacc.cpp" - break; + 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; - case 59: -#line 507 "CEvaluationParser.ypp" - { - yyval->addChild(yyvsp[0]); - } + 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; -#line 2171 "CEvaluationParser_yacc.cpp" - break; + 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; - case 60: + case 60: /* vector: TOKEN_STRUCTURE_VECTOR_OPEN TOKEN_STRUCTURE_VECTOR_CLOSE */ #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 2188 "CEvaluationParser_yacc.cpp" - break; + { + yyval = new CEvaluationNodeVector(); + mpNodeList->push_back(yyval); + } +#line 1972 "CEvaluationParser_yacc.cpp" + break; - case 62: -#line 521 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + case 61: /* vector: vstart TOKEN_STRUCTURE_VECTOR_CLOSE */ +#line 517 "CEvaluationParser.ypp" + { + yyval = yyvsp[-1]; + } +#line 1980 "CEvaluationParser_yacc.cpp" + break; -#line 2197 "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 63: -#line 526 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + 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 2206 "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 64: -#line 531 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + case 65: /* vstart: vstart TOKEN_STRUCTURE_COMMA vector */ +#line 539 "CEvaluationParser.ypp" + { + yyval->addChild(yyvsp[0]); + } +#line 2016 "CEvaluationParser_yacc.cpp" + break; -#line 2215 "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 65: -#line 537 "CEvaluationParser.ypp" - { - yyval = yyvsp[0]; - } + 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; -#line 2223 "CEvaluationParser_yacc.cpp" - 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 66: -#line 541 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + 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 2232 "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 67: -#line 546 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + case 71: /* ccont: TOKEN_CALL */ +#line 569 "CEvaluationParser.ypp" + { + yyval = yyvsp[0]; + } +#line 2068 "CEvaluationParser_yacc.cpp" + break; -#line 2241 "CEvaluationParser_yacc.cpp" - break; + 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; - case 68: -#line 551 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + 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; -#line 2250 "CEvaluationParser_yacc.cpp" - break; + 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; - case 69: -#line 556 "CEvaluationParser.ypp" - { - yyval = yyvsp[-2]; - yyval->addChild(yyvsp[-1]); - } + 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; -#line 2259 "CEvaluationParser_yacc.cpp" - break; -#line 2263 "CEvaluationParser_yacc.cpp" +#line 2108 "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. @@ -2373,11 +2118,10 @@ 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("-> $$ =", yyr1[yyn], &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); - YYPOPSTACK(yylen); + YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT(yyss, yyssp); *++yyvsp = yyval; @@ -2394,57 +2138,19 @@ 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 ? YYEMPTY : YYTRANSLATE(yychar); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#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 + yyerror (YY_("syntax error")); } if (yyerrstatus == 3) @@ -2460,8 +2166,8 @@ yyparse(void) } else { - yydestruct("Error: discarding", - yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; } } @@ -2470,42 +2176,42 @@ yyparse(void) token. */ goto yyerrlab1; - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ -yyerrorlab: +/*---------------------------------------------------. +| 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 += YYTERROR; - - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; - if (0 < yyn) break; } @@ -2515,85 +2221,81 @@ yyparse(void) if (yyssp == yyss) YYABORT; - yydestruct("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK(1); + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (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", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; + - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE - /*-------------------------------------------------. - | yyexhaustedlab -- memory exhaustion comes here. | - `-------------------------------------------------*/ + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: - yyerror(YY_("memory exhausted")); + yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; - /*-----------------------------------------------------. - | 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", - yystos[*yyssp], yyvsp); - YYPOPSTACK(1); + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*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 562 "CEvaluationParser.ypp" + +#line 594 "CEvaluationParser.ypp" + + diff --git a/copasi/function/CEvaluationParser_yacc.hpp b/copasi/function/CEvaluationParser_yacc.hpp index 5728d263eb..902f029585 100644 --- a/copasi/function/CEvaluationParser_yacc.hpp +++ b/copasi/function/CEvaluationParser_yacc.hpp @@ -1,23 +1,8 @@ -// 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. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -31,7 +16,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 @@ -46,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* 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. */ #ifndef YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED # define YY_CEVALUATIONPARSER_CEVALUATIONPARSER_TAB_HPP_INCLUDED @@ -59,41 +45,47 @@ extern int CEvaluationParserdebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE -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 -}; + 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; #endif /* Value type. */ @@ -103,8 +95,11 @@ 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/math/CJitCompilerImplementation.cpp b/copasi/math/CJitCompilerImplementation.cpp index c66716bdf8..366a81b952 100644 --- a/copasi/math/CJitCompilerImplementation.cpp +++ b/copasi/math/CJitCompilerImplementation.cpp @@ -9,12 +9,16 @@ #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) { @@ -780,15 +784,27 @@ CJitCompilerImplementation::Node * CJitCompilerImplementation::compile(const CEv case CEvaluationNode::SubType::MAX: { - 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])); + 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)); + }); } break; case CEvaluationNode::SubType::MIN: { - 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])); + 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)); + }); } break; diff --git a/copasi/math/CJitCompilerImplementation.h b/copasi/math/CJitCompilerImplementation.h index b05acfd7e4..e007585995 100644 --- a/copasi/math/CJitCompilerImplementation.h +++ b/copasi/math/CJitCompilerImplementation.h @@ -41,6 +41,7 @@ class CJitCompilerImplementation: public CJitCompiler private: static size_t InitalBufferSize; + static C_FLOAT64 Invalid; #ifdef USE_JIT protected: @@ -85,6 +86,8 @@ class CJitCompilerImplementation: public CJitCompiler return (C_FLOAT64)(((C_INT32) x) % ((C_INT32) 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_eq(bool x, bool y) {return x == y;} static inline bool __jit_eq(C_FLOAT64 x, C_FLOAT64 y) {return x == y;} From 3df7a041a54b0628f55ce95d8728bfad83bbbb38 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Tue, 22 Oct 2024 06:58:03 -0400 Subject: [PATCH 04/54] Added support for quotient. --- copasi/function/CEvaluationLexer.lpp | 8 + copasi/function/CEvaluationLexer_lex.cpp | 667 ++++++++++---------- copasi/function/CEvaluationNode.cpp | 1 + copasi/function/CEvaluationNode.h | 1 + copasi/function/CEvaluationNodeOperator.cpp | 76 ++- copasi/function/CEvaluationNodeOperator.h | 1 + copasi/function/CEvaluationTree.cpp | 1 + copasi/math/CJitCompilerImplementation.cpp | 7 + copasi/math/CJitCompilerImplementation.h | 6 + copasi/math/CMathContainer.cpp | 5 +- 10 files changed, 436 insertions(+), 337 deletions(-) diff --git a/copasi/function/CEvaluationLexer.lpp b/copasi/function/CEvaluationLexer.lpp index df671df382..61dd5ad64f 100644 --- a/copasi/function/CEvaluationLexer.lpp +++ b/copasi/function/CEvaluationLexer.lpp @@ -557,6 +557,14 @@ 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 da87253dd4..bae143b24e 100644 --- a/copasi/function/CEvaluationLexer_lex.cpp +++ b/copasi/function/CEvaluationLexer_lex.cpp @@ -327,8 +327,8 @@ typedef flex_uint8_t YY_CHAR; (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 +#define YY_NUM_RULES 82 +#define YY_END_OF_BUFFER 83 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -336,50 +336,52 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[391] = +static const flex_int16_t yy_accept[395] = { 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 + 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, + 80, 80, 8, 81, 74, 77, 65, 76, 64, 1, + 1, 81, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 81, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 75, 78, 81, 69, 81, 67, 72, 73, + 68, 10, 81, 12, 81, 81, 81, 81, 81, 81, + 81, 66, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 79, 79, 80, 0, 79, 0, 1, 1, + 0, 0, 0, 19, 0, 63, 79, 79, 79, 79, + + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 3, 79, 79, + 79, 79, 79, 79, 79, 0, 0, 18, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 13, 15, 9, 14, 11, 0, + 12, 10, 17, 0, 0, 0, 0, 0, 79, 79, + 1, 0, 1, 20, 62, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 61, 79, 79, 79, 79, 7, 79, 8, 79, 79, + + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 16, 70, 0, 50, 79, 79, 79, 79, 79, + 79, 79, 25, 79, 29, 79, 28, 79, 79, 23, + 79, 79, 79, 79, 79, 79, 21, 79, 58, 59, + 79, 79, 27, 79, 79, 24, 79, 79, 26, 79, + 4, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 71, 37, 79, 79, + 79, 79, 79, 36, 38, 52, 31, 35, 34, 79, + + 79, 79, 5, 79, 79, 79, 79, 79, 79, 33, + 48, 30, 49, 32, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 60, 79, 79, 51, 55, 79, 22, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 41, 79, 40, 79, 39, 79, + 79, 79, 79, 79, 79, 57, 79, 79, 79, 79, + 79, 43, 47, 46, 45, 42, 44, 79, 79, 6, + 56, 54, 79, 79, 79, 79, 79, 79, 53, 79, + 79, 79, 2, 0 + } ; static const YY_CHAR yy_ec[256] = @@ -426,103 +428,103 @@ static const YY_CHAR yy_meta[72] = 1 } ; -static const flex_int16_t yy_base[396] = +static const flex_int16_t yy_base[400] = { 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, + 0, 0, 0, 0, 71, 0, 139, 140, 833, 834, + 143, 145, 834, 144, 834, 834, 834, 834, 834, 140, + 145, 134, 162, 824, 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 + 233, 227, 834, 834, 811, 834, 823, 834, 834, 834, + 834, 809, 808, 807, 792, 788, 210, 218, 798, 785, + 787, 834, 762, 758, 194, 195, 759, 766, 754, 750, + 755, 744, 244, 241, 251, 246, 805, 809, 251, 276, + 293, 0, 227, 834, 808, 801, 801, 234, 277, 275, + + 287, 276, 289, 292, 297, 305, 279, 306, 299, 300, + 800, 308, 312, 310, 314, 315, 316, 799, 317, 318, + 331, 319, 321, 328, 333, 298, 803, 834, 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, 834, 834, 834, 834, 834, 780, + 834, 834, 834, 766, 752, 751, 741, 737, 377, 376, + 418, 370, 373, 0, 834, 791, 401, 429, 433, 437, + 375, 434, 435, 443, 386, 438, 439, 441, 440, 444, + 789, 446, 387, 789, 788, 787, 448, 786, 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, 834, 834, 728, 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, 834, 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, 834, 739, 742, 744, 747, 162 } ; -static const flex_int16_t yy_def[396] = +static const flex_int16_t yy_def[400] = { 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 + 394, 1, 1, 1, 394, 5, 1, 1, 394, 394, + 394, 394, 394, 395, 394, 394, 394, 394, 394, 394, + 394, 396, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 398, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 397, 397, 394, 395, 394, 395, 394, 394, + 394, 399, 396, 394, 396, 394, 397, 397, 397, 397, + + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 398, 398, 394, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 397, 397, + 394, 394, 394, 399, 394, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 394, 397, 397, 397, 397, 397, 397, 397, 397, 397, + + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 394, 394, 394, 394, 397, 397, 397, 397, 397, + 397, 397, 394, 397, 394, 397, 394, 397, 397, 394, + 397, 397, 397, 397, 397, 397, 394, 397, 394, 394, + 397, 397, 394, 397, 397, 394, 397, 397, 394, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 394, 394, 397, 397, + 397, 397, 397, 394, 394, 394, 394, 394, 394, 397, + + 397, 397, 397, 397, 397, 397, 397, 397, 397, 394, + 394, 394, 394, 394, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 394, 397, 397, 394, 394, 397, 394, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 394, 397, 394, 397, 394, 397, + 397, 397, 397, 397, 397, 394, 397, 397, 397, 397, + 397, 394, 394, 394, 394, 394, 394, 397, 397, 397, + 394, 394, 397, 397, 397, 397, 397, 397, 394, 397, + 397, 397, 397, 0, 394, 394, 394, 394, 394 } ; -static const flex_int16_t yy_nxt[903] = +static const flex_int16_t yy_nxt[906] = { 0, 10, 11, 12, 13, 14, 10, 10, 15, 16, 10, 17, 18, 19, 10, 10, 20, 21, 21, 22, 10, @@ -538,95 +540,95 @@ static const flex_int16_t yy_nxt[903] = 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 + 79, 10, 80, 10, 10, 10, 10, 81, 10, 53, + 82, 54, 10, 10, 85, 85, 85, 85, 87, 10, + 10, 10, 10, 89, 94, 90, 90, 90, 89, 96, + 90, 90, 90, 96, 174, 91, 96, 96, 96, 96, + 91, 96, 83, 83, 127, 128, 96, 103, 95, 96, + 110, 106, 96, 96, 98, 99, 104, 96, 88, 96, + 105, 91, 96, 108, 113, 96, 91, 84, 84, 100, + + 101, 102, 107, 109, 96, 118, 92, 96, 111, 114, + 119, 96, 96, 125, 96, 112, 96, 115, 116, 96, + 134, 96, 96, 129, 130, 120, 123, 96, 135, 121, + 138, 117, 136, 96, 96, 159, 122, 131, 132, 133, + 96, 96, 124, 157, 143, 159, 157, 94, 96, 161, + 87, 96, 85, 85, 139, 137, 141, 162, 161, 162, + 96, 144, 146, 140, 111, 116, 171, 171, 171, 145, + 142, 95, 176, 175, 147, 118, 91, 149, 169, 148, + 152, 150, 96, 96, 96, 154, 96, 151, 146, 89, + 88, 90, 90, 90, 96, 153, 96, 180, 178, 96, + + 170, 91, 91, 172, 96, 172, 96, 96, 173, 173, + 173, 177, 96, 96, 186, 96, 179, 96, 181, 96, + 184, 96, 96, 96, 96, 96, 96, 91, 96, 187, + 182, 183, 190, 189, 192, 96, 185, 188, 96, 193, + 96, 200, 127, 128, 96, 96, 199, 195, 196, 96, + 96, 194, 96, 197, 204, 198, 203, 96, 201, 96, + 96, 96, 206, 96, 202, 96, 96, 96, 205, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 173, 173, 173, 173, 173, + 173, 208, 210, 96, 257, 257, 389, 207, 209, 175, + + 176, 96, 214, 258, 283, 211, 242, 249, 96, 307, + 215, 221, 217, 220, 197, 212, 213, 222, 216, 218, + 225, 219, 226, 195, 196, 224, 194, 227, 231, 223, + 228, 198, 229, 171, 171, 171, 96, 230, 223, 236, + 96, 243, 245, 91, 96, 250, 96, 96, 96, 96, + 247, 96, 237, 96, 96, 96, 263, 96, 96, 96, + 266, 269, 244, 246, 96, 96, 240, 238, 239, 91, + 241, 248, 251, 96, 254, 256, 255, 264, 252, 253, + 261, 267, 270, 265, 272, 262, 96, 96, 243, 245, + 268, 271, 247, 96, 250, 96, 96, 96, 263, 96, + + 96, 273, 96, 96, 96, 236, 96, 96, 266, 96, + 96, 269, 96, 242, 96, 274, 275, 96, 96, 96, + 96, 96, 96, 96, 293, 96, 96, 291, 96, 96, + 96, 292, 96, 276, 96, 244, 246, 240, 241, 248, + 96, 303, 305, 301, 306, 264, 277, 300, 280, 281, + 282, 271, 278, 279, 284, 267, 285, 265, 270, 286, + 268, 289, 304, 96, 96, 290, 96, 302, 96, 318, + 320, 316, 321, 319, 322, 317, 96, 308, 96, 96, + 300, 304, 96, 96, 96, 325, 96, 307, 96, 96, + 96, 96, 96, 315, 96, 309, 96, 96, 96, 96, + + 329, 96, 96, 96, 330, 96, 96, 96, 334, 96, + 96, 96, 303, 96, 338, 331, 305, 327, 328, 96, + 332, 335, 324, 340, 341, 355, 342, 357, 359, 323, + 96, 96, 96, 96, 96, 326, 355, 357, 359, 96, + 354, 96, 96, 345, 346, 96, 356, 349, 358, 360, + 96, 361, 362, 96, 343, 344, 347, 348, 351, 363, + 340, 352, 350, 364, 365, 367, 96, 368, 353, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 354, 96, 356, 358, 360, 96, 379, 96, 96, + 96, 96, 361, 96, 175, 96, 175, 362, 175, 175, + + 385, 175, 388, 378, 369, 175, 386, 175, 382, 380, + 391, 393, 381, 175, 370, 377, 384, 376, 375, 175, + 374, 367, 368, 175, 373, 175, 371, 387, 372, 386, + 390, 366, 383, 175, 175, 393, 175, 380, 392, 86, + 86, 86, 93, 93, 93, 97, 97, 126, 126, 126, + 175, 175, 175, 175, 175, 175, 339, 337, 336, 96, + 333, 175, 175, 175, 175, 175, 175, 175, 96, 314, + 175, 313, 312, 175, 311, 310, 175, 175, 175, 175, + 175, 299, 175, 298, 175, 297, 175, 296, 295, 294, + 288, 175, 287, 96, 96, 260, 259, 175, 235, 232, + + 234, 233, 156, 232, 156, 394, 96, 191, 96, 175, + 394, 394, 96, 163, 168, 167, 163, 155, 166, 158, + 165, 164, 163, 155, 158, 160, 159, 158, 157, 156, + 155, 96, 394, 9, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + + 394, 394, 394, 394, 394 } ; -static const flex_int16_t yy_chk[903] = +static const flex_int16_t yy_chk[906] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -645,7 +647,7 @@ static const flex_int16_t yy_chk[903] = 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, 21, 21, 26, 399, 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, @@ -654,80 +656,80 @@ static const flex_int16_t yy_chk[903] = 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 + 51, 98, 36, 68, 46, 75, 76, 93, 84, 67, + 86, 83, 85, 85, 43, 41, 44, 68, 75, 76, + 393, 47, 48, 43, 45, 83, 89, 89, 89, 47, + 45, 93, 98, 389, 48, 49, 89, 50, 83, 49, + 51, 50, 100, 102, 99, 52, 107, 50, 84, 90, + 86, 90, 90, 90, 101, 51, 103, 102, 100, 104, + + 84, 90, 89, 91, 105, 91, 109, 110, 91, 91, + 91, 99, 106, 108, 107, 112, 101, 114, 103, 113, + 105, 115, 116, 117, 119, 120, 122, 90, 123, 108, + 104, 104, 110, 109, 112, 124, 106, 108, 121, 113, + 125, 120, 126, 126, 129, 130, 119, 115, 116, 131, + 132, 114, 133, 117, 123, 117, 122, 134, 121, 135, + 136, 137, 125, 141, 121, 138, 142, 144, 124, 140, + 139, 143, 145, 146, 147, 151, 150, 148, 149, 153, + 154, 152, 181, 170, 169, 172, 172, 172, 173, 173, + 173, 131, 133, 185, 193, 222, 386, 130, 132, 382, + + 129, 258, 136, 193, 222, 134, 181, 185, 177, 258, + 137, 142, 139, 141, 169, 135, 135, 143, 138, 139, + 149, 140, 150, 145, 146, 148, 144, 150, 154, 147, + 151, 147, 152, 171, 171, 171, 178, 153, 170, 177, + 179, 182, 183, 171, 180, 186, 187, 189, 188, 207, + 184, 190, 178, 192, 199, 197, 200, 201, 203, 208, + 202, 204, 182, 183, 211, 206, 179, 178, 178, 171, + 180, 184, 186, 205, 189, 192, 190, 200, 187, 188, + 197, 202, 204, 201, 206, 199, 209, 210, 212, 213, + 203, 205, 214, 215, 216, 217, 219, 218, 225, 220, + + 224, 208, 221, 228, 223, 207, 226, 230, 227, 238, + 239, 229, 249, 211, 231, 208, 208, 251, 256, 273, + 276, 277, 278, 253, 239, 274, 280, 238, 255, 285, + 275, 238, 254, 215, 237, 212, 213, 209, 210, 214, + 252, 253, 255, 251, 256, 225, 216, 249, 219, 220, + 221, 230, 217, 218, 223, 227, 224, 226, 229, 231, + 228, 237, 254, 261, 262, 237, 272, 252, 279, 274, + 275, 273, 277, 274, 278, 273, 281, 261, 282, 283, + 276, 280, 284, 286, 290, 285, 289, 283, 291, 292, + 301, 302, 306, 272, 293, 262, 315, 309, 316, 308, + + 290, 317, 318, 321, 291, 319, 320, 322, 301, 325, + 323, 324, 279, 326, 306, 292, 281, 289, 289, 327, + 293, 302, 284, 308, 309, 328, 315, 329, 330, 282, + 331, 332, 338, 334, 343, 286, 344, 345, 346, 341, + 327, 335, 342, 317, 318, 347, 328, 321, 329, 330, + 348, 331, 332, 349, 316, 316, 319, 320, 323, 334, + 324, 325, 322, 335, 338, 341, 350, 342, 326, 351, + 352, 363, 353, 364, 365, 369, 370, 371, 378, 383, + 384, 343, 379, 344, 345, 346, 388, 364, 385, 390, + 387, 392, 347, 391, 381, 380, 377, 348, 376, 375, + + 378, 374, 385, 363, 349, 373, 379, 372, 368, 365, + 388, 391, 367, 366, 350, 362, 370, 361, 360, 359, + 358, 352, 353, 357, 356, 355, 351, 383, 354, 384, + 387, 340, 369, 339, 337, 392, 336, 371, 390, 395, + 395, 395, 396, 396, 396, 397, 397, 398, 398, 398, + 333, 314, 313, 312, 311, 310, 307, 305, 304, 303, + 300, 299, 298, 297, 296, 295, 294, 288, 271, 270, + 269, 268, 267, 266, 265, 264, 263, 260, 259, 257, + 250, 248, 247, 246, 245, 244, 243, 242, 241, 240, + 236, 235, 234, 198, 196, 195, 194, 191, 176, 168, + + 167, 166, 165, 164, 160, 127, 118, 111, 97, 96, + 95, 88, 87, 82, 81, 80, 79, 78, 77, 74, + 73, 71, 70, 69, 66, 65, 64, 63, 62, 57, + 55, 24, 9, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + + 394, 394, 394, 394, 394 } ; /* The intent behind this definition is that it'll catch @@ -761,8 +763,8 @@ static const flex_int16_t yy_chk[903] = mPosition += yyleng;\ mpNodeList->push_back(mpNode); -#line 764 "" -#line 765 "" +#line 766 "" +#line 767 "" #define INITIAL 0 #define sSIGNorVALUE 1 @@ -898,7 +900,7 @@ YY_DECL { #line 36 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" -#line 902 "" +#line 904 "" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -925,13 +927,13 @@ YY_DECL 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 ) + if ( yy_current_state >= 395 ) 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 ); + while ( yy_current_state != 394 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1819,11 +1821,11 @@ case 71: YY_RULE_SETUP #line 560 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" - BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::PLUS, + BEGIN(sSIGNorVALUE); + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::QUOTIENT, yytext); COMMON_ACTION; - return TOKEN_OPERATOR_PLUS; + return TOKEN_OPERATOR_REMAINDER; YY_BREAK case 72: @@ -1831,7 +1833,7 @@ YY_RULE_SETUP #line 568 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); - mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MINUS, + mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::PLUS, yytext); COMMON_ACTION; return TOKEN_OPERATOR_PLUS; @@ -1841,6 +1843,17 @@ case 73: YY_RULE_SETUP #line 576 "/home/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 74: +YY_RULE_SETUP +#line 584 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" + BEGIN(sSIGNorVALUE); mPosition += yyleng; // mpNode = new CEvaluationNodeStructure(CEvaluationNode::SubType::OPEN, @@ -1849,9 +1862,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_OPEN; YY_BREAK -case 74: +case 75: YY_RULE_SETUP -#line 585 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 593 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mPosition += yyleng; @@ -1861,9 +1874,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_VECTOR_OPEN; YY_BREAK -case 75: +case 76: YY_RULE_SETUP -#line 594 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 602 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mPosition += yyleng; @@ -1873,9 +1886,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_COMMA; YY_BREAK -case 76: +case 77: YY_RULE_SETUP -#line 603 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 611 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mPosition += yyleng; @@ -1885,9 +1898,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_CLOSE; YY_BREAK -case 77: +case 78: YY_RULE_SETUP -#line 612 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 620 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mPosition += yyleng; @@ -1897,10 +1910,10 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_VECTOR_CLOSE; YY_BREAK -case 78: -/* rule 78 can match eol */ +case 79: +/* rule 79 can match eol */ YY_RULE_SETUP -#line 621 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 629 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeVariable(CEvaluationNode::SubType::DEFAULT, @@ -1909,10 +1922,10 @@ YY_RULE_SETUP return TOKEN_VARIABLE; YY_BREAK -case 79: -/* rule 79 can match eol */ +case 80: +/* rule 80 can match eol */ YY_RULE_SETUP -#line 629 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 637 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" mPosition += yyleng; // mpNode = new CEvaluationNodeWhiteSpace(CEvaluationNode::SubType::DEFAULT, @@ -1924,23 +1937,23 @@ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(sSIGNorVALUE): case YY_STATE_EOF(sOPERATOR): case YY_STATE_EOF(sVALUE): -#line 636 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 644 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" return 0; YY_BREAK -case 80: +case 81: YY_RULE_SETUP -#line 638 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 646 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" CCopasiMessage(CCopasiMessage::ERROR, MCFunction + 2, mPosition); return YYERRCODE; YY_BREAK -case 81: +case 82: YY_RULE_SETUP -#line 643 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 651 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" ECHO; YY_BREAK -#line 1944 "" +#line 1957 "" case YY_END_OF_BUFFER: { @@ -2356,7 +2369,7 @@ int yyFlexLexer::yy_get_next_buffer() 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 ) + if ( yy_current_state >= 395 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -2384,11 +2397,11 @@ int yyFlexLexer::yy_get_next_buffer() 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 ) + if ( yy_current_state >= 395 ) 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); + yy_is_jam = (yy_current_state == 394); return yy_is_jam ? 0 : yy_current_state; } @@ -2902,6 +2915,6 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 643 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 651 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" diff --git a/copasi/function/CEvaluationNode.cpp b/copasi/function/CEvaluationNode.cpp index bb1c2c0093..2dcfee3a8b 100644 --- a/copasi/function/CEvaluationNode.cpp +++ b/copasi/function/CEvaluationNode.cpp @@ -120,6 +120,7 @@ const CEnumAnnotation< std::string, CEvaluationNode::SubType > CEvaluationNode:: "Power", "Rationale", "Remainder", + "Quotient", // QUOTIENT "Rgamma", "Rnormal", "Rpoisson", diff --git a/copasi/function/CEvaluationNode.h b/copasi/function/CEvaluationNode.h index c2e8eea18c..b7d39564ca 100644 --- a/copasi/function/CEvaluationNode.h +++ b/copasi/function/CEvaluationNode.h @@ -120,6 +120,7 @@ class CEvaluationNode : public CCopasiNode< std::string > NE, TAN, REMAINDER, + QUOTIENT, GT, SEC, CSC, diff --git a/copasi/function/CEvaluationNodeOperator.cpp b/copasi/function/CEvaluationNodeOperator.cpp index 0ba793459e..805cd22054 100644 --- a/copasi/function/CEvaluationNodeOperator.cpp +++ b/copasi/function/CEvaluationNodeOperator.cpp @@ -92,6 +92,11 @@ CEvaluationNodeOperator::CEvaluationNodeOperator(const SubType & subType, mpOperator = &CEvaluationNodeOperator::s_remainder; break; + case SubType::QUOTIENT: + mPrecedence = PRECEDENCE_OPERATOR_REMAINDER; + mpOperator = &CEvaluationNodeOperator::s_quotient; + break; + default: break; } @@ -178,6 +183,13 @@ 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(); @@ -195,14 +207,16 @@ std::string CEvaluationNodeOperator::getInfix(const std::vector< std::string > & else Infix = children[0]; - if (SubType::REMAINDER == (mSubType)) + if (SubType::REMAINDER == mSubType + || SubType::QUOTIENT == mSubType) { Infix += " "; } Infix += mData; - if (SubType::REMAINDER == (mSubType)) + if (SubType::REMAINDER == mSubType + || SubType::QUOTIENT == mSubType) { Infix += " "; } @@ -230,14 +244,16 @@ std::string CEvaluationNodeOperator::getDisplayString(const std::vector< std::st else DisplayString = children[0]; - if (SubType::REMAINDER == (mSubType)) + if (SubType::REMAINDER == mSubType + || SubType::QUOTIENT == mSubType) { DisplayString += " "; } DisplayString += mData; - if (SubType::REMAINDER == (mSubType)) + if (SubType::REMAINDER == mSubType + || SubType::QUOTIENT == mSubType) { DisplayString += " "; } @@ -267,6 +283,9 @@ 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)"; @@ -279,6 +298,7 @@ std::string CEvaluationNodeOperator::getCCodeString(const std::vector< std::stri { case SubType::POWER: case SubType::REMAINDER: + case SubType::QUOTIENT: DisplayString += ","; break; @@ -297,7 +317,8 @@ std::string CEvaluationNodeOperator::getCCodeString(const std::vector< std::stri DisplayString += children[1]; if (subType == SubType::POWER || - subType == SubType::REMAINDER) + subType == SubType::REMAINDER || + subType == SubType::QUOTIENT) DisplayString += ")"; return DisplayString; @@ -350,6 +371,9 @@ 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 @@ -362,6 +386,10 @@ std::string CEvaluationNodeOperator::getXPPString(const std::vector< std::string DisplayString += ","; break; + case SubType::QUOTIENT: + DisplayString += "/"; + break; + default: DisplayString += mData; break; @@ -373,7 +401,8 @@ std::string CEvaluationNodeOperator::getXPPString(const std::vector< std::string DisplayString += children[1]; if (subType == SubType::MODULUS || - subType == SubType::REMAINDER) + subType == SubType::REMAINDER || + subType == SubType::QUOTIENT) DisplayString += ")"; return DisplayString; @@ -422,9 +451,9 @@ CEvaluationNode * CEvaluationNodeOperator::fromAST(const ASTNode * pASTNode, con data = "^"; break; - case AST_FUNCTION_REM: - subType = SubType::REMAINDER; - data = "mod"; + case AST_FUNCTION_QUOTIENT: + subType = SubType::QUOTIENT; + data = "quot"; break; default: @@ -530,6 +559,10 @@ ASTNode* CEvaluationNodeOperator::toAST(const CDataModel* pDataModel) const CEvaluationNodeOperator::createModuloTree(this, node, pDataModel); break; + case SubType::QUOTIENT: + node->setType(AST_FUNCTION_QUOTIENT); + break; + case SubType::PLUS: node->setType(AST_PLUS); break; @@ -1673,6 +1706,31 @@ 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; } diff --git a/copasi/function/CEvaluationNodeOperator.h b/copasi/function/CEvaluationNodeOperator.h index b0a7747d77..d9d0af15f5 100644 --- a/copasi/function/CEvaluationNodeOperator.h +++ b/copasi/function/CEvaluationNodeOperator.h @@ -184,6 +184,7 @@ 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/CEvaluationTree.cpp b/copasi/function/CEvaluationTree.cpp index 81b1f17c73..8bf2c87053 100644 --- a/copasi/function/CEvaluationTree.cpp +++ b/copasi/function/CEvaluationTree.cpp @@ -890,6 +890,7 @@ 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/math/CJitCompilerImplementation.cpp b/copasi/math/CJitCompilerImplementation.cpp index 366a81b952..3ee2cf0ce4 100644 --- a/copasi/math/CJitCompilerImplementation.cpp +++ b/copasi/math/CJitCompilerImplementation.cpp @@ -485,6 +485,13 @@ 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; } diff --git a/copasi/math/CJitCompilerImplementation.h b/copasi/math/CJitCompilerImplementation.h index e007585995..8e4deed8a6 100644 --- a/copasi/math/CJitCompilerImplementation.h +++ b/copasi/math/CJitCompilerImplementation.h @@ -6,6 +6,8 @@ #ifndef COPASI_CJitCompilerImplementation #define COPASI_CJitCompilerImplementation +#include + #include "copasi/math/CJitCompiler.h" #if (defined USE_JIT) && defined (JIT_IMPLEMENTATION) @@ -86,6 +88,10 @@ 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);} diff --git a/copasi/math/CMathContainer.cpp b/copasi/math/CMathContainer.cpp index 1ae8c2096a..c8d59f89dd 100644 --- a/copasi/math/CMathContainer.cpp +++ b/copasi/math/CMathContainer.cpp @@ -1845,6 +1845,7 @@ 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): if (replaceDiscontinuousNodes) { @@ -4726,6 +4727,7 @@ 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): createDiscontinuityDataEvent(*itNode); break; @@ -4779,7 +4781,8 @@ std::string CMathContainer::createDiscontinuityTriggerInfix(const CEvaluationNod break; case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::REMAINDER): - TriggerInfix = "sin(PI*(" + static_cast< const CEvaluationNode * >(pNode->getChild())->buildInfix() + "/"; + case (CEvaluationNode::MainType::OPERATOR | CEvaluationNode::SubType::QUOTIENT): + TriggerInfix = "sin(PI*(" + static_cast< const CEvaluationNode * >(pNode->getChild())->buildInfix() + ")/("; TriggerInfix += static_cast< const CEvaluationNode * >(pNode->getChild()->getSibling())->buildInfix() + ")) > 0"; break; From ea7c1456ccf27b299cdeb0a4f1631bc9f45885be Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 23 Oct 2024 09:35:32 +0200 Subject: [PATCH 05/54] - issue 3263: define external tools, start detached --- copasi/UI/CQExternalToolDialog.cpp | 244 +++++++++++++++ copasi/UI/CQExternalToolDialog.h | 41 +++ copasi/UI/CQExternalToolDialog.ui | 460 +++++++++++++++++++++++++++++ copasi/UI/CQExternalTools.cpp | 352 ++++++++++++++++++++++ copasi/UI/CQExternalTools.h | 136 +++++++++ copasi/UI/copasiui3window.cpp | 26 ++ copasi/UI/copasiui3window.h | 8 + copasi/commandline/COptions.h | 14 +- 8 files changed, 1276 insertions(+), 5 deletions(-) create mode 100644 copasi/UI/CQExternalToolDialog.cpp create mode 100644 copasi/UI/CQExternalToolDialog.h create mode 100644 copasi/UI/CQExternalToolDialog.ui create mode 100644 copasi/UI/CQExternalTools.cpp create mode 100644 copasi/UI/CQExternalTools.h diff --git a/copasi/UI/CQExternalToolDialog.cpp b/copasi/UI/CQExternalToolDialog.cpp new file mode 100644 index 0000000000..b8a6917058 --- /dev/null +++ b/copasi/UI/CQExternalToolDialog.cpp @@ -0,0 +1,244 @@ +#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 new file mode 100644 index 0000000000..b77292de36 --- /dev/null +++ b/copasi/UI/CQExternalToolDialog.h @@ -0,0 +1,41 @@ +#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 new file mode 100644 index 0000000000..894b310793 --- /dev/null +++ b/copasi/UI/CQExternalToolDialog.ui @@ -0,0 +1,460 @@ + + + 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 new file mode 100644 index 0000000000..cdc4cf4585 --- /dev/null +++ b/copasi/UI/CQExternalTools.cpp @@ -0,0 +1,352 @@ +#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 == "$sbmlFile") + { + auto sbmlFile = saveDir + "/temp.sbml"; + auto sbml = dm->exportSBMLToString(NULL, 3, 1); + + 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 new file mode 100644 index 0000000000..359c94f685 --- /dev/null +++ b/copasi/UI/CQExternalTools.h @@ -0,0 +1,136 @@ +#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/copasiui3window.cpp b/copasi/UI/copasiui3window.cpp index 4b4c743fc7..e95b3125d8 100644 --- a/copasi/UI/copasiui3window.cpp +++ b/copasi/UI/copasiui3window.cpp @@ -87,6 +87,7 @@ #include "copasi/model/CModelExpansion.h" #include "copasi/UI/CQCheckModelWindow.h" #include +#include #include "copasi/model/CModelExpansion.h" @@ -114,6 +115,9 @@ #include +#include +#include + #include #define AutoSaveInterval 10*60*1000 @@ -346,6 +350,8 @@ CopasiUI3Window::CopasiUI3Window(): , mpPopulationDisplay(NULL) , mAutoUpdateCheck(false) , mActionStack() + , mpaShowExternalToolDialog(NULL) + , mpExternaltools(new CQExternalTools) { // There can only be one pMainWindow = this; @@ -415,6 +421,8 @@ CopasiUI3Window::CopasiUI3Window(): QTimer::singleShot(10, this, SLOT(slotAutoCheckForUpdates())); connect(this, SIGNAL(signalDefferedLoadFile(QString)), this, SLOT(slotDefferedLoadFile(QString))); + + mpExternaltools->init(mpTools, mpaShowExternalToolDialog); } CopasiUI3Window::~CopasiUI3Window() @@ -445,6 +453,7 @@ CopasiUI3Window::~CopasiUI3Window() mpDataModelGUI->deregisterListView(mpListView); pdelete(mpDataModelGUI); pdelete(mpListView); + pdelete(mpExternaltools); } void CopasiUI3Window::createActions() @@ -580,6 +589,9 @@ 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 @@ -827,6 +839,8 @@ 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); @@ -3883,6 +3897,18 @@ 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 diff --git a/copasi/UI/copasiui3window.h b/copasi/UI/copasiui3window.h index c59392904f..e08387b457 100644 --- a/copasi/UI/copasiui3window.h +++ b/copasi/UI/copasiui3window.h @@ -79,6 +79,7 @@ class CModelVersionHierarchy; class CQOptPopulation; class CDataModel; class CUndoStack; +class CQExternalTools; enum CopasiUIActions { @@ -201,6 +202,8 @@ public slots: void slotFileOpen(QString file = QString()); void slotFileOpenFromUrl(QString url = QString()); + void slotConfigureExternalTools(); + void slotHandleCopasiScheme(const QUrl& url); public: @@ -495,6 +498,11 @@ protected slots: std::deque< std::pair < CopasiUIActions, std::string > > mActionStack; + QAction * mpaShowExternalToolDialog; + + + CQExternalTools * mpExternaltools; + #ifdef COPASI_SBW_INTEGRATION public: /** diff --git a/copasi/commandline/COptions.h b/copasi/commandline/COptions.h index 70e5443196..6ade83eb5a 100644 --- a/copasi/commandline/COptions.h +++ b/copasi/commandline/COptions.h @@ -39,6 +39,7 @@ #include "copasi/commandline/CLocaleString.h" + class COptions { class COptionValue @@ -153,6 +154,14 @@ 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) @@ -165,12 +174,7 @@ 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 From 1fb038b2557ead098321b160980f5251e06f427e Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 23 Oct 2024 09:59:50 +0200 Subject: [PATCH 06/54] - issue 3262: if 3d chart is not available dont display it --- copasi/UI/CQArrayAnnotationsWidget.cpp | 155 ++++++++++++++----------- copasi/UI/CQArrayAnnotationsWidget.h | 2 +- 2 files changed, 86 insertions(+), 71 deletions(-) diff --git a/copasi/UI/CQArrayAnnotationsWidget.cpp b/copasi/UI/CQArrayAnnotationsWidget.cpp index bfdd98fd9a..1fb81019a3 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.cpp +++ b/copasi/UI/CQArrayAnnotationsWidget.cpp @@ -626,7 +626,15 @@ void CQArrayAnnotationsWidget::switchToBarChart() #ifdef WITH_QT5_VISUALIZATION if (!m_container) - createBarChart(); + { + if (!createBarChart()) + { + mpButton->setEnabled(false); + switchToTable(); + return; + } + + } fillBarChart(); @@ -939,6 +947,9 @@ void CQArrayAnnotationsWidget::fillBarChart() if (!mpArray) return; #ifdef WITH_QT5_VISUALIZATION + + if (!m_modifier) + return; m_modifier->loadData(mpArray, mRowIndex, mColIndex); @@ -1092,84 +1103,86 @@ void CQArrayAnnotationsWidget::fillBarChart() #endif } -void CQArrayAnnotationsWidget::createBarChart() +bool CQArrayAnnotationsWidget::createBarChart() { - if (!mWithBarChart) return; + if (!mWithBarChart) return false; #ifdef WITH_QT5_VISUALIZATION m_graph = new Q3DBars(); m_container = QWidget::createWindowContainer(m_graph); + + if (!m_graph->hasContext()) + return false; + mpStack->addWidget(m_container); - 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 &))); - } + 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(); @@ -1185,4 +1198,6 @@ void CQArrayAnnotationsWidget::createBarChart() mBarChartFilled = false; #endif // WITH_QT5_VISUALIZATION + + return true; } diff --git a/copasi/UI/CQArrayAnnotationsWidget.h b/copasi/UI/CQArrayAnnotationsWidget.h index 590bfc2c50..dba8725840 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.h +++ b/copasi/UI/CQArrayAnnotationsWidget.h @@ -179,7 +179,7 @@ public slots: void fillTable0(); - void createBarChart(); + bool createBarChart(); void fillBarChart(); From 34fcd450a80e396bccc7f5f4adc450e848359801 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 23 Oct 2024 10:53:18 +0200 Subject: [PATCH 07/54] - issue 3262: explicitly test for support of opengl --- copasi/UI/CQArrayAnnotationsWidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copasi/UI/CQArrayAnnotationsWidget.cpp b/copasi/UI/CQArrayAnnotationsWidget.cpp index 1fb81019a3..7130105e6a 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.cpp +++ b/copasi/UI/CQArrayAnnotationsWidget.cpp @@ -1103,12 +1103,18 @@ void CQArrayAnnotationsWidget::fillBarChart() #endif } +#include + bool CQArrayAnnotationsWidget::createBarChart() { - if (!mWithBarChart) return false; + if (!mWithBarChart) + return false; #ifdef WITH_QT5_VISUALIZATION + if (!backingStore()->window()->supportsOpenGL()) + return false; + m_graph = new Q3DBars(); m_container = QWidget::createWindowContainer(m_graph); From caf24d4ccf4a90558452fa1430f900ed1ac9a9d3 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 23 Oct 2024 14:17:58 +0200 Subject: [PATCH 08/54] - fix crash on plot with no items --- copasi/plotUI/CQCustomPlot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copasi/plotUI/CQCustomPlot.cpp b/copasi/plotUI/CQCustomPlot.cpp index a8bb64f93f..107cd42955 100644 --- a/copasi/plotUI/CQCustomPlot.cpp +++ b/copasi/plotUI/CQCustomPlot.cpp @@ -2372,7 +2372,7 @@ void CQCustomPlot::setupLegend() legend->clearItems(); - for (int i = (currentPage) * maxItems; i < ((currentPage + 1) *maxItems) && i < numItems; ++i) + for (int i = (currentPage) * maxItems; i < ((currentPage + 1) *maxItems) && i < numItems && i >=0; ++i) { auto * current = mCurves[i]; From 22acc62b8638ba30bbed6c17f34fb05386e39edd Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 24 Oct 2024 09:16:33 +0000 Subject: [PATCH 09/54] - allow to pickup mkl from mkl-static dir --- CMakeModules/FindCLAPACK.cmake | 10 +++++++--- copasi/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeModules/FindCLAPACK.cmake b/CMakeModules/FindCLAPACK.cmake index 2fae16f2ef..e6136df68b 100644 --- a/CMakeModules/FindCLAPACK.cmake +++ b/CMakeModules/FindCLAPACK.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the +# 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. @@ -112,10 +112,14 @@ if (NOT LAPACK_FOUND) set(BLA_VENDOR "Intel (MKL)") if (UNIX) - if (COPASI_BUILD_TYPE EQUAL "32bit") + if ((COPASI_BUILD_TYPE EQUAL "32bit") AND EXISTS $ENV{MKLROOT}/lib/ia32) 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") + elseif (COPASI_BUILD_TYPE EQUAL "64bit" AND EXISTS $ENV{MKLROOT}/lib/intel64) 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") + elseif(EXISTS "$ENV{MKLROOT}/lib" AND EXISTS "$ENV{MKLROOT}/lib/libmkl_intel_lp64.a") + set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/libmkl_core.a $ENV{MKLROOT}/lib/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") + elseif(EXISTS $ENV{MKLROOT}/lib AND EXISTS $ENV{MKLROOT}/lib/libmkl_intel.a) + set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/libmkl_intel.a $ENV{MKLROOT}/lib/libmkl_core.a $ENV{MKLROOT}/lib/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") endif () else () if (COPASI_BUILD_TYPE EQUAL "32bit") diff --git a/copasi/CMakeLists.txt b/copasi/CMakeLists.txt index 780358c2f1..3fc3452934 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) + if (CLAPACK_FOUND AND NOT USE_MKL) set(USE_CLAPACK 1) elseif (USE_MKL) set(USE_MKL 1) From 4069606ba504fa2e91d03e8279fcd7c466680468 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 24 Oct 2024 13:39:52 +0200 Subject: [PATCH 10/54] - issue 3262: explicitly delete graph and container if it is invalid --- copasi/UI/CQArrayAnnotationsWidget.cpp | 50 ++++++++++++++------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/copasi/UI/CQArrayAnnotationsWidget.cpp b/copasi/UI/CQArrayAnnotationsWidget.cpp index 7130105e6a..f479311e5c 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.cpp +++ b/copasi/UI/CQArrayAnnotationsWidget.cpp @@ -1,26 +1,26 @@ -// 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. +// 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. #ifdef SunOS #include @@ -1120,7 +1120,11 @@ bool CQArrayAnnotationsWidget::createBarChart() m_container = QWidget::createWindowContainer(m_graph); if (!m_graph->hasContext()) + { + pdelete(m_graph); + pdelete(m_container); return false; + } mpStack->addWidget(m_container); From a9a30d5e337d0809f362b7ded28c80fe9ed9cba4 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 24 Oct 2024 15:17:31 +0200 Subject: [PATCH 11/54] - store MKLROOT as variable --- CMakeModules/FindCLAPACK.cmake | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeModules/FindCLAPACK.cmake b/CMakeModules/FindCLAPACK.cmake index e6136df68b..abf979d498 100644 --- a/CMakeModules/FindCLAPACK.cmake +++ b/CMakeModules/FindCLAPACK.cmake @@ -109,28 +109,33 @@ 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 $ENV{MKLROOT}/lib/ia32) - 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" AND EXISTS $ENV{MKLROOT}/lib/intel64) - 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") - elseif(EXISTS "$ENV{MKLROOT}/lib" AND EXISTS "$ENV{MKLROOT}/lib/libmkl_intel_lp64.a") - set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/libmkl_core.a $ENV{MKLROOT}/lib/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") - elseif(EXISTS $ENV{MKLROOT}/lib AND EXISTS $ENV{MKLROOT}/lib/libmkl_intel.a) - set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/libmkl_intel.a $ENV{MKLROOT}/lib/libmkl_core.a $ENV{MKLROOT}/lib/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl") + 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") endif () else () 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") + 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") - 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") + set(LAPACK_LIBRARIES "${MKLROOT}/lib/intel64/mkl_intel_lp64.lib" "${MKLROOT}/lib/intel64/mkl_core.lib" "${MKLROOT}/lib/intel64/mkl_sequential.lib") endif () endif () add_definitions(-DHAVE_MKL) set(LAPACK_FOUND "Yes") + endif () endif () From 82b2384bc53db5b939791d006bc1fbb9502d9155 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 24 Oct 2024 15:17:54 +0200 Subject: [PATCH 12/54] - add location for uic qt6 on linux as hint --- copasi/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/copasi/CMakeLists.txt b/copasi/CMakeLists.txt index 3fc3452934..24f749e0b3 100644 --- a/copasi/CMakeLists.txt +++ b/copasi/CMakeLists.txt @@ -509,12 +509,14 @@ 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() From aea5a57e67b28efac8559a4459ae27ebda241796 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Sat, 26 Oct 2024 07:25:51 -0400 Subject: [PATCH 13/54] Bug 3262: Removed test for OpenGL which failed even when supported. --- copasi/UI/CQArrayAnnotationsWidget.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/copasi/UI/CQArrayAnnotationsWidget.cpp b/copasi/UI/CQArrayAnnotationsWidget.cpp index f479311e5c..bf429ce7a9 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.cpp +++ b/copasi/UI/CQArrayAnnotationsWidget.cpp @@ -1111,10 +1111,6 @@ bool CQArrayAnnotationsWidget::createBarChart() return false; #ifdef WITH_QT5_VISUALIZATION - - if (!backingStore()->window()->supportsOpenGL()) - return false; - m_graph = new Q3DBars(); m_container = QWidget::createWindowContainer(m_graph); From f73897b2195de3470964b9e3185801569d86a267 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 28 Oct 2024 11:00:18 +0100 Subject: [PATCH 14/54] - issue 3262: don't create container if context is invalid --- copasi/UI/CQArrayAnnotationsWidget.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/copasi/UI/CQArrayAnnotationsWidget.cpp b/copasi/UI/CQArrayAnnotationsWidget.cpp index bf429ce7a9..357d5eea5d 100644 --- a/copasi/UI/CQArrayAnnotationsWidget.cpp +++ b/copasi/UI/CQArrayAnnotationsWidget.cpp @@ -1103,25 +1103,22 @@ void CQArrayAnnotationsWidget::fillBarChart() #endif } -#include - bool CQArrayAnnotationsWidget::createBarChart() { if (!mWithBarChart) return false; #ifdef WITH_QT5_VISUALIZATION - m_graph = new Q3DBars(); - - m_container = QWidget::createWindowContainer(m_graph); + m_graph = new Q3DBars(); if (!m_graph->hasContext()) { pdelete(m_graph); - pdelete(m_container); return false; } + m_container = QWidget::createWindowContainer(m_graph); + mpStack->addWidget(m_container); m_modifier = new CQ3DBarsModifier(this, m_graph); From 5fb9184a5cf9f7385d8358d8bcedad00d4addbfa Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 29 Oct 2024 08:47:47 +0100 Subject: [PATCH 15/54] - issue 3265: do not crash on invalid units --- copasi/function/CEvaluationNode.cpp | 3 +++ copasi/function/CEvaluationNodeOperator.cpp | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/copasi/function/CEvaluationNode.cpp b/copasi/function/CEvaluationNode.cpp index 2dcfee3a8b..6c53afa5c1 100644 --- a/copasi/function/CEvaluationNode.cpp +++ b/copasi/function/CEvaluationNode.cpp @@ -919,6 +919,9 @@ CValidatedUnit CEvaluationNode::setUnit(const CMathContainer & /* container */, std::map < CEvaluationNode *, CValidatedUnit >::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/CEvaluationNodeOperator.cpp b/copasi/function/CEvaluationNodeOperator.cpp index 805cd22054..cc7e3f8e36 100644 --- a/copasi/function/CEvaluationNodeOperator.cpp +++ b/copasi/function/CEvaluationNodeOperator.cpp @@ -1742,6 +1742,10 @@ 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: @@ -1804,16 +1808,19 @@ 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; @@ -1879,6 +1886,9 @@ 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) { @@ -1890,8 +1900,7 @@ 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); } @@ -1909,6 +1918,9 @@ 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) { From f03d54cdb1cdd4048c26d93e82126c1871eab868 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 29 Oct 2024 08:48:42 +0100 Subject: [PATCH 16/54] - issue 3265: if we discover an invalid reaction, flag it as error not exception --- copasi/sbml/SBMLImporter.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/copasi/sbml/SBMLImporter.cpp b/copasi/sbml/SBMLImporter.cpp index d570dd5515..040dd3ba09 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_formulaToString(sbmlFunction->getBody()); + char* formula = SBML_formulaToL3String(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_parseFormula(str.str().c_str())); + const_cast(sbmlFunction)->setMath(SBML_parseL3Formula(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::EXCEPTION, MCSBML + 27, copasiReaction->getObjectName().c_str()); + CCopasiMessage(CCopasiMessage::ERROR, MCSBML + 27, copasiReaction->getObjectName().c_str()); } CEvaluationNode* pExpressionTreeRoot = CEvaluationTree::fromAST(node, false); @@ -2565,6 +2565,13 @@ 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) @@ -7577,7 +7584,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_formulaToString(*itNode); + std::string formula = SBML_formulaToL3String(*itNode); std::map< std::string, std::string >::const_iterator pos = map.find(formula); std::string replacementId; From 7f1f6f81ca3319b3b7e9eb5e15bce1e00d0451a8 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 31 Oct 2024 09:45:26 +0100 Subject: [PATCH 17/54] - fix an issue where steady state date would not be switched until a replot. --- copasi/plotUI/CQCustomPlot.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/copasi/plotUI/CQCustomPlot.cpp b/copasi/plotUI/CQCustomPlot.cpp index 107cd42955..5f2739b841 100644 --- a/copasi/plotUI/CQCustomPlot.cpp +++ b/copasi/plotUI/CQCustomPlot.cpp @@ -232,6 +232,7 @@ 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) { From 706f4b9202909e4589ba7c618571cd8d40c111ef Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 4 Nov 2024 10:16:00 +0100 Subject: [PATCH 18/54] - allow access to lna method and time sens --- copasi/bindings/common/downcast_common.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/copasi/bindings/common/downcast_common.cpp b/copasi/bindings/common/downcast_common.cpp index d357f8bc27..6aa750bce9 100644 --- a/copasi/bindings/common/downcast_common.cpp +++ b/copasi/bindings/common/downcast_common.cpp @@ -418,7 +418,10 @@ GetDowncastSwigTypeForMethod(CCopasiMethod* method) { pInfo = SWIGTYPE_p_CSensMethod; } - + else if (dynamic_cast(method)) + { + pInfo = SWIGTYPE_p_CLNAMethod; + } return pInfo; } @@ -579,6 +582,10 @@ GetDowncastSwigTypeForProblem(CCopasiProblem* problem) { pInfo = SWIGTYPE_p_CSensProblem; } + else if (dynamic_cast(problem)) + { + pInfo = SWIGTYPE_p_CTimeSensProblem; + } return pInfo; } @@ -633,6 +640,10 @@ GetDowncastSwigTypeForTask(CCopasiTask* task) { pInfo = SWIGTYPE_p_CSensTask; } + else if (dynamic_cast(task)) + { + pInfo = CTimeSensTask; + } return pInfo; } From 61f442931ed496f4d9052204fea9e62555918e90 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 5 Nov 2024 15:48:57 +0100 Subject: [PATCH 19/54] - add time course sensitivities --- copasi/bindings/swig/copasi.i | 3 +++ 1 file changed, 3 insertions(+) diff --git a/copasi/bindings/swig/copasi.i b/copasi/bindings/swig/copasi.i index b170e7e6d8..08529f279d 100644 --- a/copasi/bindings/swig/copasi.i +++ b/copasi/bindings/swig/copasi.i @@ -352,6 +352,9 @@ size_t INVALID_INDEX(); %include %include +%include +%include +%include %ignore COptMethodPS::COptMethodPS(const COptMethodPS&); %ignore COptMethodPS::COptMethodPS(const CDataContainer *); From ab8e245be0041422ded7da3ee0d85286bfb8c6e9 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 5 Nov 2024 15:52:15 +0100 Subject: [PATCH 20/54] - typo --- copasi/bindings/common/downcast_common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copasi/bindings/common/downcast_common.cpp b/copasi/bindings/common/downcast_common.cpp index 6aa750bce9..e3bcf18d65 100644 --- a/copasi/bindings/common/downcast_common.cpp +++ b/copasi/bindings/common/downcast_common.cpp @@ -642,7 +642,7 @@ GetDowncastSwigTypeForTask(CCopasiTask* task) } else if (dynamic_cast(task)) { - pInfo = CTimeSensTask; + pInfo = SWIGTYPE_p_CTimeSensTask; } return pInfo; From 37b094fa7727dabe726d167b7e71918c9acd84d8 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 5 Nov 2024 16:30:19 +0100 Subject: [PATCH 21/54] - move timesense problem as it is a descendant of trajectoryproblem --- copasi/bindings/common/downcast_common.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/copasi/bindings/common/downcast_common.cpp b/copasi/bindings/common/downcast_common.cpp index e3bcf18d65..f649328470 100644 --- a/copasi/bindings/common/downcast_common.cpp +++ b/copasi/bindings/common/downcast_common.cpp @@ -558,6 +558,10 @@ 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; @@ -582,10 +586,6 @@ GetDowncastSwigTypeForProblem(CCopasiProblem* problem) { pInfo = SWIGTYPE_p_CSensProblem; } - else if (dynamic_cast(problem)) - { - pInfo = SWIGTYPE_p_CTimeSensProblem; - } return pInfo; } @@ -616,6 +616,10 @@ 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; @@ -640,10 +644,6 @@ GetDowncastSwigTypeForTask(CCopasiTask* task) { pInfo = SWIGTYPE_p_CSensTask; } - else if (dynamic_cast(task)) - { - pInfo = SWIGTYPE_p_CTimeSensTask; - } return pInfo; } From 779afc547177d8020ba839a0d52bf9a44919e311 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 6 Nov 2024 13:47:06 +0100 Subject: [PATCH 22/54] - convert local to global parameters --- copasi/CopasiDataModel/CDataModel.cpp | 24 +++++++++++++++++- copasi/CopasiDataModel/CDataModel.h | 5 ++++ copasi/UI/copasiui3window.cpp | 36 +++++++++++++++++++++++++++ copasi/UI/copasiui3window.h | 1 + 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/copasi/CopasiDataModel/CDataModel.cpp b/copasi/CopasiDataModel/CDataModel.cpp index ba5d3dfd8d..583b8ca920 100644 --- a/copasi/CopasiDataModel/CDataModel.cpp +++ b/copasi/CopasiDataModel/CDataModel.cpp @@ -3735,7 +3735,29 @@ CDataModel::convertReactionsToODEs() "Replace reactions with rateRules" ); if (doc->convert(props) != LIBSBML_OPERATION_SUCCESS) { - CCopasiMessage(CCopasiMessage::ERROR, "Couldn't infer reactions: %s", doc->getErrorLog()->toString().c_str()); + 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()); return false; } diff --git a/copasi/CopasiDataModel/CDataModel.h b/copasi/CopasiDataModel/CDataModel.h index 4db7473118..5116255b83 100644 --- a/copasi/CopasiDataModel/CDataModel.h +++ b/copasi/CopasiDataModel/CDataModel.h @@ -274,6 +274,11 @@ 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/UI/copasiui3window.cpp b/copasi/UI/copasiui3window.cpp index e95b3125d8..0e273df0e2 100644 --- a/copasi/UI/copasiui3window.cpp +++ b/copasi/UI/copasiui3window.cpp @@ -830,6 +830,7 @@ 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); @@ -2086,6 +2087,41 @@ 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); diff --git a/copasi/UI/copasiui3window.h b/copasi/UI/copasiui3window.h index e08387b457..4771ed003a 100644 --- a/copasi/UI/copasiui3window.h +++ b/copasi/UI/copasiui3window.h @@ -259,6 +259,7 @@ protected slots: void slotConvertToIrreversible(); void slotConvertODEsToReactions(); void slotConvertReactionsToODEs(); + void slotPromoteLocalParameters(); void slotCreateEventsForTimeseries(); void listViewsFolderChanged(const QModelIndex & index); From 786174161134f04423f829ea6fcfff2800539438 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 6 Nov 2024 14:04:20 +0100 Subject: [PATCH 23/54] - issue 3266: start of new preference ui --- copasi/UI/CQPreferenceDialog.cpp | 157 ++++++++++++++++++++++++++++ copasi/UI/CQPreferenceDialog.h | 8 ++ copasi/UI/CQPreferenceDialog.ui | 62 +++++------ copasi/resourcesUI/copasi.qrc | 2 + copasi/resourcesUI/preferences.ini | 159 +++++++++++++++++++++++++++++ 5 files changed, 352 insertions(+), 36 deletions(-) create mode 100644 copasi/resourcesUI/preferences.ini diff --git a/copasi/UI/CQPreferenceDialog.cpp b/copasi/UI/CQPreferenceDialog.cpp index 7b2f54bb2f..3efc32b0f1 100644 --- a/copasi/UI/CQPreferenceDialog.cpp +++ b/copasi/UI/CQPreferenceDialog.cpp @@ -36,6 +36,9 @@ #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'. @@ -68,6 +71,134 @@ 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); + 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 (!tooltip.isEmpty()) + std::cout << tooltip.toStdString(); + + 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(); @@ -79,6 +210,32 @@ 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 b6e87195cb..ce67d9297a 100644 --- a/copasi/UI/CQPreferenceDialog.h +++ b/copasi/UI/CQPreferenceDialog.h @@ -27,7 +27,11 @@ #include "copasi/UI/ui_CQPreferenceDialog.h" +#include +#include + class CConfigurationFile; +class CCopasiParameter; class CQPreferenceDialog : public QDialog, public Ui::CQPreferenceDialog { @@ -39,15 +43,19 @@ 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 cf58ae8025..ababa576eb 100644 --- a/copasi/UI/CQPreferenceDialog.ui +++ b/copasi/UI/CQPreferenceDialog.ui @@ -1,29 +1,5 @@ - 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 @@ -31,8 +7,8 @@ 0 0 - 452 - 346 + 797 + 557 @@ -41,20 +17,34 @@ true - + + + + + 0 + + + + All Setttings + + + + + + + + + - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok - - - @@ -100,8 +90,8 @@ - - slotBtnOk() - slotBtnCancel() - + + slotBtnOk() + slotBtnCancel() + diff --git a/copasi/resourcesUI/copasi.qrc b/copasi/resourcesUI/copasi.qrc index 90940f0d73..50ab513560 100644 --- a/copasi/resourcesUI/copasi.qrc +++ b/copasi/resourcesUI/copasi.qrc @@ -61,5 +61,7 @@ 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 new file mode 100644 index 0000000000..191e897979 --- /dev/null +++ b/copasi/resourcesUI/preferences.ini @@ -0,0 +1,159 @@ +[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 From 0536f94f78efd44c2d3552c027d75613a3f224e6 Mon Sep 17 00:00:00 2001 From: Frank Bergmann Date: Wed, 6 Nov 2024 14:26:45 +0100 Subject: [PATCH 24/54] - issue 3266: make form layout grow (as it was too small on macOS) --- copasi/UI/CQPreferenceDialog.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/copasi/UI/CQPreferenceDialog.cpp b/copasi/UI/CQPreferenceDialog.cpp index 3efc32b0f1..619551c2ba 100644 --- a/copasi/UI/CQPreferenceDialog.cpp +++ b/copasi/UI/CQPreferenceDialog.cpp @@ -121,6 +121,7 @@ void CQPreferenceDialog::initTabsFromSettings(QSettings& settings) settings.beginGroup(mainGroup); auto tab = new QWidget(); auto layout = new QFormLayout(tab); + layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); tab->setLayout(layout); tabWidget->insertTab(0, tab, mainGroup); @@ -147,8 +148,6 @@ void CQPreferenceDialog::initTabsFromSettings(QSettings& settings) pNode = dynamic_cast< CCopasiParameterGroup * >(pNode)->getParameter(paramName.toStdString()); auto tooltip = settings.value("tooltip").toString(); - if (!tooltip.isEmpty()) - std::cout << tooltip.toStdString(); if (type == "string") { From b94824d0a5d6997a1974170246733df023143b05 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 6 Nov 2024 14:43:37 +0100 Subject: [PATCH 25/54] - issue 3267: move displayPopulations to optproblem --- copasi/UI/CQFittingWidget.cpp | 4 +++ copasi/UI/CQFittingWidget.ui | 10 +++++++ copasi/UI/CQOptimizationWidget.cpp | 4 +++ copasi/UI/CQOptimizationWidget.ui | 45 ++++++++++------------------- copasi/UI/TaskWidget.cpp | 6 ++-- copasi/optimization/COptProblem.cpp | 3 ++ 6 files changed, 41 insertions(+), 31 deletions(-) diff --git a/copasi/UI/CQFittingWidget.cpp b/copasi/UI/CQFittingWidget.cpp index d54e6ca653..46c719580d 100644 --- a/copasi/UI/CQFittingWidget.cpp +++ b/copasi/UI/CQFittingWidget.cpp @@ -283,6 +283,8 @@ bool CQFittingWidget::loadTaskProtected() mpConstraints->setExperimentSet(const_cast(mpExperimentSet)); mpConstraints->setCrossValidationSet(const_cast(mpCrossValidationSet)); + mpCheckDisplayPopulation->setChecked(pTask->getProblem()->getParameter("DisplayPoplations")->getValue< bool >()); + mChanged = false; return true; @@ -297,6 +299,8 @@ bool CQFittingWidget::runTask() mnParamterSetsBeforeRun = pTask->getObjectDataModel()->getModel()->getModelParameterSets().size(); + pTask->getProblem()->getParameter("DisplayPoplations")->setValue(mpCheckDisplayPopulation->isChecked()); + if (!commonBeforeRunTask()) return false; bool success = commonRunTask(); diff --git a/copasi/UI/CQFittingWidget.ui b/copasi/UI/CQFittingWidget.ui index ba273b586d..9a3267d379 100644 --- a/copasi/UI/CQFittingWidget.ui +++ b/copasi/UI/CQFittingWidget.ui @@ -101,6 +101,16 @@ Use Time Sens + + false + + + + + + + Display Population + diff --git a/copasi/UI/CQOptimizationWidget.cpp b/copasi/UI/CQOptimizationWidget.cpp index 7e8863923a..dec2c77fcb 100644 --- a/copasi/UI/CQOptimizationWidget.cpp +++ b/copasi/UI/CQOptimizationWidget.cpp @@ -157,6 +157,8 @@ bool CQOptimizationWidget::loadTaskProtected() mpConstraints->load(mpDataModel, pProblem->getGroup("OptimizationConstraintList"), NULL, NULL); + mpCheckDisplayPopulation->setChecked(pTask->getProblem()->getParameter("DisplayPoplations")->getValue< bool >()); + mChanged = false; return true; @@ -175,6 +177,8 @@ bool CQOptimizationWidget::runTask() if (!pTask) return false; + pTask->getProblem()->getParameter("DisplayPoplations")->setValue(mpCheckDisplayPopulation->isChecked()); + if (!commonBeforeRunTask()) return false; return commonRunTask(); diff --git a/copasi/UI/CQOptimizationWidget.ui b/copasi/UI/CQOptimizationWidget.ui index 99a20e224c..e7586c52e9 100644 --- a/copasi/UI/CQOptimizationWidget.ui +++ b/copasi/UI/CQOptimizationWidget.ui @@ -1,29 +1,5 @@ - 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 @@ -65,14 +41,14 @@ Expression - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop false - + @@ -125,7 +101,7 @@ Subtask - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter false @@ -145,10 +121,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Expanding + QSizePolicy::Policy::Expanding @@ -178,6 +154,13 @@ + + + + Display Population + + + @@ -269,4 +252,8 @@ + + slotPageIndexChange(int) + slotSubtaskChanged(QString) + diff --git a/copasi/UI/TaskWidget.cpp b/copasi/UI/TaskWidget.cpp index 1e0af93ab9..367fefcdc1 100644 --- a/copasi/UI/TaskWidget.cpp +++ b/copasi/UI/TaskWidget.cpp @@ -47,6 +47,7 @@ #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" @@ -63,6 +64,7 @@ #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 @@ -281,7 +283,7 @@ bool TaskWidget::commonBeforeRunTask() CCopasiMessage::clearDeque(); // create population display if needed - if (CRootContainer::getConfiguration()->displayPopulations()) + if (mpTask->getProblem()->getParameter("DisplayPoplations") && mpTask->getProblem()->getParameter("DisplayPoplations")->getValue< bool >()) { if (dynamic_cast(mpTask) != NULL || dynamic_cast(mpTask) != NULL) @@ -307,7 +309,7 @@ bool TaskWidget::commonAfterRunTask() { if (!mpTask) return false; - if (CRootContainer::getConfiguration()->displayPopulations()) + if (mpTask->getProblem()->getParameter("DisplayPoplations") && mpTask->getProblem()->getParameter("DisplayPoplations")->getValue()) { if (dynamic_cast(mpTask) != NULL || dynamic_cast(mpTask) != NULL) diff --git a/copasi/optimization/COptProblem.cpp b/copasi/optimization/COptProblem.cpp index d6b92e85ae..94b1853e3c 100644 --- a/copasi/optimization/COptProblem.cpp +++ b/copasi/optimization/COptProblem.cpp @@ -208,6 +208,9 @@ 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(); } From 7185afa7b9ace8cde9739c14376f598a539b9fac Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 7 Nov 2024 16:31:28 +0100 Subject: [PATCH 26/54] - fix detection of MKL on windows --- CMakeModules/FindCLAPACK.cmake | 12 ++++++++---- copasi/lapack/blaswrap.h | 6 +++++- copasi/lapack/lapackwrap.h | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeModules/FindCLAPACK.cmake b/CMakeModules/FindCLAPACK.cmake index abf979d498..8e780f57cb 100644 --- a/CMakeModules/FindCLAPACK.cmake +++ b/CMakeModules/FindCLAPACK.cmake @@ -126,15 +126,19 @@ if (NOT LAPACK_FOUND) 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") endif () else () - if (COPASI_BUILD_TYPE EQUAL "32bit") + 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") + 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") + set(CLAPACK_INCLUDE_DIR ${MKLROOT}/include) endif () endif () add_definitions(-DHAVE_MKL) set(LAPACK_FOUND "Yes") + set(USE_MKL 1) endif () endif () @@ -297,9 +301,9 @@ find_path(CLAPACK_INCLUDE_DIR clapack.h endif(NOT CLAPACK_INCLUDE_DIR) -if (CLAPACK_INCLUDE_DIR) +if (CLAPACK_INCLUDE_DIR AND NOT DEFINED MKLROOT) add_definitions(-DHAVE_CLAPACK_H) -endif (CLAPACK_INCLUDE_DIR) +endif (CLAPACK_INCLUDE_DIR AND NOT DEFINED MKLROOT) if (NOT CLAPACK_INCLUDE_DIR) find_path(CLAPACK_INCLUDE_DIR lapack.h diff --git a/copasi/lapack/blaswrap.h b/copasi/lapack/blaswrap.h index c52f1a11d5..7253f90bb2 100644 --- a/copasi/lapack/blaswrap.h +++ b/copasi/lapack/blaswrap.h @@ -34,7 +34,11 @@ 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 @@ -75,7 +79,7 @@ extern "C" # include # elif defined(HAVE_CBLAS_H) # include -# else +# elif !defined(USE_MKL) # include "copasi/lapack/blas.h" # endif diff --git a/copasi/lapack/lapackwrap.h b/copasi/lapack/lapackwrap.h index c616ca4a6f..124305c826 100644 --- a/copasi/lapack/lapackwrap.h +++ b/copasi/lapack/lapackwrap.h @@ -1256,7 +1256,7 @@ extern "C" # if defined (HAVE_CLAPACK_H) && !defined(HAVE_APPLE) && !defined(COPASI_OVERWRITE_USE_LAPACK) # include # else -# if !defined(HAVE_APPLE) +# if !defined(HAVE_APPLE) && !defined(USE_MKL) # include "copasi/lapack/lapack.h" # endif # endif From 6b29ea5e2cdf7dee9d87a57f4976529937983a06 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 7 Nov 2024 16:53:19 +0100 Subject: [PATCH 27/54] fix compilation of language bindings with swig4 for java and C# --- 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 | 1 + 6 files changed, 12 insertions(+) diff --git a/copasi/bindings/csharp/local.cpp b/copasi/bindings/csharp/local.cpp index 70b1d63935..74be0cecd4 100644 --- a/copasi/bindings/csharp/local.cpp +++ b/copasi/bindings/csharp/local.cpp @@ -39,6 +39,9 @@ #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 0f6d779fc9..b6ac0bdf67 100644 --- a/copasi/bindings/swig/CCopasiTask.i +++ b/copasi/bindings/swig/CCopasiTask.i @@ -70,8 +70,10 @@ %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 952afdf3bb..9bf90e30ab 100644 --- a/copasi/bindings/swig/CDataObject.i +++ b/copasi/bindings/swig/CDataObject.i @@ -116,7 +116,9 @@ 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 c58f665f6b..396f4749f5 100644 --- a/copasi/bindings/swig/CDataVector.i +++ b/copasi/bindings/swig/CDataVector.i @@ -361,7 +361,9 @@ %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 6dac6b86a7..54e53dc90d 100644 --- a/copasi/bindings/swig/CModel.i +++ b/copasi/bindings/swig/CModel.i @@ -49,10 +49,12 @@ %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 08529f279d..6a9d8aa645 100644 --- a/copasi/bindings/swig/copasi.i +++ b/copasi/bindings/swig/copasi.i @@ -78,6 +78,7 @@ LIBCOMBINE_CPP_NAMESPACE_USE #include "local.cpp" #include +#include /** * This method is used to get the C_INVALID_INDEX From 885134a6f5041cdabc276aed90daf32e3db60efa Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Thu, 7 Nov 2024 17:57:26 +0100 Subject: [PATCH 28/54] - use MKL if MKLROOT explicitly defined --- cmake-set-dependencies.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake-set-dependencies.cmake b/cmake-set-dependencies.cmake index d33ebc47e4..4a34cdf7cf 100644 --- a/cmake-set-dependencies.cmake +++ b/cmake-set-dependencies.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the +# 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. @@ -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 BLA_VENDOR OR "${BLA_VENDOR}" STREQUAL "COPASI Dependencies") +if (NOT DEFINED MKLROOT AND (NOT BLA_VENDOR OR "${BLA_VENDOR}" STREQUAL "COPASI Dependencies")) # clapack set (CLAPACK_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "clapack include directory" FORCE) From 77900ad5e56749a2f6c6150b47b0656f37da0528 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 8 Nov 2024 10:05:50 +0100 Subject: [PATCH 29/54] - compile as bigobj as otherwise compilation might fail --- copasi/bindings/csharp/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copasi/bindings/csharp/CMakeLists.txt b/copasi/bindings/csharp/CMakeLists.txt index 59b7e27acb..da801c806e 100644 --- a/copasi/bindings/csharp/CMakeLists.txt +++ b/copasi/bindings/csharp/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the +# 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. @@ -157,6 +157,12 @@ 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) From c29a6124f5823eb8dfdaecf30ba4b89c998b2ce1 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 8 Nov 2024 10:07:56 +0100 Subject: [PATCH 30/54] - dont run fixup_bundle by default, but allow to specify directories with dlls so it can be used --- copasi/CopasiUI/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copasi/CopasiUI/CMakeLists.txt b/copasi/CopasiUI/CMakeLists.txt index 8a78cf8dfb..fd0ce91758 100644 --- a/copasi/CopasiUI/CMakeLists.txt +++ b/copasi/CopasiUI/CMakeLists.txt @@ -125,7 +125,8 @@ 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" OFF) + option(COPASI_WIN32_SKIP_BUNDLE_UTILS "Skip bundle utilities" ON) + SET(DIRS "" CACHE STRING "Directories containing shared libraries for fixup_bundle") mark_as_advanced(COPASI_WIN32_SKIP_BUNDLE_UTILS) if (NOT COPASI_WIN32_SKIP_BUNDLE_UTILS) install(CODE " From cf5f3d5663c376d76f81a3aad3742005a696cc4f Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Sat, 9 Nov 2024 17:42:34 -0500 Subject: [PATCH 31/54] Set MKL include path for all platforms. --- CMakeModules/FindCLAPACK.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeModules/FindCLAPACK.cmake b/CMakeModules/FindCLAPACK.cmake index 8e780f57cb..a264e57621 100644 --- a/CMakeModules/FindCLAPACK.cmake +++ b/CMakeModules/FindCLAPACK.cmake @@ -132,10 +132,10 @@ if (NOT LAPACK_FOUND) 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") - set(CLAPACK_INCLUDE_DIR ${MKLROOT}/include) endif () endif () + set(CLAPACK_INCLUDE_DIR ${MKLROOT}/include) add_definitions(-DHAVE_MKL) set(LAPACK_FOUND "Yes") set(USE_MKL 1) From 88f113ee8025bbdf14ec16a2b5b2db527f62a788 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Mon, 11 Nov 2024 15:42:17 -0500 Subject: [PATCH 32/54] Assured that dgemm_ is called from the global namespace. --- copasi/utilities/dgemm.cpp | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/copasi/utilities/dgemm.cpp b/copasi/utilities/dgemm.cpp index ca2acbe5f6..07a020fb47 100644 --- a/copasi/utilities/dgemm.cpp +++ b/copasi/utilities/dgemm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2022 - 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. @@ -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; } From 24cd472d0ebefc815af63fe78a306b114691e158 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 12 Nov 2024 18:05:40 +0100 Subject: [PATCH 33/54] - allow to skip the copy step --- InnoSetup/COPASI.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/InnoSetup/COPASI.sh b/InnoSetup/COPASI.sh index a5c6458b22..505eca0a68 100644 --- a/InnoSetup/COPASI.sh +++ b/InnoSetup/COPASI.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the +# 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. @@ -14,6 +14,9 @@ # of Manchester. # All rights reserved. + + + # Echo all bash commands to ease debugging set -x @@ -32,6 +35,20 @@ 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=${workdir//\\/\\\\} + + stagedir="${SETUP_DIR}/package" + sstagedir=${stagedir//\\/\\\\} + goto :SKIP_COPY +fi + + [ -e ${SETUP_DIR}/package ] && rm -rf ${SETUP_DIR}/package mkdir ${SETUP_DIR}/package pushd ${SETUP_DIR}/package @@ -99,6 +116,8 @@ workdir=${workdir//\\/\\\\} stagedir=$(cygpath -wa "${SETUP_DIR}/package") stagedir=${stagedir//\\/\\\\} +:SKIP_COPY + # modify product code, product version, and package name sed -e '/#define MyAppVersion/s/".*"/"'${MyAppVersion}'"/' \ -e '/#define MyBuild/s/".*"/"'${buildname}'"/' \ From 7e532cd33cb95d972a7e40a65712cad67694fb67 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 13 Nov 2024 08:44:25 +0100 Subject: [PATCH 34/54] - really skip copying of files --- InnoSetup/COPASI.sh | 142 +++++++++++++++++++++++--------------------- 1 file changed, 73 insertions(+), 69 deletions(-) diff --git a/InnoSetup/COPASI.sh b/InnoSetup/COPASI.sh index 505eca0a68..a33db336cf 100644 --- a/InnoSetup/COPASI.sh +++ b/InnoSetup/COPASI.sh @@ -17,6 +17,9 @@ + + + # Echo all bash commands to ease debugging set -x @@ -45,78 +48,79 @@ if [ -n "${NO_COPY}" ]; then stagedir="${SETUP_DIR}/package" sstagedir=${stagedir//\\/\\\\} - goto :SKIP_COPY + +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//\\/\\\\} - -:SKIP_COPY # modify product code, product version, and package name sed -e '/#define MyAppVersion/s/".*"/"'${MyAppVersion}'"/' \ From e8587241378a962b26ba09104a04c33f668ff726 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 13 Nov 2024 09:50:26 +0100 Subject: [PATCH 35/54] - need to convert filename to window path --- InnoSetup/COPASI.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/InnoSetup/COPASI.sh b/InnoSetup/COPASI.sh index a33db336cf..741b9bfcbf 100644 --- a/InnoSetup/COPASI.sh +++ b/InnoSetup/COPASI.sh @@ -20,6 +20,9 @@ + + + # Echo all bash commands to ease debugging set -x @@ -44,10 +47,19 @@ if [ -n "${NO_COPY}" ]; then 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" - sstagedir=${stagedir//\\/\\\\} + 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 From 61f7de76eb5b7485b03499630b68a43af5995674 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Tue, 12 Nov 2024 11:36:16 -0500 Subject: [PATCH 36/54] Fixed typo. --- copasi/lapack/lapackwrap.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/copasi/lapack/lapackwrap.h b/copasi/lapack/lapackwrap.h index 124305c826..d59da41da8 100644 --- a/copasi/lapack/lapackwrap.h +++ b/copasi/lapack/lapackwrap.h @@ -1,4 +1,14 @@ -// Copyright (C) 2013 - 2015 by Pedro Mendes, Virginia Tech Intellectual +// 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 // Properties, Inc., University of Heidelberg, and The University // of Manchester. // All rights reserved. @@ -1048,7 +1058,7 @@ extern "C" # define zhetri_ ZHETRI # define zhetrs_ ZHETRS # define zhgeqz_ ZHGEQZ -# define zhpcon_ ZHPCONLAPACK_INCLUDE_DIR +# define zhpcon_ ZHPCON # define zhpev_ ZHPEV # define zhpevd_ ZHPEVD # define zhpevx_ ZHPEVX From 15f7e914a970ffc01cf958533ac8a16584e44108 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Thu, 14 Nov 2024 11:06:55 -0500 Subject: [PATCH 37/54] Improved performance managing the active parameter set. --- CMakeLists.txt | 1 + CMakeModules/FindCLAPACK.cmake | 2 +- copasi/CopasiDataModel/CDataModel.cpp | 29 +++++++++--------- copasi/CopasiSE/CopasiSE.cpp | 7 +++-- copasi/UI/CQParameterOverviewWidget.cpp | 3 +- copasi/UI/CQParameterSetsDM.cpp | 4 +-- 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/optimization/COptMethodPS.cpp | 10 +++---- copasi/plotUI/CQMarchingSquares.cpp | 5 ++-- copasi/sbml/SBMLImporter.cpp | 4 +-- copasi/sedml/SEDMLImporter.cpp | 11 +++---- 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 ++-- 21 files changed, 120 insertions(+), 107 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e023689ee5..ac6f3171df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -938,6 +938,7 @@ 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 a264e57621..8173de350b 100644 --- a/CMakeModules/FindCLAPACK.cmake +++ b/CMakeModules/FindCLAPACK.cmake @@ -326,7 +326,7 @@ if (NOT CLAPACK_INCLUDE_DIR) endif (NOT CLAPACK_INCLUDE_DIR) if (NOT CLAPACK_INCLUDE_DIR) - set(CLAPACK_INCLUDE_DIR "${COPASI_SOURCE_DIR}") + set(CLAPACK_INCLUDE_DIR "${COPASI_SOURCE_DIR}/copasi/lapack") endif (NOT CLAPACK_INCLUDE_DIR) diff --git a/copasi/CopasiDataModel/CDataModel.cpp b/copasi/CopasiDataModel/CDataModel.cpp index 583b8ca920..625f374895 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->getActiveModelParameterSet().refreshFromModel(false); + mData.pModel->refreshActiveParameterSet(); } 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->getActiveModelParameterSet().refreshFromModel(false); + mData.pModel->refreshActiveParameterSet(); } catch (...) @@ -1203,7 +1203,6 @@ bool CDataModel::importSBML(const std::string & fileName, importer.setImportHandler(pProcessReport); importer.setImportInitialValueAnnotation(importInitialValues); - CModel * pModel = NULL; SBMLDocument * pSBMLDocument = NULL; @@ -2391,7 +2390,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; @@ -3419,7 +3418,7 @@ void CDataModel::commonAfterLoad(CProcessReport * pProcessReport, CCopasiMessage(CCopasiMessage::WARNING, validity.getIssueMessages().c_str()); } - mData.pModel->updateInitialValues(CCore::Framework::ParticleNumbers); + mData.pModel->updateInitialValues(CCore::Framework::ParticleNumbers, false); } changed(false); @@ -3466,12 +3465,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); + pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef, false); *static_cast< double * >(pRef->getValuePointer()) = value; if (isInitialConcentration) - pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef); + pRef->getObjectDataModel()->getModel()->updateInitialValues(pRef, false); return true; } @@ -3537,6 +3536,7 @@ void CDataModel::reparameterizeFromIniFile(const std::string & fileName) } getModel()->compileIfNecessary(NULL); // compile if needed + getModel()->refreshActiveParameterSet(); } const CDataObject * CDataModel::findObjectByDisplayName(const std::string & displayString) const @@ -3692,7 +3692,6 @@ const CDataObject * CDataModel::findObjectByDisplayName(const std::string & disp return NULL; } - #include #include @@ -3703,12 +3702,13 @@ 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()); @@ -3723,16 +3723,17 @@ 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()); @@ -3744,8 +3745,7 @@ CDataModel::convertReactionsToODEs() return importSBMLFromString(newSBML.c_str()); } - -bool +bool CDataModel::convertParametersToGlobal() { std::string sbml = exportSBMLToString(NULL, 3, 1); @@ -3755,6 +3755,7 @@ CDataModel::convertParametersToGlobal() 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()); diff --git a/copasi/CopasiSE/CopasiSE.cpp b/copasi/CopasiSE/CopasiSE.cpp index 9ff6e6599b..e377a44167 100644 --- a/copasi/CopasiSE/CopasiSE.cpp +++ b/copasi/CopasiSE/CopasiSE.cpp @@ -214,7 +214,8 @@ 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()); @@ -625,8 +626,8 @@ int exportParametersToIniFile() if (!pDataModel || !pDataModel->getModel()) return -2; - pDataModel->getModel()->getActiveModelParameterSet(). - saveToStream(fs, CCore::Framework::Concentration, "ini", ""); + pDataModel->getModel()->refreshActiveParameterSet(); + pDataModel->getModel()->getActiveModelParameterSet().saveToStream(fs, CCore::Framework::Concentration, "ini", ""); fs.close(); diff --git a/copasi/UI/CQParameterOverviewWidget.cpp b/copasi/UI/CQParameterOverviewWidget.cpp index d6a8218247..4c106e0414 100644 --- a/copasi/UI/CQParameterOverviewWidget.cpp +++ b/copasi/UI/CQParameterOverviewWidget.cpp @@ -399,10 +399,11 @@ void CQParameterOverviewWidget::slotBtnNew() if (answer == QMessageBox::Save) { // Save the parameter set to a new or existing set + pModel->refreshActiveParameterSet(); saveParameterSet(&pModel->getActiveModelParameterSet()); } - // TODO CRITICAL We need to record all changes to the model + // 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 bb9d707db4..f91dce5bae 100644 --- a/copasi/UI/CQParameterSetsDM.cpp +++ b/copasi/UI/CQParameterSetsDM.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the +// 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. @@ -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->getActiveModelParameterSet(), NULL, false); + CModelParameterSet * pNew = new CModelParameterSet(pModel, NULL); pNew->setObjectName(TO_UTF8(Name)); mpListOfParameterSets->add(pNew, true); ++mFetched; diff --git a/copasi/model/CCompartment.cpp b/copasi/model/CCompartment.cpp index aa74a5db08..a59d19576e 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)); + mpModel->updateInitialValues(CCore::FrameworkNames.toEnum(Data.getProperty(CData::FRAMEWORK).toString(), CCore::Framework::ParticleNumbers), false); changes.add({CUndoData::Type::CHANGE, "State", mpModel->getStringCN(), mpModel->getStringCN()}); } diff --git a/copasi/model/CModel.cpp b/copasi/model/CModel.cpp index 975d5edf4d..c2ac87e350 100644 --- a/copasi/model/CModel.cpp +++ b/copasi/model/CModel.cpp @@ -1307,32 +1307,9 @@ CModelParameterSet & CModel::getActiveModelParameterSet() return mParameterSet; } -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); + mParameterSet.createFromModel(); } CDataVectorN < CEvent > & CModel::getEvents() @@ -1780,7 +1757,7 @@ bool CModel::setQuantityUnit(const std::string & name, mNumber2QuantityFactor = 1.0 / mQuantity2NumberFactor; - updateInitialValues(framework); + updateInitialValues(framework, false); return true; } diff --git a/copasi/model/CModel.h b/copasi/model/CModel.h index ae3fa62345..28f52e2107 100644 --- a/copasi/model/CModel.h +++ b/copasi/model/CModel.h @@ -325,11 +325,6 @@ 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 */ @@ -511,7 +506,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 @@ -1036,7 +1031,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 @@ -1049,7 +1044,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 725cb112a7..ffe4dab4c8 100644 --- a/copasi/model/CModelParameterSet.cpp +++ b/copasi/model/CModelParameterSet.cpp @@ -203,6 +203,41 @@ 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() { @@ -299,7 +334,8 @@ bool CModelParameterSet::setObjectParent(const CDataContainer * pParent) { bool success = CDataObject::setObjectParent(pParent); - mpModel = dynamic_cast< CModel * >(getObjectAncestor("Model")); + if (mpModel == nullptr) + mpModel = dynamic_cast< CModel * >(getObjectAncestor("Model")); return success; } @@ -464,7 +500,7 @@ bool CModelParameterSet::updateModel() bool success = CModelParameterGroup::updateModel(); - mpModel->updateInitialValues(CCore::Framework::ParticleNumbers); + mpModel->updateInitialValues(CCore::Framework::ParticleNumbers, true); return success; } diff --git a/copasi/model/CModelParameterSet.h b/copasi/model/CModelParameterSet.h index 31f1a7f28f..af33f59ea6 100644 --- a/copasi/model/CModelParameterSet.h +++ b/copasi/model/CModelParameterSet.h @@ -100,6 +100,14 @@ 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/optimization/COptMethodPS.cpp b/copasi/optimization/COptMethodPS.cpp index b62b866ef6..ac6ed95372 100644 --- a/copasi/optimization/COptMethodPS.cpp +++ b/copasi/optimization/COptMethodPS.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the +// 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. @@ -104,7 +104,7 @@ C_FLOAT64 COptMethodPS::evaluate() // evaluate the fitness if (!pOptProblem->calculate()) -#pragma omp critical +#pragma omp critical (ps_evaluate_continue) mContinue = false; C_FLOAT64 EvaluationValue; @@ -117,7 +117,7 @@ C_FLOAT64 COptMethodPS::evaluate() if (mProblemContext.isThread(&pOptProblem)) { -#pragma omp critical +#pragma omp critical (ps_evaluate_increment_counters) mProblemContext.master()->incrementCounters(pOptProblem->getCounters()); pOptProblem->resetCounters(); @@ -198,7 +198,7 @@ bool COptMethodPS::move(const size_t & index) { Improved = true; -#pragma omp critical +#pragma omp critical (ps_move_best_value) { 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 +#pragma omp critical (ps_create_best_value) { // and store that value mBestIndex = index; diff --git a/copasi/plotUI/CQMarchingSquares.cpp b/copasi/plotUI/CQMarchingSquares.cpp index 40cb84b9d9..56b78b419c 100644 --- a/copasi/plotUI/CQMarchingSquares.cpp +++ b/copasi/plotUI/CQMarchingSquares.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2023 - 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. @@ -7,7 +7,6 @@ #if defined(COPASI_USE_QCUSTOMPLOT) - void CQMarchingSquares::levelPaths::openPoligon(double x, double y) { _current.push_back(QPointF(x, y)); @@ -86,6 +85,8 @@ QPointF CQMarchingSquares::IsoCell::normalizedPointCCW(side cellSide) case TOP: return QPointF(_top, 1); } + + return QPointF(); } /** diff --git a/copasi/sbml/SBMLImporter.cpp b/copasi/sbml/SBMLImporter.cpp index 040dd3ba09..6b936d1d42 100644 --- a/copasi/sbml/SBMLImporter.cpp +++ b/copasi/sbml/SBMLImporter.cpp @@ -2568,7 +2568,7 @@ SBMLImporter::createCReactionFromReaction(Reaction* sbmlReaction, Model* pSBMLMo if (pNonconstFun->getInfix() == "@") { - // set infix to something more usable which even though + // set infix to something more usable which even though // invalid, may help others to fix this pNonconstFun->setInfix(SBML_formulaToL3String(kLawMath)); } @@ -6217,7 +6217,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); + pModel->updateInitialValues(mChangedObjects, false); return true; } diff --git a/copasi/sedml/SEDMLImporter.cpp b/copasi/sedml/SEDMLImporter.cpp index 522b6492ae..068cef844f 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()); + mpCopasiModel->updateInitialValues(mpCopasiModel->getInitialValueReference(), false); } 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,6 +1608,7 @@ 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/xml/CCopasiXML.cpp b/copasi/xml/CCopasiXML.cpp index aa869c8dbe..6524be2417 100644 --- a/copasi/xml/CCopasiXML.cpp +++ b/copasi/xml/CCopasiXML.cpp @@ -1123,7 +1123,10 @@ 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); @@ -1132,8 +1135,6 @@ 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 42ea68f28e..a16d742c29 100644 --- a/copasi/xml/parser/ModelHandler.cpp +++ b/copasi/xml/parser/ModelHandler.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the +// 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. @@ -207,6 +207,7 @@ 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 c3420cd1a9..7f99056fca 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); + model->updateInitialValues(CCore::Framework::Concentration, false); model->applyInitialValues(); REQUIRE(x.getInitialValue() == 1); @@ -135,7 +135,6 @@ TEST_CASE("Update Model", "[COPASI]") CRootContainer::removeDatamodel(dm); } - TEST_CASE("Species ODE expressions", "[COPASI][multiple_models]") { CDataModel * dm = CRootContainer::addDatamodel(); @@ -156,7 +155,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 a78e96ca19..7b6c48507b 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()); + dm->getModel()->updateInitialValues(dm->getModel()->getInitialValueReference(), false); dm->getModel()->forceCompile(NULL); dm->getModel()->applyInitialValues(); @@ -127,7 +127,6 @@ 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(); @@ -140,7 +139,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 16e68cc8d8..b6e571b040 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()); + model->updateInitialValues(metab.getInitialConcentrationReference(), false); metab.setInitialConcentration(0.4); - model->updateInitialValues(metab.getInitialConcentrationReference()); + model->updateInitialValues(metab.getInitialConcentrationReference(), false); } // retrieve metab again -for (auto & metab : model->getMetabolites()) + for (auto & metab : model->getMetabolites()) { if (metab.getObjectDisplayName() != "speciesB") continue; @@ -255,7 +255,6 @@ 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(); @@ -280,7 +279,7 @@ TEST_CASE("set up opt problem subtype", "[copasi][optimization]") REQUIRE(problem != NULL); REQUIRE((problem->getSubtaskType() == CTaskEnum::Task::timeCourse)); } - + CRootContainer::removeDatamodel(dm); } @@ -304,11 +303,9 @@ 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(); @@ -344,7 +341,6 @@ TEST_CASE("manually create miriam using libsbml", "[copasi][miriam]") #ifdef COPASI_USE_RAPTOR - #include #include #include @@ -376,12 +372,11 @@ 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); @@ -401,12 +396,10 @@ 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 eb0c86628e..2a2d78122a 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()); + model->updateInitialValues(model->getInitialValueReference(), false); 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()); + model->updateInitialValues(model->getInitialValueReference(), false); // also reset the task values, to see that hey are updated correctly problem->setDuration(1); problem->setStepNumber(10); @@ -67,7 +67,6 @@ 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(); @@ -316,7 +315,6 @@ TEST_CASE("importing document with remote model should fail", "[copasi][sedml]") auto sedml = writeSedMLToStdString(doc); delete doc; - auto * dm = CRootContainer::addDatamodel(); REQUIRE(dm != nullptr); From 587568e13306e60b1701275061c43f923e17e215 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Thu, 14 Nov 2024 12:04:06 -0500 Subject: [PATCH 38/54] Fixed loading SBML broken after previous commit. --- copasi/CopasiDataModel/CDataModel.cpp | 5 ----- copasi/sbml/SBMLImporter.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/copasi/CopasiDataModel/CDataModel.cpp b/copasi/CopasiDataModel/CDataModel.cpp index 625f374895..f12882329e 100644 --- a/copasi/CopasiDataModel/CDataModel.cpp +++ b/copasi/CopasiDataModel/CDataModel.cpp @@ -3362,11 +3362,6 @@ 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 diff --git a/copasi/sbml/SBMLImporter.cpp b/copasi/sbml/SBMLImporter.cpp index 6b936d1d42..fdf3f72e1a 100644 --- a/copasi/sbml/SBMLImporter.cpp +++ b/copasi/sbml/SBMLImporter.cpp @@ -6217,7 +6217,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, false); + pModel->updateInitialValues(mChangedObjects, true); return true; } From 2a6f02e736edf7330f9b8f2c27496e769763dd3a Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Thu, 14 Nov 2024 15:18:58 -0500 Subject: [PATCH 39/54] Bug 3268: Added message error in command, warning in UI on failure. --- copasi/steadystate/CSteadyStateMethod.cpp | 4 +++- copasi/utilities/messages.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/copasi/steadystate/CSteadyStateMethod.cpp b/copasi/steadystate/CSteadyStateMethod.cpp index e78cf583fe..c5cd9d66a4 100644 --- a/copasi/steadystate/CSteadyStateMethod.cpp +++ b/copasi/steadystate/CSteadyStateMethod.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the +// 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. @@ -167,6 +167,8 @@ CSteadyStateMethod::returnProcess(bool steadyStateFound) if (!steadyStateFound) { mSteadyState = mStartState; + + CCopasiMessage(CCopasiMessage::COMMANDLINE, MCSteadyState + 2); return CSteadyStateMethod::notFound; } diff --git a/copasi/utilities/messages.h b/copasi/utilities/messages.h index 2bc1a6ef7d..34c62d96c4 100644 --- a/copasi/utilities/messages.h +++ b/copasi/utilities/messages.h @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the +// 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. @@ -377,6 +377,7 @@ 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. " From 8ac052f24b9a57aa8f5aa775c6983c2dd9199742 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 10:00:18 +0100 Subject: [PATCH 40/54] - allow to specify sbml level / version --- copasi/UI/CQExternalTools.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/copasi/UI/CQExternalTools.cpp b/copasi/UI/CQExternalTools.cpp index cdc4cf4585..1ffa6ea287 100644 --- a/copasi/UI/CQExternalTools.cpp +++ b/copasi/UI/CQExternalTools.cpp @@ -317,10 +317,18 @@ void CQExternalTool::execute() arg = cpsFile; } - if (arg == "$sbmlFile") + 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, 3, 1); + auto sbml = dm->exportSBMLToString(NULL, sbmlLevel, sbmlVersion); QFile file(sbmlFile); if (file.open(QIODevice::WriteOnly)) From 726b3d3cffb0d37d6681f2106264bb0b793d9d62 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 10:00:38 +0100 Subject: [PATCH 41/54] - allow exporting l3v2 --- copasi/UI/CQSBMLFileDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copasi/UI/CQSBMLFileDialog.cpp b/copasi/UI/CQSBMLFileDialog.cpp index bddb3ec92b..8c35a134b8 100644 --- a/copasi/UI/CQSBMLFileDialog.cpp +++ b/copasi/UI/CQSBMLFileDialog.cpp @@ -46,7 +46,8 @@ 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 1 (*.xml);;" + "Level 3 Version 2 (*.xml)"; QString SelectedFilter = QString("Level %1 Version %2 (*.xml)").arg(QString::number(sbmlLevel)).arg(QString::number(sbmlVersion));; From de3e7c0ea12e1f9fdf5c0d5ae8cb384efe07616b Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 10:01:03 +0100 Subject: [PATCH 42/54] - export max / min / rem in l3v2 --- copasi/function/CEvaluationNode.cpp | 2 +- copasi/function/CEvaluationNode.h | 2 +- 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 | 89 +++++++++++++------ copasi/function/CEvaluationNodeFunction.h | 2 +- copasi/function/CEvaluationNodeLogical.cpp | 6 +- copasi/function/CEvaluationNodeLogical.h | 2 +- copasi/function/CEvaluationNodeNumber.cpp | 2 +- copasi/function/CEvaluationNodeNumber.h | 2 +- copasi/function/CEvaluationNodeObject.cpp | 4 +- copasi/function/CEvaluationNodeObject.h | 2 +- copasi/function/CEvaluationNodeOperator.cpp | 47 ++++++---- copasi/function/CEvaluationNodeOperator.h | 6 +- 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/CEvaluationTree.cpp | 4 +- copasi/function/CEvaluationTree.h | 2 +- copasi/sbml/CSBMLExporter.cpp | 2 +- 33 files changed, 134 insertions(+), 86 deletions(-) diff --git a/copasi/function/CEvaluationNode.cpp b/copasi/function/CEvaluationNode.cpp index 6c53afa5c1..1533063786 100644 --- a/copasi/function/CEvaluationNode.cpp +++ b/copasi/function/CEvaluationNode.cpp @@ -587,7 +587,7 @@ CEvaluationNode* CEvaluationNode::simplifyNode(const std::vector * Create a new invalid ASTNode. * @return ASTNode* return a pointer to the newly created node; */ - virtual ASTNode* toAST(const CDataModel* pDataModel) const; + virtual ASTNode* toAST(const CDataModel* pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Copy a node and assign new children child1 and child2 diff --git a/copasi/function/CEvaluationNodeCall.cpp b/copasi/function/CEvaluationNodeCall.cpp index d98d9507b9..63849760b3 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) const +ASTNode * CEvaluationNodeCall::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const { ASTNode* pNode = NULL; @@ -479,7 +479,7 @@ ASTNode* CEvaluationNodeCall::toAST(const CDataModel* pDataModel) const while (child) { - pNode->addChild(child->toAST(pDataModel)); + pNode->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); child = static_cast(child->getSibling()); } diff --git a/copasi/function/CEvaluationNodeCall.h b/copasi/function/CEvaluationNodeCall.h index 7230bd7013..2505c131c6 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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Add a child to a node. diff --git a/copasi/function/CEvaluationNodeChoice.cpp b/copasi/function/CEvaluationNodeChoice.cpp index 2f96352a3b..b911d48f64 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) const +ASTNode * CEvaluationNodeChoice::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) 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) const 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)); - node->addChild(child1->toAST(pDataModel)); - node->addChild(child3->toAST(pDataModel)); + node->addChild(child2->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child1->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child3->toAST(pDataModel, sbmlLevel, sbmlVersion)); return node; } diff --git a/copasi/function/CEvaluationNodeChoice.h b/copasi/function/CEvaluationNodeChoice.h index 5b006b3310..0f0686067c 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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeConstant.cpp b/copasi/function/CEvaluationNodeConstant.cpp index 84433dc906..aff8ac6c0d 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*/) const +ASTNode* CEvaluationNodeConstant::toAST(const CDataModel* /*pDataModel*/, int, int) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); diff --git a/copasi/function/CEvaluationNodeConstant.h b/copasi/function/CEvaluationNodeConstant.h index a0573947f3..fef50760bf 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) const; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeDelay.cpp b/copasi/function/CEvaluationNodeDelay.cpp index c4a74c50b5..56997f9579 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) const +ASTNode * CEvaluationNodeDelay::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion ) const { ASTNode* pNode = new ASTNode(AST_FUNCTION_DELAY); const CEvaluationNode* child = static_cast(this->getChild()); while (child) { - pNode->addChild(child->toAST(pDataModel)); + pNode->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); child = static_cast(child->getSibling()); } diff --git a/copasi/function/CEvaluationNodeDelay.h b/copasi/function/CEvaluationNodeDelay.h index c300a1c2de..1c3d09dce1 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) const override; + ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeFunction.cpp b/copasi/function/CEvaluationNodeFunction.cpp index 0835705aba..2a7ec9a771 100644 --- a/copasi/function/CEvaluationNodeFunction.cpp +++ b/copasi/function/CEvaluationNodeFunction.cpp @@ -918,6 +918,7 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con std::string data = ""; bool allowTwo = false; + bool allowN = false; if (type == AST_FUNCTION_ROOT) { @@ -1144,12 +1145,14 @@ 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: @@ -1158,7 +1161,7 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con break; } - if (!allowTwo) + if (!allowTwo && !allowN) { assert(iMax == 1); } @@ -1167,16 +1170,20 @@ CEvaluationNode * CEvaluationNodeFunction::fromAST(const ASTNode * pASTNode, con if (!children.empty()) { - pNode->addChild(children[0]); + int maxChildren = + allowN ? children.size() : allowTwo ? 2 + : 1; - if (allowTwo) - pNode->addChild(children[1]); + for (int i = 0; i < maxChildren; ++i) + { + pNode->addChild(children[i]); + } } return pNode; } -ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const +ASTNode * CEvaluationNodeFunction::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); @@ -1333,7 +1340,7 @@ ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const // the node will be replaced by its only child needFirstArg = false; delete node; - node = dynamic_cast(this->getChild())->toAST(pDataModel); + node = dynamic_cast(this->getChild())->toAST(pDataModel, sbmlLevel, sbmlVersion); break; case SubType::NOT: @@ -1347,8 +1354,8 @@ ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const node->setName("RUNIFORM"); const CEvaluationNode* child = dynamic_cast(this->getChild()); const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); - node->addChild(child->toAST(pDataModel)); - node->addChild(sibling->toAST(pDataModel)); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); } break; @@ -1359,8 +1366,8 @@ ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const node->setName("RNORMAL"); const CEvaluationNode* child = dynamic_cast(this->getChild()); const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); - node->addChild(child->toAST(pDataModel)); - node->addChild(sibling->toAST(pDataModel)); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); } break; @@ -1371,8 +1378,8 @@ ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const node->setName("RGAMMA"); const CEvaluationNode* child = dynamic_cast(this->getChild()); const CEvaluationNode* sibling = dynamic_cast(child->getSibling()); - node->addChild(child->toAST(pDataModel)); - node->addChild(sibling->toAST(pDataModel)); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(sibling->toAST(pDataModel, sbmlLevel, sbmlVersion)); } break; @@ -1382,31 +1389,57 @@ ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const node->setType(AST_FUNCTION); node->setName("RPOISSON"); const CEvaluationNode* child = dynamic_cast(this->getChild()); - node->addChild(child->toAST(pDataModel)); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); } break; case SubType::MAX: - { - 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)); + { + 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)); + } } break; case SubType::MIN: { needFirstArg = false; - 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)); + 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)); + } } break; // :TODO: Bug 894: Implement me. @@ -1432,7 +1465,7 @@ ASTNode* CEvaluationNodeFunction::toAST(const CDataModel* pDataModel) const if (needFirstArg) { const CEvaluationNode* child = dynamic_cast(this->getChild()); - node->addChild(child->toAST(pDataModel)); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); } } diff --git a/copasi/function/CEvaluationNodeFunction.h b/copasi/function/CEvaluationNodeFunction.h index 4d3cf088e2..5f4ff05b52 100644 --- a/copasi/function/CEvaluationNodeFunction.h +++ b/copasi/function/CEvaluationNodeFunction.h @@ -180,7 +180,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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Create a simplified node for an operatorNode with children from vector (if not exist, = NULL), diff --git a/copasi/function/CEvaluationNodeLogical.cpp b/copasi/function/CEvaluationNodeLogical.cpp index 94a88cd14d..f4c0bc57eb 100644 --- a/copasi/function/CEvaluationNodeLogical.cpp +++ b/copasi/function/CEvaluationNodeLogical.cpp @@ -603,7 +603,7 @@ CEvaluationNode * CEvaluationNodeLogical::fromAST(const ASTNode * pASTNode, cons return pNode; } -ASTNode* CEvaluationNodeLogical::toAST(const CDataModel* pDataModel) const +ASTNode * CEvaluationNodeLogical::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); @@ -658,8 +658,8 @@ ASTNode* CEvaluationNodeLogical::toAST(const CDataModel* pDataModel) const { const CEvaluationNode* child1 = dynamic_cast(this->getChild()); const CEvaluationNode* child2 = dynamic_cast(child1->getSibling()); - node->addChild(child1->toAST(pDataModel)); - node->addChild(child2->toAST(pDataModel)); + node->addChild(child1->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child2->toAST(pDataModel, sbmlLevel, sbmlVersion)); } return node; diff --git a/copasi/function/CEvaluationNodeLogical.h b/copasi/function/CEvaluationNodeLogical.h index 4e501cf3bd..c8ffeb5830 100644 --- a/copasi/function/CEvaluationNodeLogical.h +++ b/copasi/function/CEvaluationNodeLogical.h @@ -189,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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeNumber.cpp b/copasi/function/CEvaluationNodeNumber.cpp index d666573d3d..fab14323fa 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 */) const +ASTNode* CEvaluationNodeNumber::toAST(const CDataModel* /* pDataModel */, int, int) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); diff --git a/copasi/function/CEvaluationNodeNumber.h b/copasi/function/CEvaluationNodeNumber.h index 67504aa9a5..a22e666180 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) const; + ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeObject.cpp b/copasi/function/CEvaluationNodeObject.cpp index 724dc509a1..dcb6943e50 100644 --- a/copasi/function/CEvaluationNodeObject.cpp +++ b/copasi/function/CEvaluationNodeObject.cpp @@ -444,7 +444,7 @@ CEvaluationNode * CEvaluationNodeObject::fromAST(const ASTNode * pASTNode, const return pNode; } -ASTNode* CEvaluationNodeObject::toAST(const CDataModel* pDataModel) const +ASTNode * CEvaluationNodeObject::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const { ASTNode* node = new ASTNode(); node->setType(AST_NAME); @@ -461,7 +461,7 @@ ASTNode* CEvaluationNodeObject::toAST(const CDataModel* pDataModel) const if (sibling == NULL) fatalError(); node->setName(sibling->getObjectCN().c_str()); - node->addChild(child->toAST(pDataModel)); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); return node; } diff --git a/copasi/function/CEvaluationNodeObject.h b/copasi/function/CEvaluationNodeObject.h index 7ba323035d..9e09757e17 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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Retrieve the CN of the referred object. diff --git a/copasi/function/CEvaluationNodeOperator.cpp b/copasi/function/CEvaluationNodeOperator.cpp index cc7e3f8e36..620db74c6d 100644 --- a/copasi/function/CEvaluationNodeOperator.cpp +++ b/copasi/function/CEvaluationNodeOperator.cpp @@ -456,6 +456,12 @@ CEvaluationNode * CEvaluationNodeOperator::fromAST(const ASTNode * pASTNode, con data = "quot"; break; + case AST_FUNCTION_REM: + subType = SubType::REMAINDER; + data = "%"; + break; + + default: subType = SubType::INVALID; fatalError(); @@ -534,10 +540,11 @@ CEvaluationNode * CEvaluationNodeOperator::fromAST(const ASTNode * pASTNode, con return pNode; } -ASTNode* CEvaluationNodeOperator::toAST(const CDataModel* pDataModel) const +ASTNode * CEvaluationNodeOperator::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const { SubType subType = (SubType)this->subType(); ASTNode* node = new ASTNode(); + bool skipChildren = false; switch (subType) { @@ -556,7 +563,15 @@ ASTNode* CEvaluationNodeOperator::toAST(const CDataModel* pDataModel) const case SubType::MODULUS: case SubType::REMAINDER: // replace this with a more complex subtree - CEvaluationNodeOperator::createModuloTree(this, node, pDataModel); + if (sbmlLevel == 3 && sbmlVersion > 1) + { + node->setType(AST_FUNCTION_REM); + } + else + { + CEvaluationNodeOperator::createModuloTree(this, node, pDataModel, sbmlLevel, sbmlVersion); + skipChildren = true; + } break; case SubType::QUOTIENT: @@ -576,12 +591,12 @@ ASTNode* CEvaluationNodeOperator::toAST(const CDataModel* pDataModel) const } // for all but S_INVALID and S_MODULUS two children have to be converted - if (subType != SubType::INVALID && subType != SubType::MODULUS) + if (subType != SubType::INVALID && !skipChildren) { const CEvaluationNode* child1 = dynamic_cast(this->getChild()); const CEvaluationNode* child2 = dynamic_cast(child1->getSibling()); - node->addChild(child1->toAST(pDataModel)); - node->addChild(child2->toAST(pDataModel)); + node->addChild(child1->toAST(pDataModel, sbmlLevel, sbmlVersion)); + node->addChild(child2->toAST(pDataModel, sbmlLevel, sbmlVersion)); } return node; @@ -1444,7 +1459,7 @@ CEvaluationNode* CEvaluationNodeOperator::simplifyNode(const std::vectorsetType(AST_MINUS); ASTNode* tmpASTNode = new ASTNode(AST_DIVIDE); - tmpASTNode->addChild(x->toAST(pDataModel)); - tmpASTNode->addChild(y->toAST(pDataModel)); + tmpASTNode->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); ASTNode* tmpASTNode2 = new ASTNode(AST_FUNCTION_CEILING); tmpASTNode2->addChild(tmpASTNode); tmpASTNode = new ASTNode(AST_TIMES); - tmpASTNode->addChild(y->toAST(pDataModel)); + tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); tmpASTNode->addChild(tmpASTNode2); - pASTNodeTrue->addChild(x->toAST(pDataModel)); + pASTNodeTrue->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); pASTNodeTrue->addChild(tmpASTNode); pASTNode->addChild(pASTNodeTrue); // now comes the condition @@ -1489,7 +1504,7 @@ bool CEvaluationNodeOperator::createModuloTree(const CEvaluationNodeOperator* pN // < tmpASTNode = new ASTNode(AST_RELATIONAL_LT); // x - tmpASTNode->addChild(x->toAST(pDataModel)); + tmpASTNode->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); // 0 tmpASTNode2 = new ASTNode(AST_INTEGER); tmpASTNode2->setValue(0); @@ -1499,7 +1514,7 @@ bool CEvaluationNodeOperator::createModuloTree(const CEvaluationNodeOperator* pN // < tmpASTNode = new ASTNode(AST_RELATIONAL_LT); // y - tmpASTNode->addChild(y->toAST(pDataModel)); + tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); // 0 tmpASTNode2 = new ASTNode(AST_INTEGER); tmpASTNode2->setValue(0); @@ -1511,14 +1526,14 @@ bool CEvaluationNodeOperator::createModuloTree(const CEvaluationNodeOperator* pN ASTNode* pASTNodeFalse = new ASTNode(); pASTNodeFalse->setType(AST_MINUS); tmpASTNode = new ASTNode(AST_DIVIDE); - tmpASTNode->addChild(x->toAST(pDataModel)); - tmpASTNode->addChild(y->toAST(pDataModel)); + tmpASTNode->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); + tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); tmpASTNode2 = new ASTNode(AST_FUNCTION_FLOOR); tmpASTNode2->addChild(tmpASTNode); tmpASTNode = new ASTNode(AST_TIMES); - tmpASTNode->addChild(y->toAST(pDataModel)); + tmpASTNode->addChild(y->toAST(pDataModel, sbmlLevel, sbmlVersion)); tmpASTNode->addChild(tmpASTNode2); - pASTNodeFalse->addChild(x->toAST(pDataModel)); + pASTNodeFalse->addChild(x->toAST(pDataModel, sbmlLevel, sbmlVersion)); pASTNodeFalse->addChild(tmpASTNode); pASTNode->addChild(pASTNodeFalse); result = true; diff --git a/copasi/function/CEvaluationNodeOperator.h b/copasi/function/CEvaluationNodeOperator.h index d9d0af15f5..7bca163ab7 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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) 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 sucessfull conversion. + * @return bool which is true on successful conversion. */ - bool createModuloTree(const CEvaluationNodeOperator* pNode, ASTNode* pASTNode, const CDataModel* pDataModel) const; + bool createModuloTree(const CEvaluationNodeOperator * pNode, ASTNode * pASTNode, const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeStructure.cpp b/copasi/function/CEvaluationNodeStructure.cpp index 2c7490004d..73f924b456 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*/) const +ASTNode* CEvaluationNodeStructure::toAST(const CDataModel* /*pDataModel*/, int, int) const { fatalError(); return NULL; diff --git a/copasi/function/CEvaluationNodeStructure.h b/copasi/function/CEvaluationNodeStructure.h index ff10f5e2c6..b64a159100 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) const; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; }; #endif // COPASI_CEvaluationNodeStructure diff --git a/copasi/function/CEvaluationNodeUnit.cpp b/copasi/function/CEvaluationNodeUnit.cpp index 5f35a0671f..02ae0cc611 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) const +ASTNode* CEvaluationNodeUnit::toAST(const CDataModel* pDataModel, int, int) const { // TODO CRITICAL Implement me! fatalError(); diff --git a/copasi/function/CEvaluationNodeUnit.h b/copasi/function/CEvaluationNodeUnit.h index ee3a9e9c25..dc7b9806fe 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) const; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeVariable.cpp b/copasi/function/CEvaluationNodeVariable.cpp index 6b10020a56..1ddc9ba49b 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*/) const +ASTNode* CEvaluationNodeVariable::toAST(const CDataModel* /*pDataModel*/, int, int) const { ASTNode* node = new ASTNode(); node->setType(AST_NAME); diff --git a/copasi/function/CEvaluationNodeVariable.h b/copasi/function/CEvaluationNodeVariable.h index e26963b3fa..5c1239ca5a 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) const override; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const override; /** * Build the MathML string diff --git a/copasi/function/CEvaluationNodeVector.cpp b/copasi/function/CEvaluationNodeVector.cpp index f18e432c52..814f280025 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*/) const +ASTNode* CEvaluationNodeVector::toAST(const CDataModel* /*pDataModel*/, int, int) const { // :TODO: ASTNode* node = new ASTNode(AST_FUNCTION_PIECEWISE); diff --git a/copasi/function/CEvaluationNodeVector.h b/copasi/function/CEvaluationNodeVector.h index e2e2239085..ba1095b9f5 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) const; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Add a child to a node. diff --git a/copasi/function/CEvaluationNodeWhiteSpace.cpp b/copasi/function/CEvaluationNodeWhiteSpace.cpp index 536a57b497..41cd0d47f1 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*/) const +ASTNode* CEvaluationNodeWhiteSpace::toAST(const CDataModel* /*pDataModel*/, int, int) const { fatalError(); return NULL; diff --git a/copasi/function/CEvaluationNodeWhiteSpace.h b/copasi/function/CEvaluationNodeWhiteSpace.h index 1e9faafbed..4e5ddec0e7 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) const; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; }; #endif // COPASI_CEvaluationNodeWhiteSpace diff --git a/copasi/function/CEvaluationTree.cpp b/copasi/function/CEvaluationTree.cpp index 8bf2c87053..7f18a2594c 100644 --- a/copasi/function/CEvaluationTree.cpp +++ b/copasi/function/CEvaluationTree.cpp @@ -836,9 +836,9 @@ void CEvaluationTree::initObjects() addObjectReference("Value", mValue); } -ASTNode* CEvaluationTree::toAST(const CDataModel* pDataModel) const +ASTNode * CEvaluationTree::toAST(const CDataModel * pDataModel, int sbmlLevel, int sbmlVersion) const { - return mpRootNode->toAST(pDataModel); + return mpRootNode->toAST(pDataModel, sbmlLevel, sbmlVersion); } bool CEvaluationTree::hasCircularDependency() const diff --git a/copasi/function/CEvaluationTree.h b/copasi/function/CEvaluationTree.h index 7f540fce35..4f559f91ca 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) const; + virtual ASTNode * toAST(const CDataModel * pDataModel, int sbmlLevel = 3, int sbmlVersion = 1) const; /** * Set the infix description of the tree and compile it. diff --git a/copasi/sbml/CSBMLExporter.cpp b/copasi/sbml/CSBMLExporter.cpp index 6ce94c44f8..38db6bed80 100644 --- a/copasi/sbml/CSBMLExporter.cpp +++ b/copasi/sbml/CSBMLExporter.cpp @@ -7324,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); + ASTNode* pResult = pOrig->toAST(&dataModel, mSBMLLevel, mSBMLVersion); adjustNames(pResult, mpSBMLDocument, mIdMap); From 230e17d5f6a38a19d13e21af1bfffbeb57a7823b Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 10:22:52 +0100 Subject: [PATCH 43/54] - export rateOf as L3V2 symbol --- copasi/function/CEvaluationNodeObject.cpp | 24 ++++++++++++++++------- copasi/sbml/CSBMLExporter.cpp | 4 ++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/copasi/function/CEvaluationNodeObject.cpp b/copasi/function/CEvaluationNodeObject.cpp index dcb6943e50..bf868ab0f2 100644 --- a/copasi/function/CEvaluationNodeObject.cpp +++ b/copasi/function/CEvaluationNodeObject.cpp @@ -451,17 +451,27 @@ ASTNode * CEvaluationNodeObject::toAST(const CDataModel * pDataModel, int sbmlLe if (mRegisteredObjectCN == "rateOf" || mData == "") { - node->setType(AST_FUNCTION); - const CEvaluationNode* child = dynamic_cast(this->getChild()); + const CEvaluationNode * child = dynamic_cast< const CEvaluationNode * >(this->getChild()); + if (child == NULL) + fatalError(); - if (child == NULL) fatalError(); + if (sbmlLevel == 3 && sbmlVersion > 1) + { + node->setType(AST_FUNCTION_RATE_OF); + node->addChild(child->toAST(pDataModel, sbmlLevel, sbmlVersion)); + } + else + { + node->setType(AST_FUNCTION); - const CEvaluationNodeObject* sibling = dynamic_cast(this->getChild()->getSibling()); + const CEvaluationNodeObject * sibling = dynamic_cast< const CEvaluationNodeObject * >(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, sbmlLevel, sbmlVersion)); + } return node; } diff --git a/copasi/sbml/CSBMLExporter.cpp b/copasi/sbml/CSBMLExporter.cpp index 38db6bed80..bb8acf2678 100644 --- a/copasi/sbml/CSBMLExporter.cpp +++ b/copasi/sbml/CSBMLExporter.cpp @@ -168,6 +168,10 @@ 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", From 1fa67c7b77f72c121cfa1d156703abea48b95b92 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 10:23:14 +0100 Subject: [PATCH 44/54] - only display warning message about Delays when we actually have delays --- copasi/sbml/SBMLImporter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/copasi/sbml/SBMLImporter.cpp b/copasi/sbml/SBMLImporter.cpp index fdf3f72e1a..62822dc87f 100644 --- a/copasi/sbml/SBMLImporter.cpp +++ b/copasi/sbml/SBMLImporter.cpp @@ -3572,8 +3572,6 @@ SBMLImporter::preprocessNode(ConverterASTNode * pNode, Model * pSBMLModel, mReactionsWithReplacedLocalParameters.insert(pSBMLReaction->getId()); } } - - this->mDelayFound = result; } this->replaceCallNodeNames(pNode); @@ -3783,6 +3781,7 @@ 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; } From d07b480b43fb83a28a1df6498efd964d5cbb22ee Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 14:00:35 +0100 Subject: [PATCH 45/54] - fix import of quotient --- copasi/function/CEvaluationNodeOperator.cpp | 2 +- copasi/function/CEvaluationTree.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/copasi/function/CEvaluationNodeOperator.cpp b/copasi/function/CEvaluationNodeOperator.cpp index 620db74c6d..67b8f60ae7 100644 --- a/copasi/function/CEvaluationNodeOperator.cpp +++ b/copasi/function/CEvaluationNodeOperator.cpp @@ -494,7 +494,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) + else if (type == AST_DIVIDE || type == AST_POWER || type == AST_FUNCTION_POWER || type == AST_FUNCTION_REM || type == AST_FUNCTION_QUOTIENT) { switch (pASTNode->getNumChildren()) { diff --git a/copasi/function/CEvaluationTree.cpp b/copasi/function/CEvaluationTree.cpp index 7f18a2594c..688c0e3ed2 100644 --- a/copasi/function/CEvaluationTree.cpp +++ b/copasi/function/CEvaluationTree.cpp @@ -694,6 +694,7 @@ 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; From 67f1b3803bc6c309becec76e2502176a74e32356 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Fri, 15 Nov 2024 17:09:56 +0100 Subject: [PATCH 46/54] - fix a crash when deleting a function that is currently being used --- copasi/UI/FunctionWidget1.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/copasi/UI/FunctionWidget1.cpp b/copasi/UI/FunctionWidget1.cpp index 76c15b67f2..3331da092e 100644 --- a/copasi/UI/FunctionWidget1.cpp +++ b/copasi/UI/FunctionWidget1.cpp @@ -36,6 +36,8 @@ #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" @@ -781,6 +783,7 @@ void FunctionWidget1::slotBtnCopy() mObjectCNToCopy = mObjectCN; } + //! Slot for being activated whenever Delete button is clicked void FunctionWidget1::slotBtnDelete() { @@ -804,6 +807,36 @@ 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); From 89810fd7e6095ea2b0042fbf844c1ebecc355a38 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 18 Nov 2024 12:08:58 +0100 Subject: [PATCH 47/54] - fix an issue where elements could not be deleted by pressing the delete button in overview widgets --- copasi/UI/CQCompartmentsWidget.cpp | 6 +++--- copasi/UI/CQCompartmentsWidget.h | 2 +- copasi/UI/CQEventsWidget.cpp | 6 +++--- copasi/UI/CQEventsWidget.h | 2 +- copasi/UI/CQFunctionsWidget.cpp | 6 +++--- 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/CQParameterSetsWidget.cpp | 6 +++--- copasi/UI/CQParameterSetsWidget.h | 2 +- copasi/UI/CQReactionsWidget.cpp | 6 +++--- copasi/UI/CQReactionsWidget.h | 2 +- copasi/UI/CQReportsWidget.cpp | 6 +++--- copasi/UI/CQReportsWidget.h | 2 +- copasi/UI/CQSpeciesWidget.cpp | 6 +++--- copasi/UI/CQSpeciesWidget.h | 2 +- copasi/UI/CQUnitsWidget.cpp | 6 +++--- copasi/UI/CQUnitsWidget.h | 2 +- 20 files changed, 39 insertions(+), 39 deletions(-) diff --git a/copasi/UI/CQCompartmentsWidget.cpp b/copasi/UI/CQCompartmentsWidget.cpp index 6a46045f70..8de6a2f3f6 100644 --- a/copasi/UI/CQCompartmentsWidget.cpp +++ b/copasi/UI/CQCompartmentsWidget.cpp @@ -97,9 +97,9 @@ void CQCompartmentsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQCompartmentsWidget::slotBtnDeleteClicked() +void CQCompartmentsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblCompartments->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 50a055692f..4f6359b30f 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); 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 bed8dfb87e..9773bf5d3b 100644 --- a/copasi/UI/CQEventsWidget.cpp +++ b/copasi/UI/CQEventsWidget.cpp @@ -96,9 +96,9 @@ void CQEventsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQEventsWidget::slotBtnDeleteClicked() +void CQEventsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblEvents->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 e0f9b4413b..f4b4eb3de2 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQFunctionsWidget.cpp b/copasi/UI/CQFunctionsWidget.cpp index 8cf4d58e8d..1c2660969e 100644 --- a/copasi/UI/CQFunctionsWidget.cpp +++ b/copasi/UI/CQFunctionsWidget.cpp @@ -91,9 +91,9 @@ void CQFunctionsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQFunctionsWidget::slotBtnDeleteClicked() +void CQFunctionsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblFunctions->hasFocus()) + if (!needFocus || mpTblFunctions->hasFocus()) {deleteSelectedFunctions();} updateDeleteBtns(); @@ -249,7 +249,7 @@ void CQFunctionsWidget::slotDoubleClicked(const QModelIndex proxyIndex) void CQFunctionsWidget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Delete) - slotBtnDeleteClicked(); + slotBtnDeleteClicked(true); 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 ca50ecd88d..aaf376b15a 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); 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 06fd171fd3..faefd7e1df 100644 --- a/copasi/UI/CQGlobalQuantitiesWidget.cpp +++ b/copasi/UI/CQGlobalQuantitiesWidget.cpp @@ -96,9 +96,9 @@ void CQGlobalQuantitiesWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQGlobalQuantitiesWidget::slotBtnDeleteClicked() +void CQGlobalQuantitiesWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblGlobalQuantities->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 9bfe877fd8..5f7a1afc7b 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); 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 720da8d49b..7cedaa1d84 100644 --- a/copasi/UI/CQLayoutsWidget.cpp +++ b/copasi/UI/CQLayoutsWidget.cpp @@ -317,9 +317,9 @@ void CQLayoutsWidget::slotBtnNewClicked() } // virtual -void CQLayoutsWidget::slotBtnDeleteClicked() +void CQLayoutsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblLayouts->hasFocus()) + if (!needFocus || mpTblLayouts->hasFocus()) {deleteSelectedLayouts();} } diff --git a/copasi/UI/CQLayoutsWidget.h b/copasi/UI/CQLayoutsWidget.h index aa4fa03dda..a15c0b1e8f 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQParameterSetsWidget.cpp b/copasi/UI/CQParameterSetsWidget.cpp index 5ea06d936f..14759ce789 100644 --- a/copasi/UI/CQParameterSetsWidget.cpp +++ b/copasi/UI/CQParameterSetsWidget.cpp @@ -93,9 +93,9 @@ void CQParameterSetsWidget::slotBtnNewClicked() } } -void CQParameterSetsWidget::slotBtnDeleteClicked() +void CQParameterSetsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblParameterSets->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 b9570d4e97..54b99dbfc8 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQReactionsWidget.cpp b/copasi/UI/CQReactionsWidget.cpp index 9ca46b8288..8931cdbbca 100644 --- a/copasi/UI/CQReactionsWidget.cpp +++ b/copasi/UI/CQReactionsWidget.cpp @@ -97,9 +97,9 @@ void CQReactionsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQReactionsWidget::slotBtnDeleteClicked() +void CQReactionsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblReactions->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 79ee87d555..03767e8777 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); 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 c981f3cf50..1d28bf6a02 100644 --- a/copasi/UI/CQReportsWidget.cpp +++ b/copasi/UI/CQReportsWidget.cpp @@ -84,9 +84,9 @@ void CQReportsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQReportsWidget::slotBtnDeleteClicked() +void CQReportsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblReports->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 d11a42a41d..7426256476 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); diff --git a/copasi/UI/CQSpeciesWidget.cpp b/copasi/UI/CQSpeciesWidget.cpp index 5f26fa8297..57700530ce 100644 --- a/copasi/UI/CQSpeciesWidget.cpp +++ b/copasi/UI/CQSpeciesWidget.cpp @@ -104,9 +104,9 @@ void CQSpeciesWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQSpeciesWidget::slotBtnDeleteClicked() +void CQSpeciesWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblSpecies->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 58c58201de..f5d4419304 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); 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 1e0dd8c0d4..bddac5d122 100644 --- a/copasi/UI/CQUnitsWidget.cpp +++ b/copasi/UI/CQUnitsWidget.cpp @@ -89,9 +89,9 @@ void CQUnitsWidget::slotBtnNewClicked() updateDeleteBtns(); } -void CQUnitsWidget::slotBtnDeleteClicked() +void CQUnitsWidget::slotBtnDeleteClicked(bool needFocus) { - if (mpTblUnits->hasFocus()) + if (!needFocus || 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(); + slotBtnDeleteClicked(true); 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 e1f6fdc6b7..baa14d7994 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(); + virtual void slotBtnDeleteClicked(bool needFocus=false); virtual void slotBtnClearClicked(); virtual void slotSelectionChanged(); virtual void slotDoubleClicked(const QModelIndex proxyIndex); From b416bde9ead7a39756e281765427aaae8cad0a99 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 18 Nov 2024 13:04:24 +0100 Subject: [PATCH 48/54] - fix compilation with c++20 --- copasi/core/CFlags.h | 2 +- copasi/math/CMathContainer.cpp | 2 +- copasi/math/CMathContainer.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/copasi/core/CFlags.h b/copasi/core/CFlags.h index 6a1950f9c5..6f6ba0e84e 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/math/CMathContainer.cpp b/copasi/math/CMathContainer.cpp index c8d59f89dd..2acc4ad089 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) +bool CMathContainer::operator == (const CMathContainer & rhs) const { return mpModel == rhs.mpModel && mCompileTime == rhs.mCompileTime; } diff --git a/copasi/math/CMathContainer.h b/copasi/math/CMathContainer.h index 777b9eabb1..9e6902da64 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 genereate equivalent results + * Check whether 2 container would generate equivalent results */ - bool operator == (const CMathContainer & rhs); + bool operator == (const CMathContainer & rhs) const; /** * From 834585982459d58ddb242e5a9936983d5f036034 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 18 Nov 2024 13:04:33 +0100 Subject: [PATCH 49/54] typo --- copasi/UI/CQFunctionsWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copasi/UI/CQFunctionsWidget.cpp b/copasi/UI/CQFunctionsWidget.cpp index 1c2660969e..736bb3ef4b 100644 --- a/copasi/UI/CQFunctionsWidget.cpp +++ b/copasi/UI/CQFunctionsWidget.cpp @@ -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-acion, Functions?", + int ret = CQMessageBox::question(this, tr("Confirm Delete"), "Delete all non-built-in, non-mass-action, Functions?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (ret == QMessageBox::Yes) From b04a2dc8c3a8faea4830dddd8188c50a97e234e1 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 18 Nov 2024 15:34:29 +0100 Subject: [PATCH 50/54] - add support for implies --- .../CEvaluationNodeNormalizer.cpp | 1 + .../ConvertToCEvaluationNode.cpp | 13 + copasi/function/CEvaluationLexer.lpp | 8 + copasi/function/CEvaluationLexer_lex.cpp | 1093 ++++++++--------- copasi/function/CEvaluationNode.cpp | 1 + copasi/function/CEvaluationNode.h | 1 + copasi/function/CEvaluationNodeLogical.cpp | 21 + copasi/function/CEvaluationNodeLogical.h | 4 + copasi/function/CEvaluationTree.cpp | 1 + copasi/math/CJitCompilerImplementation.cpp | 7 + copasi/math/CJitCompilerImplementation.h | 1 + copasi/math/CMathContainer.cpp | 3 + copasi/math/CMathEvent.cpp | 5 + 13 files changed, 612 insertions(+), 547 deletions(-) diff --git a/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp b/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp index 0c6ba24b35..2e6ca305c8 100644 --- a/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp +++ b/copasi/compareExpressions/CEvaluationNodeNormalizer.cpp @@ -546,6 +546,7 @@ 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 18873df4dc..c6f92c22a7 100644 --- a/copasi/compareExpressions/ConvertToCEvaluationNode.cpp +++ b/copasi/compareExpressions/ConvertToCEvaluationNode.cpp @@ -2514,6 +2514,19 @@ 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/function/CEvaluationLexer.lpp b/copasi/function/CEvaluationLexer.lpp index 61dd5ad64f..37d8d7f34d 100644 --- a/copasi/function/CEvaluationLexer.lpp +++ b/copasi/function/CEvaluationLexer.lpp @@ -162,6 +162,14 @@ 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, diff --git a/copasi/function/CEvaluationLexer_lex.cpp b/copasi/function/CEvaluationLexer_lex.cpp index bae143b24e..1aa8fba2fe 100644 --- a/copasi/function/CEvaluationLexer_lex.cpp +++ b/copasi/function/CEvaluationLexer_lex.cpp @@ -1,5 +1,5 @@ -#line 2 "" +#line 3 "" #define YY_INT_ALIGNED short int @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 +#define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -21,24 +21,6 @@ */ #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. */ /* begin standard C headers. */ @@ -105,16 +87,12 @@ 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 @@ -133,26 +111,32 @@ typedef unsigned int flex_uint32_t; /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. +/* 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. */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -187,7 +171,7 @@ extern int yyleng; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) @@ -196,7 +180,7 @@ extern int yyleng; do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ @@ -204,6 +188,7 @@ extern int yyleng; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) + #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -211,7 +196,7 @@ extern int yyleng; struct yy_buffer_state { - std::streambuf* yy_input_file; + std::streambuf* yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ @@ -247,7 +232,7 @@ struct yy_buffer_state 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. */ @@ -281,16 +266,18 @@ struct yy_buffer_state #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 *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); +void *CEvaluationalloc (yy_size_t ); +void *CEvaluationrealloc (void *,yy_size_t ); +void CEvaluationfree (void * ); #define yy_new_buffer yy_create_buffer + #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ @@ -300,6 +287,7 @@ void yyfree ( void * ); } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } + #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ @@ -309,10 +297,12 @@ void yyfree ( void * ); } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -typedef flex_uint8_t YY_CHAR; + +typedef unsigned char YY_CHAR; #define yytext_ptr yytext @@ -327,8 +317,9 @@ typedef flex_uint8_t YY_CHAR; (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 82 -#define YY_END_OF_BUFFER 83 + +#define YY_NUM_RULES 83 +#define YY_END_OF_BUFFER 84 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -336,55 +327,56 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[395] = +static yyconst flex_int16_t yy_accept[402] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, - 80, 80, 8, 81, 74, 77, 65, 76, 64, 1, - 1, 81, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 81, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 75, 78, 81, 69, 81, 67, 72, 73, - 68, 10, 81, 12, 81, 81, 81, 81, 81, 81, - 81, 66, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 79, 79, 80, 0, 79, 0, 1, 1, - 0, 0, 0, 19, 0, 63, 79, 79, 79, 79, - - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 3, 79, 79, - 79, 79, 79, 79, 79, 0, 0, 18, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 13, 15, 9, 14, 11, 0, - 12, 10, 17, 0, 0, 0, 0, 0, 79, 79, - 1, 0, 1, 20, 62, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 61, 79, 79, 79, 79, 7, 79, 8, 79, 79, - - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 16, 70, 0, 50, 79, 79, 79, 79, 79, - 79, 79, 25, 79, 29, 79, 28, 79, 79, 23, - 79, 79, 79, 79, 79, 79, 21, 79, 58, 59, - 79, 79, 27, 79, 79, 24, 79, 79, 26, 79, - 4, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 71, 37, 79, 79, - 79, 79, 79, 36, 38, 52, 31, 35, 34, 79, - - 79, 79, 5, 79, 79, 79, 79, 79, 79, 33, - 48, 30, 49, 32, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 60, 79, 79, 51, 55, 79, 22, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 41, 79, 40, 79, 39, 79, - 79, 79, 79, 79, 79, 57, 79, 79, 79, 79, - 79, 43, 47, 46, 45, 42, 44, 79, 79, 6, - 56, 54, 79, 79, 79, 79, 79, 79, 53, 79, - 79, 79, 2, 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 const YY_CHAR yy_ec[256] = +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, @@ -416,7 +408,7 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[72] = +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, @@ -428,103 +420,105 @@ static const YY_CHAR yy_meta[72] = 1 } ; -static const flex_int16_t yy_base[400] = +static yyconst flex_uint16_t yy_base[407] = { 0, - 0, 0, 0, 0, 71, 0, 139, 140, 833, 834, - 143, 145, 834, 144, 834, 834, 834, 834, 834, 140, - 145, 134, 162, 824, 152, 156, 161, 172, 159, 182, + 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, 834, 834, 811, 834, 823, 834, 834, 834, - 834, 809, 808, 807, 792, 788, 210, 218, 798, 785, - 787, 834, 762, 758, 194, 195, 759, 766, 754, 750, - 755, 744, 244, 241, 251, 246, 805, 809, 251, 276, - 293, 0, 227, 834, 808, 801, 801, 234, 277, 275, - - 287, 276, 289, 292, 297, 305, 279, 306, 299, 300, - 800, 308, 312, 310, 314, 315, 316, 799, 317, 318, - 331, 319, 321, 328, 333, 298, 803, 834, 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, 834, 834, 834, 834, 834, 780, - 834, 834, 834, 766, 752, 751, 741, 737, 377, 376, - 418, 370, 373, 0, 834, 791, 401, 429, 433, 437, - 375, 434, 435, 443, 386, 438, 439, 441, 440, 444, - 789, 446, 387, 789, 788, 787, 448, 786, 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, 834, 834, 728, 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, 834, 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, 834, 739, 742, 744, 747, 162 - + 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 const flex_int16_t yy_def[400] = +static yyconst flex_int16_t yy_def[407] = { 0, - 394, 1, 1, 1, 394, 5, 1, 1, 394, 394, - 394, 394, 394, 395, 394, 394, 394, 394, 394, 394, - 394, 396, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 398, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 397, 397, 394, 395, 394, 395, 394, 394, - 394, 399, 396, 394, 396, 394, 397, 397, 397, 397, - - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 398, 398, 394, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 397, 397, - 394, 394, 394, 399, 394, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 394, 397, 397, 397, 397, 397, 397, 397, 397, 397, - - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 394, 394, 394, 394, 397, 397, 397, 397, 397, - 397, 397, 394, 397, 394, 397, 394, 397, 397, 394, - 397, 397, 397, 397, 397, 397, 394, 397, 394, 394, - 397, 397, 394, 397, 397, 394, 397, 397, 394, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 394, 394, 397, 397, - 397, 397, 397, 394, 394, 394, 394, 394, 394, 397, - - 397, 397, 397, 397, 397, 397, 397, 397, 397, 394, - 394, 394, 394, 394, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 394, 397, 397, 394, 394, 397, 394, 397, - 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 394, 397, 394, 397, 394, 397, - 397, 397, 397, 397, 397, 394, 397, 397, 397, 397, - 397, 394, 394, 394, 394, 394, 394, 397, 397, 397, - 394, 394, 397, 397, 397, 397, 397, 397, 394, 397, - 397, 397, 397, 0, 394, 394, 394, 394, 394 - + 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 const flex_int16_t yy_nxt[906] = +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, @@ -539,96 +533,97 @@ static const flex_int16_t yy_nxt[906] = 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, 80, 10, 10, 10, 10, 81, 10, 53, - 82, 54, 10, 10, 85, 85, 85, 85, 87, 10, - 10, 10, 10, 89, 94, 90, 90, 90, 89, 96, - 90, 90, 90, 96, 174, 91, 96, 96, 96, 96, - 91, 96, 83, 83, 127, 128, 96, 103, 95, 96, - 110, 106, 96, 96, 98, 99, 104, 96, 88, 96, - 105, 91, 96, 108, 113, 96, 91, 84, 84, 100, - - 101, 102, 107, 109, 96, 118, 92, 96, 111, 114, - 119, 96, 96, 125, 96, 112, 96, 115, 116, 96, - 134, 96, 96, 129, 130, 120, 123, 96, 135, 121, - 138, 117, 136, 96, 96, 159, 122, 131, 132, 133, - 96, 96, 124, 157, 143, 159, 157, 94, 96, 161, - 87, 96, 85, 85, 139, 137, 141, 162, 161, 162, - 96, 144, 146, 140, 111, 116, 171, 171, 171, 145, - 142, 95, 176, 175, 147, 118, 91, 149, 169, 148, - 152, 150, 96, 96, 96, 154, 96, 151, 146, 89, - 88, 90, 90, 90, 96, 153, 96, 180, 178, 96, - - 170, 91, 91, 172, 96, 172, 96, 96, 173, 173, - 173, 177, 96, 96, 186, 96, 179, 96, 181, 96, - 184, 96, 96, 96, 96, 96, 96, 91, 96, 187, - 182, 183, 190, 189, 192, 96, 185, 188, 96, 193, - 96, 200, 127, 128, 96, 96, 199, 195, 196, 96, - 96, 194, 96, 197, 204, 198, 203, 96, 201, 96, - 96, 96, 206, 96, 202, 96, 96, 96, 205, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 173, 173, 173, 173, 173, - 173, 208, 210, 96, 257, 257, 389, 207, 209, 175, - - 176, 96, 214, 258, 283, 211, 242, 249, 96, 307, - 215, 221, 217, 220, 197, 212, 213, 222, 216, 218, - 225, 219, 226, 195, 196, 224, 194, 227, 231, 223, - 228, 198, 229, 171, 171, 171, 96, 230, 223, 236, - 96, 243, 245, 91, 96, 250, 96, 96, 96, 96, - 247, 96, 237, 96, 96, 96, 263, 96, 96, 96, - 266, 269, 244, 246, 96, 96, 240, 238, 239, 91, - 241, 248, 251, 96, 254, 256, 255, 264, 252, 253, - 261, 267, 270, 265, 272, 262, 96, 96, 243, 245, - 268, 271, 247, 96, 250, 96, 96, 96, 263, 96, - - 96, 273, 96, 96, 96, 236, 96, 96, 266, 96, - 96, 269, 96, 242, 96, 274, 275, 96, 96, 96, - 96, 96, 96, 96, 293, 96, 96, 291, 96, 96, - 96, 292, 96, 276, 96, 244, 246, 240, 241, 248, - 96, 303, 305, 301, 306, 264, 277, 300, 280, 281, - 282, 271, 278, 279, 284, 267, 285, 265, 270, 286, - 268, 289, 304, 96, 96, 290, 96, 302, 96, 318, - 320, 316, 321, 319, 322, 317, 96, 308, 96, 96, - 300, 304, 96, 96, 96, 325, 96, 307, 96, 96, - 96, 96, 96, 315, 96, 309, 96, 96, 96, 96, - - 329, 96, 96, 96, 330, 96, 96, 96, 334, 96, - 96, 96, 303, 96, 338, 331, 305, 327, 328, 96, - 332, 335, 324, 340, 341, 355, 342, 357, 359, 323, - 96, 96, 96, 96, 96, 326, 355, 357, 359, 96, - 354, 96, 96, 345, 346, 96, 356, 349, 358, 360, - 96, 361, 362, 96, 343, 344, 347, 348, 351, 363, - 340, 352, 350, 364, 365, 367, 96, 368, 353, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 354, 96, 356, 358, 360, 96, 379, 96, 96, - 96, 96, 361, 96, 175, 96, 175, 362, 175, 175, - - 385, 175, 388, 378, 369, 175, 386, 175, 382, 380, - 391, 393, 381, 175, 370, 377, 384, 376, 375, 175, - 374, 367, 368, 175, 373, 175, 371, 387, 372, 386, - 390, 366, 383, 175, 175, 393, 175, 380, 392, 86, - 86, 86, 93, 93, 93, 97, 97, 126, 126, 126, - 175, 175, 175, 175, 175, 175, 339, 337, 336, 96, - 333, 175, 175, 175, 175, 175, 175, 175, 96, 314, - 175, 313, 312, 175, 311, 310, 175, 175, 175, 175, - 175, 299, 175, 298, 175, 297, 175, 296, 295, 294, - 288, 175, 287, 96, 96, 260, 259, 175, 235, 232, - - 234, 233, 156, 232, 156, 394, 96, 191, 96, 175, - 394, 394, 96, 163, 168, 167, 163, 155, 166, 158, - 165, 164, 163, 155, 158, 160, 159, 158, 157, 156, - 155, 96, 394, 9, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - - 394, 394, 394, 394, 394 + 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 const flex_int16_t yy_chk[906] = +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, @@ -647,7 +642,7 @@ static const flex_int16_t yy_chk[906] = 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, 399, 20, 29, 31, 27, 23, + 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, @@ -656,80 +651,81 @@ static const flex_int16_t yy_chk[906] = 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, 98, 36, 68, 46, 75, 76, 93, 84, 67, - 86, 83, 85, 85, 43, 41, 44, 68, 75, 76, - 393, 47, 48, 43, 45, 83, 89, 89, 89, 47, - 45, 93, 98, 389, 48, 49, 89, 50, 83, 49, - 51, 50, 100, 102, 99, 52, 107, 50, 84, 90, - 86, 90, 90, 90, 101, 51, 103, 102, 100, 104, - - 84, 90, 89, 91, 105, 91, 109, 110, 91, 91, - 91, 99, 106, 108, 107, 112, 101, 114, 103, 113, - 105, 115, 116, 117, 119, 120, 122, 90, 123, 108, - 104, 104, 110, 109, 112, 124, 106, 108, 121, 113, - 125, 120, 126, 126, 129, 130, 119, 115, 116, 131, - 132, 114, 133, 117, 123, 117, 122, 134, 121, 135, - 136, 137, 125, 141, 121, 138, 142, 144, 124, 140, - 139, 143, 145, 146, 147, 151, 150, 148, 149, 153, - 154, 152, 181, 170, 169, 172, 172, 172, 173, 173, - 173, 131, 133, 185, 193, 222, 386, 130, 132, 382, - - 129, 258, 136, 193, 222, 134, 181, 185, 177, 258, - 137, 142, 139, 141, 169, 135, 135, 143, 138, 139, - 149, 140, 150, 145, 146, 148, 144, 150, 154, 147, - 151, 147, 152, 171, 171, 171, 178, 153, 170, 177, - 179, 182, 183, 171, 180, 186, 187, 189, 188, 207, - 184, 190, 178, 192, 199, 197, 200, 201, 203, 208, - 202, 204, 182, 183, 211, 206, 179, 178, 178, 171, - 180, 184, 186, 205, 189, 192, 190, 200, 187, 188, - 197, 202, 204, 201, 206, 199, 209, 210, 212, 213, - 203, 205, 214, 215, 216, 217, 219, 218, 225, 220, - - 224, 208, 221, 228, 223, 207, 226, 230, 227, 238, - 239, 229, 249, 211, 231, 208, 208, 251, 256, 273, - 276, 277, 278, 253, 239, 274, 280, 238, 255, 285, - 275, 238, 254, 215, 237, 212, 213, 209, 210, 214, - 252, 253, 255, 251, 256, 225, 216, 249, 219, 220, - 221, 230, 217, 218, 223, 227, 224, 226, 229, 231, - 228, 237, 254, 261, 262, 237, 272, 252, 279, 274, - 275, 273, 277, 274, 278, 273, 281, 261, 282, 283, - 276, 280, 284, 286, 290, 285, 289, 283, 291, 292, - 301, 302, 306, 272, 293, 262, 315, 309, 316, 308, - - 290, 317, 318, 321, 291, 319, 320, 322, 301, 325, - 323, 324, 279, 326, 306, 292, 281, 289, 289, 327, - 293, 302, 284, 308, 309, 328, 315, 329, 330, 282, - 331, 332, 338, 334, 343, 286, 344, 345, 346, 341, - 327, 335, 342, 317, 318, 347, 328, 321, 329, 330, - 348, 331, 332, 349, 316, 316, 319, 320, 323, 334, - 324, 325, 322, 335, 338, 341, 350, 342, 326, 351, - 352, 363, 353, 364, 365, 369, 370, 371, 378, 383, - 384, 343, 379, 344, 345, 346, 388, 364, 385, 390, - 387, 392, 347, 391, 381, 380, 377, 348, 376, 375, - - 378, 374, 385, 363, 349, 373, 379, 372, 368, 365, - 388, 391, 367, 366, 350, 362, 370, 361, 360, 359, - 358, 352, 353, 357, 356, 355, 351, 383, 354, 384, - 387, 340, 369, 339, 337, 392, 336, 371, 390, 395, - 395, 395, 396, 396, 396, 397, 397, 398, 398, 398, - 333, 314, 313, 312, 311, 310, 307, 305, 304, 303, - 300, 299, 298, 297, 296, 295, 294, 288, 271, 270, - 269, 268, 267, 266, 265, 264, 263, 260, 259, 257, - 250, 248, 247, 246, 245, 244, 243, 242, 241, 240, - 236, 235, 234, 198, 196, 195, 194, 191, 176, 168, - - 167, 166, 165, 164, 160, 127, 118, 111, 97, 96, - 95, 88, 87, 82, 81, 80, 79, 78, 77, 74, - 73, 71, 70, 69, 66, 65, 64, 63, 62, 57, - 55, 24, 9, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - - 394, 394, 394, 394, 394 + 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 } ; /* The intent behind this definition is that it'll catch @@ -739,10 +735,10 @@ static const flex_int16_t yy_chk[906] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 1 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" /* scanner for kinetic functions */ -#line 10 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 10 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" #include #include "copasi/copasi.h" @@ -763,8 +759,7 @@ static const flex_int16_t yy_chk[906] = mPosition += yyleng;\ mpNodeList->push_back(mpNode); -#line 766 "" -#line 767 "" +#line 763 "" #define INITIAL 0 #define sSIGNorVALUE 1 @@ -783,11 +778,11 @@ static const flex_int16_t yy_chk[906] = #endif #ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT @@ -898,9 +893,9 @@ YY_DECL } { -#line 36 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 36 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" -#line 904 "" +#line 900 "" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -927,13 +922,13 @@ YY_DECL 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 >= 395 ) - yy_c = yy_meta[yy_c]; + if ( yy_current_state >= 402 ) + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; ++yy_cp; } - while ( yy_current_state != 394 ); + while ( yy_current_state != 401 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -955,7 +950,7 @@ YY_DECL case 1: YY_RULE_SETUP -#line 37 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 37 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeNumber(CEvaluationNode::SubType::DOUBLE, @@ -966,7 +961,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 45 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 45 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::EXPONENTIALE, @@ -977,7 +972,7 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 53 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 53 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::PI, @@ -988,7 +983,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 61 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 61 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::True, @@ -999,7 +994,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 69 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 69 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::False, @@ -1010,7 +1005,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 77 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 77 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::Infinity, @@ -1021,7 +1016,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 85 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 85 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeConstant(CEvaluationNode::SubType::NaN, @@ -1032,7 +1027,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 93 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 93 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sVALUE); mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::NOT, @@ -1043,7 +1038,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 101 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 101 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::LE, @@ -1054,7 +1049,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 109 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 109 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::LT, @@ -1065,7 +1060,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 117 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 117 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::GE, @@ -1076,7 +1071,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 125 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 125 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::GT, @@ -1087,7 +1082,7 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 133 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 133 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::NE, @@ -1098,7 +1093,7 @@ YY_RULE_SETUP YY_BREAK case 14: YY_RULE_SETUP -#line 141 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 141 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::EQ, @@ -1109,7 +1104,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 149 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 149 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::AND, @@ -1120,7 +1115,7 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 157 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 157 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeLogical(CEvaluationNode::SubType::XOR, @@ -1131,7 +1126,18 @@ YY_RULE_SETUP YY_BREAK case 17: YY_RULE_SETUP -#line 165 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#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, @@ -1140,10 +1146,10 @@ YY_RULE_SETUP return TOKEN_LOGICAL_OR; YY_BREAK -case 18: -/* rule 18 can match eol */ +case 19: +/* rule 19 can match eol */ YY_RULE_SETUP -#line 173 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 181 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeUnit(CEvaluationNode::SubType::DEFAULT, @@ -1152,10 +1158,10 @@ YY_RULE_SETUP return TOKEN_UNIT; YY_BREAK -case 19: -/* rule 19 can match eol */ +case 20: +/* rule 20 can match eol */ YY_RULE_SETUP -#line 181 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 189 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeObject(CEvaluationNode::SubType::CN, @@ -1164,9 +1170,9 @@ YY_RULE_SETUP return TOKEN_NUMBER; YY_BREAK -case 20: +case 21: YY_RULE_SETUP -#line 189 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 197 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeObject(CEvaluationNode::SubType::POINTER, @@ -1175,12 +1181,12 @@ YY_RULE_SETUP return TOKEN_NUMBER; YY_BREAK -case 21: +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 197 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 205 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG, yytext); @@ -1188,12 +1194,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 22: +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 204 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 212 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::LOG10, yytext); @@ -1201,12 +1207,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 23: +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 211 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 219 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::EXP, yytext); @@ -1214,12 +1220,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 24: +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 218 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 226 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIN, yytext); @@ -1227,12 +1233,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 25: +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 225 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 233 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COS, yytext); @@ -1240,12 +1246,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 26: +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 232 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 240 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TAN, yytext); @@ -1253,12 +1259,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 27: +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 239 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 247 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SEC, yytext); @@ -1266,12 +1272,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 28: +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 246 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 254 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSC, yytext); @@ -1279,12 +1285,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 29: +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 253 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 261 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COT, yytext); @@ -1292,12 +1298,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 30: +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 260 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 268 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SINH, yytext); @@ -1305,12 +1311,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 31: +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 267 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 275 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COSH, yytext); @@ -1318,12 +1324,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 32: +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 274 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 282 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::TANH, yytext); @@ -1331,12 +1337,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 33: +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 281 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 289 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SECH, yytext); @@ -1344,12 +1350,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 34: +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 288 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 296 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CSCH, yytext); @@ -1357,12 +1363,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 35: +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 295 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 303 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::COTH, yytext); @@ -1370,12 +1376,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 36: +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 302 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 310 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSIN, yytext); @@ -1383,12 +1389,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 37: +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 309 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 317 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOS, yytext); @@ -1396,12 +1402,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 38: +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 316 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 324 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTAN, yytext); @@ -1409,12 +1415,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 39: +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 323 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 331 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSEC, yytext); @@ -1422,12 +1428,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 40: +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 330 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 338 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSC, yytext); @@ -1435,12 +1441,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 41: +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 337 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 345 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOT, yytext); @@ -1448,12 +1454,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 42: +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 344 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 352 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSINH, yytext); @@ -1461,12 +1467,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 43: +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 351 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 359 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOSH, yytext); @@ -1474,12 +1480,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 44: +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 358 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 366 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCTANH, yytext); @@ -1487,12 +1493,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 45: +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 365 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 373 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCSECH, yytext); @@ -1500,12 +1506,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 46: +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 372 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 380 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCSCH, yytext); @@ -1513,12 +1519,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 47: +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 379 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 387 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ARCCOTH, yytext); @@ -1526,12 +1532,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 48: +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 386 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 394 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SIGN, yytext); @@ -1539,12 +1545,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 49: +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 393 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 401 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::SQRT, yytext); @@ -1552,12 +1558,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 50: +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 400 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 408 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::ABS, yytext); @@ -1565,12 +1571,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 51: +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 407 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 415 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FLOOR, yytext); @@ -1578,12 +1584,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 52: +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 414 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 422 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::CEIL, yytext); @@ -1591,12 +1597,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 53: +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 421 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 429 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::FACTORIAL, yytext); @@ -1604,12 +1610,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 54: +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 428 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 436 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RUNIFORM, yytext); @@ -1617,12 +1623,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_2; YY_BREAK -case 55: +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 435 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 443 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RGAMMA, yytext); @@ -1630,12 +1636,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_2; YY_BREAK -case 56: +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 442 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 450 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RPOISSON, yytext); @@ -1643,12 +1649,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_1; YY_BREAK -case 57: +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 449 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 457 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::RNORMAL, yytext); @@ -1656,12 +1662,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_2; YY_BREAK -case 58: +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 456 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 464 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MAX, yytext); @@ -1669,12 +1675,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION; YY_BREAK -case 59: +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 463 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 471 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MIN, yytext); @@ -1682,12 +1688,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION; YY_BREAK -case 60: +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 470 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 478 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeDelay(CEvaluationNode::SubType::DELAY, yytext); @@ -1695,12 +1701,12 @@ YY_RULE_SETUP return TOKEN_FUNCTION_2; YY_BREAK -case 61: +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 477 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 485 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mpNode = new CEvaluationNodeChoice(CEvaluationNode::SubType::IF, yytext); @@ -1708,14 +1714,14 @@ YY_RULE_SETUP return TOKEN_LOGICAL_CHOICE; YY_BREAK -case 62: -/* rule 62 can match eol */ +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 484 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 492 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" { std::string tmp(yytext); @@ -1726,10 +1732,10 @@ YY_RULE_SETUP return TOKEN_CALL; YY_BREAK -case 63: -/* rule 63 can match eol */ +case 64: +/* rule 64 can match eol */ YY_RULE_SETUP -#line 494 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 502 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" { std::string tmp(yytext); @@ -1740,9 +1746,9 @@ YY_RULE_SETUP return TOKEN_CALL; YY_BREAK -case 64: +case 65: YY_RULE_SETUP -#line 504 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 512 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sVALUE); mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::MINUS, @@ -1751,9 +1757,9 @@ YY_RULE_SETUP return TOKEN_SIGN; YY_BREAK -case 65: +case 66: YY_RULE_SETUP -#line 512 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 520 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sVALUE); mpNode = new CEvaluationNodeFunction(CEvaluationNode::SubType::PLUS, @@ -1762,9 +1768,9 @@ YY_RULE_SETUP return TOKEN_SIGN; YY_BREAK -case 66: +case 67: YY_RULE_SETUP -#line 520 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 528 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::POWER, @@ -1773,9 +1779,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_POWER; YY_BREAK -case 67: +case 68: YY_RULE_SETUP -#line 528 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 536 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MULTIPLY, @@ -1784,9 +1790,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_MULTIPLY; YY_BREAK -case 68: +case 69: YY_RULE_SETUP -#line 536 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 544 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::DIVIDE, @@ -1795,9 +1801,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_MULTIPLY; YY_BREAK -case 69: +case 70: YY_RULE_SETUP -#line 544 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 552 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MODULUS, @@ -1806,9 +1812,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_MODULUS; YY_BREAK -case 70: +case 71: YY_RULE_SETUP -#line 552 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 560 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::REMAINDER, @@ -1817,9 +1823,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_REMAINDER; YY_BREAK -case 71: +case 72: YY_RULE_SETUP -#line 560 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 568 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::QUOTIENT, @@ -1828,9 +1834,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_REMAINDER; YY_BREAK -case 72: +case 73: YY_RULE_SETUP -#line 568 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 576 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::PLUS, @@ -1839,9 +1845,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_PLUS; YY_BREAK -case 73: +case 74: YY_RULE_SETUP -#line 576 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 584 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mpNode = new CEvaluationNodeOperator(CEvaluationNode::SubType::MINUS, @@ -1850,9 +1856,9 @@ YY_RULE_SETUP return TOKEN_OPERATOR_PLUS; YY_BREAK -case 74: +case 75: YY_RULE_SETUP -#line 584 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 592 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mPosition += yyleng; @@ -1862,9 +1868,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_OPEN; YY_BREAK -case 75: +case 76: YY_RULE_SETUP -#line 593 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 601 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mPosition += yyleng; @@ -1874,9 +1880,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_VECTOR_OPEN; YY_BREAK -case 76: +case 77: YY_RULE_SETUP -#line 602 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 610 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sSIGNorVALUE); mPosition += yyleng; @@ -1886,9 +1892,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_COMMA; YY_BREAK -case 77: +case 78: YY_RULE_SETUP -#line 611 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 619 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mPosition += yyleng; @@ -1898,9 +1904,9 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_CLOSE; YY_BREAK -case 78: +case 79: YY_RULE_SETUP -#line 620 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 628 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mPosition += yyleng; @@ -1910,10 +1916,10 @@ YY_RULE_SETUP return TOKEN_STRUCTURE_VECTOR_CLOSE; YY_BREAK -case 79: -/* rule 79 can match eol */ +case 80: +/* rule 80 can match eol */ YY_RULE_SETUP -#line 629 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 637 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" BEGIN(sOPERATOR); mpNode = new CEvaluationNodeVariable(CEvaluationNode::SubType::DEFAULT, @@ -1922,10 +1928,10 @@ YY_RULE_SETUP return TOKEN_VARIABLE; YY_BREAK -case 80: -/* rule 80 can match eol */ +case 81: +/* rule 81 can match eol */ YY_RULE_SETUP -#line 637 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 645 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" mPosition += yyleng; // mpNode = new CEvaluationNodeWhiteSpace(CEvaluationNode::SubType::DEFAULT, @@ -1937,23 +1943,23 @@ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(sSIGNorVALUE): case YY_STATE_EOF(sOPERATOR): case YY_STATE_EOF(sVALUE): -#line 644 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 652 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" return 0; YY_BREAK -case 81: +case 82: YY_RULE_SETUP -#line 646 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 654 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" CCopasiMessage(CCopasiMessage::ERROR, MCFunction + 2, mPosition); return YYERRCODE; YY_BREAK -case 82: +case 83: YY_RULE_SETUP -#line 651 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 659 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" ECHO; YY_BREAK -#line 1957 "" +#line 1964 "" case YY_END_OF_BUFFER: { @@ -2139,9 +2145,9 @@ void yyFlexLexer::ctor_common() yyFlexLexer::~yyFlexLexer() { delete [] yy_state_buf; - yyfree( yy_start_stack ); + CEvaluationfree(yy_start_stack ); yy_delete_buffer( YY_CURRENT_BUFFER ); - yyfree( yy_buffer_stack ); + CEvaluationfree(yy_buffer_stack ); } /* The contents of this function are C++ specific, so the () macro is not used. @@ -2217,7 +2223,7 @@ int yyFlexLexer::yy_get_next_buffer() { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); - int number_to_move, i; + 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] ) @@ -2246,7 +2252,7 @@ int yyFlexLexer::yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2282,8 +2288,7 @@ int yyFlexLexer::yy_get_next_buffer() 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) ); + CEvaluationrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ @@ -2329,15 +2334,12 @@ int yyFlexLexer::yy_get_next_buffer() else ret_val = EOB_ACT_CONTINUE_SCAN; - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + 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 *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + 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()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -2369,10 +2371,10 @@ int yyFlexLexer::yy_get_next_buffer() 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 >= 395 ) - yy_c = yy_meta[yy_c]; + if ( yy_current_state >= 402 ) + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; } return yy_current_state; @@ -2397,11 +2399,11 @@ int yyFlexLexer::yy_get_next_buffer() 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 >= 395 ) - yy_c = yy_meta[yy_c]; + if ( yy_current_state >= 402 ) + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 394); + 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; } @@ -2463,7 +2465,7 @@ int yyFlexLexer::yy_get_next_buffer() else { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2537,9 +2539,6 @@ int yyFlexLexer::yy_get_next_buffer() */ void yyFlexLexer::yyrestart( std::istream* input_file ) { - if( ! input_file ) { - input_file = &yyin; - } yyrestart( *input_file ); } @@ -2596,7 +2595,7 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) CEvaluationalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2605,7 +2604,7 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) /* 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) ); + 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()" ); @@ -2641,9 +2640,9 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); + CEvaluationfree((void *) b->yy_ch_buf ); - yyfree( (void *) b ); + CEvaluationfree((void *) b ); } /* Initializes or reinitializes a buffer. @@ -2757,7 +2756,7 @@ void yyFlexLexer::yypop_buffer_state (void) */ void yyFlexLexer::yyensure_buffer_stack(void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -2766,14 +2765,14 @@ void yyFlexLexer::yyensure_buffer_stack(void) * 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**)yyalloc + (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; @@ -2785,7 +2784,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) 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) = (struct yy_buffer_state**)CEvaluationrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -2808,11 +2807,10 @@ void yyFlexLexer::yyensure_buffer_stack(void) new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) yyalloc( new_size ); + (yy_start_stack) = (int *) CEvaluationalloc(new_size ); else - (yy_start_stack) = (int *) yyrealloc( - (void *) (yy_start_stack), new_size ); + (yy_start_stack) = (int *) CEvaluationrealloc((void *) (yy_start_stack),new_size ); if ( ! (yy_start_stack) ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); @@ -2840,7 +2838,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) #define YY_EXIT_FAILURE 2 #endif -void yyFlexLexer::LexerError( const char* msg ) +void yyFlexLexer::LexerError( yyconst char* msg ) { std::cerr << msg << std::endl; exit( YY_EXIT_FAILURE ); @@ -2853,7 +2851,7 @@ void yyFlexLexer::LexerError( const char* msg ) do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + 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; \ @@ -2870,7 +2868,7 @@ void yyFlexLexer::LexerError( const char* msg ) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { int i; @@ -2880,7 +2878,7 @@ static void yy_flex_strncpy (char* s1, const char * s2, int n ) #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) +static int yy_flex_strlen (yyconst char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -2890,12 +2888,12 @@ static int yy_flex_strlen (const char * s ) } #endif -void *yyalloc (yy_size_t size ) +void *CEvaluationalloc (yy_size_t size ) { return malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) +void *CEvaluationrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both @@ -2908,13 +2906,14 @@ void *yyrealloc (void * ptr, yy_size_t size ) return realloc(ptr, size); } -void yyfree (void * ptr ) +void CEvaluationfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see CEvaluationrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 651 "/home/shoops/git/COPASI/copasi/function/CEvaluationLexer.lpp" +#line 659 "/io/build-system/git/COPASI.release/copasi/function/CEvaluationLexer.lpp" + diff --git a/copasi/function/CEvaluationNode.cpp b/copasi/function/CEvaluationNode.cpp index 1533063786..8016caeaf6 100644 --- a/copasi/function/CEvaluationNode.cpp +++ b/copasi/function/CEvaluationNode.cpp @@ -97,6 +97,7 @@ const CEnumAnnotation< std::string, CEvaluationNode::SubType > CEvaluationNode:: "Ge", "Gt", "If", + "Implies", // IMPLIES "Infinity", "Integer", "Invalid", diff --git a/copasi/function/CEvaluationNode.h b/copasi/function/CEvaluationNode.h index 09e4f97728..6028e14543 100644 --- a/copasi/function/CEvaluationNode.h +++ b/copasi/function/CEvaluationNode.h @@ -104,6 +104,7 @@ class CEvaluationNode : public CCopasiNode< std::string > EXP, True, XOR, + IMPLIES, RATIONALE, AND, CLOSE, diff --git a/copasi/function/CEvaluationNodeLogical.cpp b/copasi/function/CEvaluationNodeLogical.cpp index f4c0bc57eb..e9746fc94c 100644 --- a/copasi/function/CEvaluationNodeLogical.cpp +++ b/copasi/function/CEvaluationNodeLogical.cpp @@ -60,6 +60,10 @@ 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; @@ -125,6 +129,7 @@ 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; @@ -424,6 +429,7 @@ 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)) { @@ -460,6 +466,7 @@ 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; @@ -507,6 +514,11 @@ 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"; @@ -588,6 +600,7 @@ 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); @@ -622,6 +635,10 @@ 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; @@ -693,6 +710,10 @@ 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 c8ffeb5830..6b6c0c698b 100644 --- a/copasi/function/CEvaluationNodeLogical.h +++ b/copasi/function/CEvaluationNodeLogical.h @@ -82,6 +82,10 @@ 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; diff --git a/copasi/function/CEvaluationTree.cpp b/copasi/function/CEvaluationTree.cpp index 688c0e3ed2..57350198f0 100644 --- a/copasi/function/CEvaluationTree.cpp +++ b/copasi/function/CEvaluationTree.cpp @@ -798,6 +798,7 @@ 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; diff --git a/copasi/math/CJitCompilerImplementation.cpp b/copasi/math/CJitCompilerImplementation.cpp index 3ee2cf0ce4..a71b78ff6e 100644 --- a/copasi/math/CJitCompilerImplementation.cpp +++ b/copasi/math/CJitCompilerImplementation.cpp @@ -877,6 +877,13 @@ 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 8e4deed8a6..3e3ad6883c 100644 --- a/copasi/math/CJitCompilerImplementation.h +++ b/copasi/math/CJitCompilerImplementation.h @@ -95,6 +95,7 @@ class CJitCompilerImplementation: public CJitCompiler 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 2acc4ad089..063559004d 100644 --- a/copasi/math/CMathContainer.cpp +++ b/copasi/math/CMathContainer.cpp @@ -1846,6 +1846,7 @@ CEvaluationNode * CMathContainer::copyBranch(const CEvaluationNode * pNode, 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,6 +4729,7 @@ void CMathContainer::createDiscontinuityEvents(const CEvaluationTree * pTree, 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; @@ -4782,6 +4784,7 @@ std::string CMathContainer::createDiscontinuityTriggerInfix(const CEvaluationNod 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 += static_cast< const CEvaluationNode * >(pNode->getChild()->getSibling())->buildInfix() + ")) > 0"; break; diff --git a/copasi/math/CMathEvent.cpp b/copasi/math/CMathEvent.cpp index ab679c92b6..5f39c5c12f 100644 --- a/copasi/math/CMathEvent.cpp +++ b/copasi/math/CMathEvent.cpp @@ -809,6 +809,7 @@ 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; @@ -886,6 +887,10 @@ 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; } From 29badeb5a6e252676afc6d3c94963c332c2849a8 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Mon, 18 Nov 2024 15:34:42 +0100 Subject: [PATCH 51/54] comment out methods that are not implemented --- copasi/sbml/SBMLImporter.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/copasi/sbml/SBMLImporter.h b/copasi/sbml/SBMLImporter.h index 1cd1936f19..534403dea3 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 From 057a75875886eea982b8609c8ca8c3f8a89ce4a4 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Wed, 20 Nov 2024 10:19:58 -0500 Subject: [PATCH 52/54] Bug 3265: Raised an issue of missing initial value. --- copasi/model/CReaction.cpp | 45 ++++++- copasi/model/CReaction.h | 1 + copasi/sbml/SBMLImporter.cpp | 253 +++++++++++++++++------------------ 3 files changed, 166 insertions(+), 133 deletions(-) diff --git a/copasi/model/CReaction.cpp b/copasi/model/CReaction.cpp index 1fc5783a5c..e55d782163 100644 --- a/copasi/model/CReaction.cpp +++ b/copasi/model/CReaction.cpp @@ -916,7 +916,6 @@ void CReaction::initializeParameters() mParameters.addParameter(name, CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 1.0); - pParameter = mParameters.getParameter(name); } @@ -990,7 +989,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); + CValidity::Kind(CIssue::eKind::KineticsUndefined) | CIssue::eKind::VariablesMismatch | CIssue::eKind::ObjectNotFound | CIssue::eKind::MissingInitialValue); std::set< const CDataObject * > Dependencies; @@ -1003,7 +1002,6 @@ CIssue CReaction::compile() else { Issue &= CIssue(CIssue::eSeverity::Warning, CIssue::eKind::KineticsUndefined); - mValidity.add(Issue); mFlux = 0.0; mParticleFlux = 0.0; } @@ -1058,6 +1056,18 @@ 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; } @@ -1513,10 +1523,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 objectCN = objectNode->getData(); + std::string Data = objectNode->getData(); + CCommonName ObjectCN(Data.substr(1, Data.size() - 2)); - CDataObject * object = resolveCN(getFirstCModelOrDefault(copasi2sbmlmap), - CCommonName(objectCN.substr(1, objectCN.size() - 2))); + CDataObject * object = resolveCN(getFirstCModelOrDefault(copasi2sbmlmap), ObjectCN); std::string id; @@ -1705,6 +1715,29 @@ 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 3bb980e80f..7b82db86a4 100644 --- a/copasi/model/CReaction.h +++ b/copasi/model/CReaction.h @@ -35,6 +35,7 @@ #include #include #include +#include #include "copasi/model/CAnnotation.h" #include "copasi/model/CMetab.h" diff --git a/copasi/sbml/SBMLImporter.cpp b/copasi/sbml/SBMLImporter.cpp index 62822dc87f..022a48d372 100644 --- a/copasi/sbml/SBMLImporter.cpp +++ b/copasi/sbml/SBMLImporter.cpp @@ -3287,148 +3287,147 @@ CModelValue* SBMLImporter::createCModelValueFromParameter(const Parameter* sbmlP bool SBMLImporter::sbmlId2CopasiCN(ASTNode* pNode, std::map& copasi2sbmlmap, CCopasiParameterGroup& pParamGroup, SBase* pParentObject) { - // TODO CRITICAL We need to use a node iterator - + CNodeIterator< ASTNode > itNode(pNode); + itNode.setProcessingModes(CNodeIteratorMode::Before); bool success = true; - unsigned int i, iMax = pNode->getNumChildren(); - if (pNode->getType() == AST_NAME) + while (itNode.next() != itNode.end()) { - 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)) - { - // replace the name with the value - pNode->setType(AST_REAL); - pNode->setValue(speciesReference->second); - } - else if (pParam) + if (*itNode == NULL) { - pNode->setName(pParam->getStringCN().c_str()); + continue; } - else + + if (itNode->getType() == AST_NAME) { - std::map::iterator it = copasi2sbmlmap.begin(); - std::map::iterator endIt = copasi2sbmlmap.end(); - bool found = false; + 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); - while (it != endIt) + std::map< std::string, double >::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)) + { + // replace the name with the value + itNode->setType(AST_REAL); + itNode->setValue(speciesReference->second); + } + else if (pParam) { - int type = it->second->getTypeCode(); + itNode->setName(pParam->getStringCN().c_str()); + } + else + { + std::map< const CDataObject *, SBase * >::iterator it = copasi2sbmlmap.begin(); + std::map< const CDataObject *, SBase * >::iterator endIt = copasi2sbmlmap.end(); + bool found = false; - switch (type) + while (it != endIt) { - case SBML_COMPARTMENT: - pSBMLCompartment = dynamic_cast(it->second); - - if (this->mLevel == 1) - { - sbmlId = pSBMLCompartment->getName(); - } - else - { - sbmlId = pSBMLCompartment->getId(); - } - - if (sbmlId == pNode->getName()) - { - pNode->setName(dynamic_cast(it->first)->getObject(CCommonName("Reference=InitialVolume"))->getStringCN().c_str()); - found = true; - } - - break; + int type = it->second->getTypeCode(); - 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; + 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; + } - default: - break; + ++it; } - ++it; + if (!found) + success = false; } - - if (!found) success = false; - } - } - - for (i = 0; i < iMax; ++i) - { - if (!this->sbmlId2CopasiCN(pNode->getChild(i), copasi2sbmlmap, pParamGroup, pParentObject)) - { - success = false; - break; } } From 5721276e1260a5c8c6b65c15690cf9386314d1e5 Mon Sep 17 00:00:00 2001 From: Stefan Hoops Date: Wed, 20 Nov 2024 16:32:23 -0500 Subject: [PATCH 53/54] Bug 3267: Fixed saving of option. --- copasi/UI/CQFittingWidget.cpp | 15 +++++++++------ copasi/UI/CQOptimizationWidget.cpp | 21 ++++++++++++--------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/copasi/UI/CQFittingWidget.cpp b/copasi/UI/CQFittingWidget.cpp index 46c719580d..327d3f4119 100644 --- a/copasi/UI/CQFittingWidget.cpp +++ b/copasi/UI/CQFittingWidget.cpp @@ -217,6 +217,12 @@ 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; @@ -273,6 +279,7 @@ 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); @@ -283,8 +290,6 @@ bool CQFittingWidget::loadTaskProtected() mpConstraints->setExperimentSet(const_cast(mpExperimentSet)); mpConstraints->setCrossValidationSet(const_cast(mpCrossValidationSet)); - mpCheckDisplayPopulation->setChecked(pTask->getProblem()->getParameter("DisplayPoplations")->getValue< bool >()); - mChanged = false; return true; @@ -299,8 +304,6 @@ bool CQFittingWidget::runTask() mnParamterSetsBeforeRun = pTask->getObjectDataModel()->getModel()->getModelParameterSets().size(); - pTask->getProblem()->getParameter("DisplayPoplations")->setValue(mpCheckDisplayPopulation->isChecked()); - if (!commonBeforeRunTask()) return false; bool success = commonRunTask(); @@ -395,7 +398,6 @@ void CQFittingWidget::init() pGroupLayout->setContentsMargins(0, 0, 0, 0); mpTabWidget->setCornerWidget(pGroup); - } void CQFittingWidget::slotIncreaseTabHeight() @@ -405,12 +407,13 @@ 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/CQOptimizationWidget.cpp b/copasi/UI/CQOptimizationWidget.cpp index dec2c77fcb..e77cdb4a9b 100644 --- a/copasi/UI/CQOptimizationWidget.cpp +++ b/copasi/UI/CQOptimizationWidget.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the +// 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. @@ -115,6 +115,12 @@ 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); @@ -150,6 +156,7 @@ 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()]))); @@ -157,8 +164,6 @@ bool CQOptimizationWidget::loadTaskProtected() mpConstraints->load(mpDataModel, pProblem->getGroup("OptimizationConstraintList"), NULL, NULL); - mpCheckDisplayPopulation->setChecked(pTask->getProblem()->getParameter("DisplayPoplations")->getValue< bool >()); - mChanged = false; return true; @@ -177,8 +182,6 @@ bool CQOptimizationWidget::runTask() if (!pTask) return false; - pTask->getProblem()->getParameter("DisplayPoplations")->setValue(mpCheckDisplayPopulation->isChecked()); - if (!commonBeforeRunTask()) return false; return commonRunTask(); @@ -256,14 +259,13 @@ 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); } @@ -277,13 +279,14 @@ void CQOptimizationWidget::slotIncreaseTabHeight() void CQOptimizationWidget::slotDecreaseTabHeight() { auto height = mpTabWidget->height(); + if (height < 300) return; + height -= 100; mpTabWidget->setMinimumHeight(height); } - void CQOptimizationWidget::destroy() {} From b61441b4378d61cfb936bc9ee5d007eac38cebec Mon Sep 17 00:00:00 2001 From: Frank Bergmann Date: Wed, 4 Dec 2024 09:45:12 +0100 Subject: [PATCH 54/54] - on macos allow to open a new instance from the file menu --- copasi/UI/copasiui3window.cpp | 13 +++++++++++++ copasi/UI/copasiui3window.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/copasi/UI/copasiui3window.cpp b/copasi/UI/copasiui3window.cpp index 0e273df0e2..256363e8cd 100644 --- a/copasi/UI/copasiui3window.cpp +++ b/copasi/UI/copasiui3window.cpp @@ -38,6 +38,8 @@ #include #include #include +#include + #include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) @@ -748,6 +750,12 @@ 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"); @@ -4208,6 +4216,11 @@ 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 4771ed003a..1aeb6e91a9 100644 --- a/copasi/UI/copasiui3window.h +++ b/copasi/UI/copasiui3window.h @@ -206,6 +206,8 @@ public slots: void slotHandleCopasiScheme(const QUrl& url); + void slotStartNewInstance(); + public: /** * performs the next action from the action stack